I've reset my raspberry pi because after configuring Samba, bitcoind started downloading the blockchain much slower. Removing Samba didn't return it to the original speeds so I figured starting with a fresh Raspian SD card might speed things up again.

I am following the same instructions to install bitcoin-cli but this time I get this error

Error: Failed saving settings file:
- Error: Unable to open settings file /mnt/bitcoin/Coins/Blockchain/settings.json.tmp for writing

The full instructions I'm following are here. I've used the same drive mounted at the same place as before. I don't have a file settings.json.tmp. I do have settings.json and I naively cloned it and named it settings.json.tmp, but it didn't help.

This is how I'm installing it:

tar xvf bitcoin-0.21.1-arm-linux-gnueabihf.tar.gz
sudo install -m 0755 -o root -g root -t /usr/local/bin bitcoin-0.21.1/bin/*

And this is how I'm trying to start it:

bitcoind -daemon --datadir=/mnt/bitcoin/Coins/Blockchain

I guessed maybe that the problem was that this time I was installing version 21.1 whereas before I was using version 21.0, I still had the old .tar.gz file so I tried installing the previous version, but got the same error.

Then I tried creating a new blockchain folder at /mnt/bitcoin/Coins/Blockchain2/ but I get the same error. If that's a fresh folder, why would it try to read any files?

Does anyone know what the problem is here? Googling the error returns absolutely nothing.

I would appreciate any help.

EDIT: Extra info

I've just tried creating a new folder in the home directory instead of the hard drive and it worked. So why not on the hard drive? When I try to sudo rm settings.json.tmp I get rm: cannot remove 'settings.json.tmp': No such file or directory. Why is it trying to read a file that's not even there?

EDIT 2: ls -l /mnt/bitcoin/Coins/Blockchain/

Here is the output of ls -l /mnt/bitcoin/Coins/Blockchain/:

total 16896
-rwxr-xr-x 1 root root       37 Jun 18 17:19 anchors.3386
-rwxr-xr-x 1 root root       37 Apr 23 11:42 banlist.dat
-rwxr-xr-x 1 root root        5 Jun 12 20:40 bitcoind.pid
drwxr-xr-x 3 root root   262144 Jun 18 14:41 blocks
drwxr-xr-x 2 root root   262144 Jun 18 08:43 chainstate
-rwxr-xr-x 1 root root 12969496 Jun 18 17:19 debug.log
-rwxr-xr-x 1 root root   247985 May 19 15:27 fee_estimates.dat
-rwxr-xr-x 1 root root       18 May 19 15:27 mempool.dat
-rwxr-xr-x 1 root root  2623946 Jun 18 17:19 peers.dat
-rwxr-xr-x 1 root root        7 Jun 12 20:40 settings.json
drwxr-xr-x 2 root root   131072 Apr 23 11:42 wallets
  • Is settings.json.tmp perhaps a symlink to a non-existing file? What does ls -l /mnt/bitcoin/Coins/Blockchain2/ tell you? Jun 18, 2021 at 23:52
  • @PieterWuille I added the output as an edit to the post because trying to format it in a comment wasn't working. As you can see, the .tmp isn't there. I wondered if it's causing the issue because of permissions, but I believe I didn't have to change any permissions when it worked before I reset. And the permissions look good here anyway I think (user has read and write, that's good yes?). Jun 19, 2021 at 1:12
  • Well it's failing to open the settings.json.tmp file for writing. This may indicate that you don't have write permissions. Are you running Bitcoin Core as root? Jun 19, 2021 at 1:26
  • @PieterWuille Yep, haha, that was it. I did sudo bitcoind -daemon --datadir=/mnt/bitcoin/Coins/Blockchain and it's working. I just kept the same alias that I used before. I don't get why it didn't need root before. Thanks so much for your help. 🦄 Jun 19, 2021 at 1:36

1 Answer 1


I wasn't running it as root. Once I ran it with sudo bitcoind -daemon --datadir=/mnt/bitcoin/Coins/Blockchain, it worked as expected.

  • This solution doesn't seem to work for bitcoin-core installed as a snap. Feb 3 at 14:03

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.