3

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!

Murch
  • 71,155
  • 33
  • 180
  • 600

5 Answers5

4

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.

Claris
  • 15,323
  • 2
  • 26
  • 43
3

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

Tony Sanak
  • 1,654
  • 4
  • 22
2

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.

chytrik
  • 17,910
  • 3
  • 18
  • 47
1

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

0

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.

Glen
  • 1