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

CC BY-SA 4.0
2024-02-03T14:03:58.717Z
This solution doesn't seem to work for bitcoin-core installed as a snap.
Keir Finlow-Bates
CC BY-SA 4.0
2021-06-20T16:44:50.067Z
2021-06-20T16:44:50.067Z
Alfie Stoppani
<p>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.</p>
<p>I am following the same instructions to install bitcoin-cli but this time I get this error</p>
<pre><code>Error: Failed saving settings file:
- Error: Unable to open settings file /mnt/bitcoin/Coins/Blockchain/settings.json.tmp for writing
</code></pre>
<p>The full instructions I'm following are <a href="https://howchoo.com/bitcoin/run-bitcoin-full-node-raspberry-pi" rel="nofollow noreferrer">here</a>. I've used the same drive mounted at the same place as before. I don't have a file <code>settings.json.tmp</code>. I do have <code>settings.json</code> and I naively cloned it and named it <code>settings.json.tmp</code>, but it didn't help.</p>
<p>This is how I'm installing it:</p>
<pre><code>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/*
</code></pre>
<p>And this is how I'm trying to start it:</p>
<pre><code>bitcoind -daemon --datadir=/mnt/bitcoin/Coins/Blockchain
</code></pre>
<p>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.</p>
<p>Then I tried creating a new blockchain folder at <code>/mnt/bitcoin/Coins/Blockchain2/</code> but I get the same error. If that's a fresh folder, why would it try to read any files?</p>
<p>Does anyone know what the problem is here? Googling the error returns absolutely nothing.</p>
<p>I would appreciate any help.</p>
<p>EDIT: Extra info</p>
<p>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 <code>sudo rm settings.json.tmp</code> I get <code>rm: cannot remove 'settings.json.tmp': No such file or directory</code>. Why is it trying to read a file that's not even there?</p>
<p>EDIT 2: <code>ls -l /mnt/bitcoin/Coins/Blockchain/</code></p>
<p>Here is the output of <code>ls -l /mnt/bitcoin/Coins/Blockchain/</code>:</p>
<pre><code>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
</code></pre>

CC BY-SA 4.0
2021-06-18T23:52:24.960Z
Is settings.json.tmp perhaps a symlink to a non-existing file? What does `ls -l /mnt/bitcoin/Coins/Blockchain2/` tell you?
Pieter Wuille
CC BY-SA 4.0
2021-06-19T01:12:14.543Z
@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?).
Alfie Stoppani
CC BY-SA 4.0
2021-06-19T01:26:16.717Z
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?
Pieter Wuille
CC BY-SA 4.0
2021-06-19T01:36:54.943Z
@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. 
Alfie Stoppani
<bitcoin-core><bitcoind><linux><raspberry-pi>
I can't start bitcoind on Raspberry Pi. Why do I need settings.json.tmp when I didn't need it before?
Alfie Stoppani
# I can't start bitcoind on Raspberry Pi. Why do I need settings.json.tmp when I didn't need it before?

(Asked by: username_0 on 2021-06-18)

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

**Tags:** bitcoin-core, bitcoind, linux, raspberry-pi

> **Comments:**
> **username_1**: Is settings.json.tmp perhaps a symlink to a non-existing file? What does `ls -l /mnt/bitcoin/Coins/Blockchain2/` tell you?  
> **username_0**: @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?).  
> **username_1**: 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?  
> **username_0**: @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.   

---

## 1 answers

### Answer by username_0 on 2021-06-20. Score: 1 | Accepted answer

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

> **Comments:**
> **username_2**: This solution doesn't seem to work for bitcoin-core installed as a snap.  

---

