18

I am trying to change the data directory used by bitcoind and I am uder the impression that the command -datadir was removed as I can't find it with bitcoin-cli help, when I try to use it I get Too few parameters and bitcoin-cli help datadir says datadir doesn't exist. I need to specify a directory that is not on the root partition, how to do it ?

Also why bitcoin core is so user unfriendly, it's quite surprising I thought it was the main bitcoin program. It started downloading the blockchain on my root partition without me even being aware of it (just start bitcoind and it starts silently downloading).

1
  • Yeah, it would be better if it asked us where we wanted to store the large data files, when we install via the command line. It does not. Not even a warning or anything. Glad I found this post. :-) Commented Nov 14, 2019 at 2:01

3 Answers 3

16

you should use it like this bitcoin

bitcoind -datadir=/your/external/path

Hope this helps!

1
  • Relative paths work too: bitcoin-cli -datadir=. stop Commented Feb 2, 2021 at 18:38
11

If you would like to do this permanently create a ~/.bitcoin/bitcoin.conf file and include:

datadir=/your/path

1
  • 1
    I just tried this and it doesn't work. Can you please verify that the commands are still valid? Commented Jan 20, 2021 at 0:05
1

You probably forgot to move the bitcoin.conf file from your non-default data directory to the default location. (~/.bitcoin/bitcoin.conf)

Then when you rund bitcoind, it access the bitcoin.conf file in the default way, and that file tells bitcoind to put blocks where datadir= specifices.

1
  • that does work but then it creates another bitcoin.conf under the provided datadir path, and that's what bitcoin-qt also opens up... it is a bit confusing, should I set other conf settings in the .bitcoin/bitcoin.conf or new datadir's bitcoin.conf
    – WhoIsNinja
    Commented Aug 6, 2023 at 23:12

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.