<blockquote>
<p>Where Bitcoin-Qt is really keeping it's own conf file remembering where .bitcoin dir is as I move bitcoin.conf around?</p>
</blockquote>
<p>bitcoin-qt uses <code>QSettings</code> which maintains the settings in a separate location that depends on your operating system. This allows bitcoin-qt to maintain its own settings independent of bitcoind. When you set the datadir location in bitcoin-qt, it reads and writes it from those settings rather than to a bitcoin.conf or anything that would be shared with bitcoind.</p>
<p>Since <code>QSettings</code> is specific to bitcoin-qt, bitcoind cannot read it and thus does not know about your different datadir location.</p>
<blockquote>
<p>How to make Bitcoind use external drive?</p>
</blockquote>
<p>You can create a bitcoin.conf file in <code>.bitcoin/</code> and add a <code>datadir=&lt;path&gt;</code> line. Any configuration settings that you want to apply should be done in that bitcoin.conf, as any bitcoin.conf in your actual datadir will be ignored.</p>

CC BY-SA 4.0
2024-03-11T14:50:18.270Z
2024-03-11T14:50:18.270Z
Ava Chow
<p>Thanks for the reply!</p>
<p>I have sorted my problem. Didn't have the time to read you reply though :)</p>
<p>Can't fight the behaviour of bitcoind making own .bitcoin data dir on SD card, then join it. In that dir I created bitcoin.conf file and that's the sole contents of that dir.</p>
<p>In the bitcoin.conf file I added lines:</p>
<pre><code>datadir=&lt;pathToDataDirOnExternalDrive&gt;
</code></pre>
<p>as well as</p>
<pre><code>prune=&lt;pruneValueFromJSONsettingsFileInTheDataDirOnExternalDrive&gt;
</code></pre>
<p>because the blocks I have on external drive have been pruned. Lack of this pruning setting was another part of the problem.</p>
<p>and both bitcoind and bitcoin-qt now starting up correctly with no questions, errors or pop-up messages. They are behaving the same now.</p>

CC BY-SA 4.0
2024-03-11T23:37:50.400Z
2024-03-11T23:43:11.613Z
2024-03-11T23:43:11.613Z
jurijus01
<p>Using Bitcoin core 25.1 on Raspberry Pi. Have .bitcoin dir on external drive.</p>
<p>Bitcoin-25.1 package after unarchiving came with bin folder containing Bitcoin-QT and Bitcoind binary files. Bitcoin.conf file lived in the root dir of this folder.</p>
<p>I specified .bitcoin dir on external drive for Bitcoin-Qt the first time it started up and since then it know where it is.</p>
<p>However each time I start Bitcoind it makes .bitcoin dir on SD drive no matter how or where I put bitcoin.conf file for it to read from.</p>
<p>I use Bitcoin-Qt for playing around. Main work is done by Bitcoind. I expect both reading the same bitcoin.conf file, but it's not happening. Also, Bitcoin-QT keeps crashing its QT part as I use KVM switch to switch HDMI.</p>
<p>My quesions are:</p>
<ol>
<li>Where Bitcoin-Qt is really keeping it's own conf file remembering where .bitcoin dir is as I move bitcoin.conf around? I can delete bitcoin.conf from the computer and it would still find .bitcoin dir on external drive correctly.</li>
<li>How to make Bitcoind use external drive? Trying to take advantage of .bitcoin dir it is creating every time on SD drive. I copied all contents of healthy data dir of the external drive except blocks dir and made bitcoin.conf pointing to blocksdir on external drive. But with no success.</li>
</ol>
<p>Any thoughts would be appreciated!</p>

<bitcoin-core><bitcoind>
Bitcoin-qt and Bitcoind see bitcoin.conf file differently
jurijus01
# Bitcoin-qt and Bitcoind see bitcoin.conf file differently

(Asked by: username_0 on 2024-03-11)

Using Bitcoin core 25.1 on Raspberry Pi. Have .bitcoin dir on external drive.

Bitcoin-25.1 package after unarchiving came with bin folder containing Bitcoin-QT and Bitcoind binary files. Bitcoin.conf file lived in the root dir of this folder.

I specified .bitcoin dir on external drive for Bitcoin-Qt the first time it started up and since then it know where it is.

However each time I start Bitcoind it makes .bitcoin dir on SD drive no matter how or where I put bitcoin.conf file for it to read from.

I use Bitcoin-Qt for playing around. Main work is done by Bitcoind. I expect both reading the same bitcoin.conf file, but it's not happening. Also, Bitcoin-QT keeps crashing its QT part as I use KVM switch to switch HDMI.

My quesions are:

1. Where Bitcoin-Qt is really keeping it's own conf file remembering where .bitcoin dir is as I move bitcoin.conf around? I can delete bitcoin.conf from the computer and it would still find .bitcoin dir on external drive correctly.
2. How to make Bitcoind use external drive? Trying to take advantage of .bitcoin dir it is creating every time on SD drive. I copied all contents of healthy data dir of the external drive except blocks dir and made bitcoin.conf pointing to blocksdir on external drive. But with no success.

Any thoughts would be appreciated!

**Tags:** bitcoin-core, bitcoind


---

## 2 answers

### Answer by username_1 on 2024-03-11. Score: 0

> Where Bitcoin-Qt is really keeping it's own conf file remembering where .bitcoin dir is as I move bitcoin.conf around?

bitcoin-qt uses `QSettings` which maintains the settings in a separate location that depends on your operating system. This allows bitcoin-qt to maintain its own settings independent of bitcoind. When you set the datadir location in bitcoin-qt, it reads and writes it from those settings rather than to a bitcoin.conf or anything that would be shared with bitcoind.

Since `QSettings` is specific to bitcoin-qt, bitcoind cannot read it and thus does not know about your different datadir location.

> How to make Bitcoind use external drive?

You can create a bitcoin.conf file in `.bitcoin/` and add a `datadir=<path>` line. Any configuration settings that you want to apply should be done in that bitcoin.conf, as any bitcoin.conf in your actual datadir will be ignored.


---

### Answer by username_0 on 2024-03-11. Score: 0

Thanks for the reply!

I have sorted my problem. Didn't have the time to read you reply though :)

Can't fight the behaviour of bitcoind making own .bitcoin data dir on SD card, then join it. In that dir I created bitcoin.conf file and that's the sole contents of that dir.

In the bitcoin.conf file I added lines:

```
datadir=<pathToDataDirOnExternalDrive>

```

as well as

```
prune=<pruneValueFromJSONsettingsFileInTheDataDirOnExternalDrive>

```

because the blocks I have on external drive have been pruned. Lack of this pruning setting was another part of the problem.

and both bitcoind and bitcoin-qt now starting up correctly with no questions, errors or pop-up messages. They are behaving the same now.


---

