I'm running Bitcoin Core 0.20.1 on a Raspberry Pi 4 (running Raspberry Pi OS standard).

It's just a standard install of Bitcoin Core, I built from source and installed into /home/pi/.bitcoin (looking back, I should have created the 'bitcoin' user first).

I created a new user 'bitcoin' and mounted an external HDD (under /mnt/bitcoin), now when running bitcoind I specify this location as the datadir. I had initially added this location in the bitcoin.conf file but was getting errors and someone mentioned not to add the datadir in the conf file.

Bitcoind runs just fine and uses the correct datadir when using the following command (whilst logged in a bitcoin user)

bitcoind -daemon -datadir=/mnt/bitcoin

The issue

The issue is when I try to access a bitcoin-cli command. I'm currently getting the following error when running

bitcoin-cli getblockcount

************************ EXCEPTION: N5boost10filesystem16filesystem_errorE
boost::filesystem::create_directory: File exists: "/home/bitcoin/.bitcoin" bitcoin in AppInitRPC()

It can definitely access bitcoin-cli, as when I run the command without any parameters, it returns the help screen.

Can someone point me in the right direction to fixing this please?

  • I believe this is a bug with boost::filesystem itself when running on old systems. There is a fix in boost > .77, but i think it might need to be enabled at compile time. I found the issue in the boost project and luke jr had actually commented on it, but i've misplaced where it is. found your question while looking.
    – fuzzyTew
    Commented Nov 3, 2021 at 14:27
  • Here is the issue thread: github.com/boostorg/filesystem/issues/172 soutions are: upgrade system, downgrade glibc headers?, downgrade boost, or upgrade boost and jump through hoops
    – fuzzyTew
    Commented Nov 3, 2021 at 14:29


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.