Sorry, noob question I am new to anything linux related. I managed to set up bitcoin core just fine on my raspberry pi 4 and I have an external HDD that I want to use as my data directory for the 250 GB or so of blocks (this is not my main storage that I boot from).

Problem is, I have absolutely no idea how the bitcoind program decides on its data directory. I have run 3 or 4 times and I have 3 or 4 different data directories, none of which are on the HDD. How do I tell it where to store the data? Also, where do I put the bitcoin.conf file because it can never seem to find it. I have most of the blockchain pre-installed on my HDD from my windows pc and so I would ideally use that same directory but if thats not possible thats fine, I at least want it on my HDD though. I have followed several guides and nothing has worked for me so far. I appreciate your time for any respones!

5 Answers 5


Unless explicitly told otherwise, the datadir is always placed in /home/$USER/.bitcoin, there is no logic for automatically using any location other than this. The configuration file is always in the data directory as bitcoin.conf.


One of the ways of pointing to your data directory is making a change to your bitcoin.conf file (it's usually located in ~/.bitcoin/bitcoin.conf path) Add the line:

datadir = /path_to_your_data_directory

If you're on raspberry Pi I highly suggest reading through the Raspibolt documentation, it's step by step installation guide, linking specific chapter related to your question below: https://stadicus.github.io/RaspiBolt/raspibolt_30_bitcoin.html#prepare-data-directory

  • 1
    3 second delta has got to be some sort of new record.
    – Claris
    Commented Feb 20, 2020 at 20:18

When you start bitcoind, you can specify a non-default data directory:

$ bitcoind datadir=/your/custom/filepath

This will override the option set in the bitcoin.conf file, if there is one set there.


here i have some example script for UTX token ( bitcoind and the friend )

example script and manage blockchain

also in that script include block monitoring using bash and qt compare with public blockchain explore node


The SD card on a Raspberry Pi will not be large enough to accommodate the Bitcoin blockchain. However, by default the data directory will be /home/$USER/.bitcoin which is on the SD card. One way to change this to a data directory on an external hard disk drive would be to create a symbolic link to the new directory, as follows:

ln -s /mnt/ext/bitcoin /home/$USER/bitcoin/.bitcoin

Correct the above line to accommodate your pathways.

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.