0

I've installed bitcoin-core and downloaded the blockchain in Ubuntu. Now that I have switched to Manjaro Linux and installed bitcoin-core again, It creates the .bitcoin directory in /root/.bitcoin/ and tries to read the bitcoin.conf in that location whilst I put my .bitcoin directory backup at /home/user/.bitcoin/.

It is important for me to have the blockchain data at my /home because of the lack of free space in my /root

I also found this configuration, But I'm not sure whether it has anything to do with my problem or how to use it enter image description here

And here are the commands that I used to install the bitcoin-core enter image description here

And here are the first bitcoind execute messages enter image description here

1
  • 2
    Don't run bitcoind as root. Did you add sudo while running bitcoind?
    – user103136
    Aug 15, 2021 at 5:21

1 Answer 1

1

I use Arch linux and had a similar issue. Why bitcoin by default download blockchain to the root folder? I don't know - this is just system default setting. Many applications which require considerable disk space (like databases) usually place data to /opt, /var or /srv or other root subfolder. Taking into account that typical linux setup has 10-20 GB for root folder which is not sufficient to keep large databases, such setup with default settings does not work, so applications like bitcoind (300 GB and more for full node) require manual configuration anyway.

You can fix your problem in a following way (depending on how you start bitcoind). If you start it manually by typing command in shell (which is reasonable assumption because you seem to compile bitcoind from source, not using distro package), then you should add '-datadir' and '-conf' parameters when start bitcoind (you can write simple bash script starting bitcoind with correct parameters). Datadir parameter should point to '.bitcoind' folder in home user directory. The conf parameter should point to bitcoind configuration file which may be default /etc/bitcoin/bitcoin.conf or somewhere else. Editing this configuration file is needed to specify several bitcoind options like rpc login (for bitcoin-cli to connect to server), txindex, etc.

If you start bitcoind as a systemd service, then you should override default systemd service file settings. For example, in Arch linux systemd service file (in /usr/lib/systemd/system/) has line 'ExecStart=/usr/bin/bitcoind ... -datadir=/var/lib/bitcoind' which makes bitcoind (launched by systemd) by default read data from /var/lib. You can change this setting by writing simple 5-6 lines 'systemd drop-in override' configuration file which changes this parameter (there are lots of answered questions on other sites about this issue).

Once your start bitcoind manually you should see correct path in its ouput (lines 'Using data directory' and 'Config file').

P.S. There is no Arch/Manjaro distro. They are two different OS.

P.P.S In Arch linux default settings for bitcoind are writing data to /var/lib/ with user permissions 'bitcoin:bitcoin'. I don't know why in Manjaro bitcoind saves data to /root folder. Perhaps you have run bitcoind with sudo?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.