1

I installed bitcoin core in windows 10 using ( Windows Subsystem for Linux ) . I installed ubuntu from the store and I used it to Install bitcoin core. The thing is everything was installed in the main hard disk C and it doesn't have enough space to download blocks. Is there a way to copy it to another partition (D partition because it has enough space) ? or while running bitcoind is there any way to run it with a specified path?

Ps: I hope the question is clear

Thank you

saadia
  • 25
  • 6

2 Answers2

2

Make sure to stop bitcoind with bitcoin-cli stop, then move your data directory to a new folder and add the following line to your bitcoin.conf:

datadir=path/to/new/directory

This file should be somewhere in C:\Users\username\AppData\Roaming\Bitcoin\bitcoin.conf in Windows and ~/.bitcoin/bitcoin.conf in Linux.

As the user AntMor replied, you can also pass this configuration every time you run bitcoind.

Pedro
  • 743
  • 4
  • 19
  • Thank you Pedro! I will try it.. Just when I write datadir=path/to/new/directory instead of directory I shoud give the path to my directory, right? And if I do this whenever I run bitcoind it will be run in the directory I gave right? Thanks a lot – saadia Dec 18 '19 at 19:04
  • yes, make sure the directory exists and you will notice new files being created as soon as bitcoind starts running. When you run df -h on the command line what do you get? – Pedro Dec 18 '19 at 19:07
  • when İ run df -h I get this Filesystem Size Used Avail Use% Mounted on rootfs 223G 216G 7.2G 97% / none 223G 216G 7.2G 97% /dev none 223G 216G 7.2G 97% /run none 223G 216G 7.2G 97% /run/lock none 223G 216G 7.2G 97% /run/shm none 223G 216G 7.2G 97% /run/user C: 223G 216G 7.2G 97% /mnt/c D: 932G 113G 820G 13% /mnt/d – saadia Dec 19 '19 at 07:22
  • so for d partition I can use this path /mnt/d ? – saadia Dec 19 '19 at 07:27
  • yes, try to move the data folder to somewhere in /mnt/d , run bitcoind as root (sudo bitcoind ...) just in case to make sure you have permissions. – Pedro Dec 19 '19 at 12:34
  • It worked thank you pedro .. but when ı run bitcoin-cli -testnet getblockchaininfo in another terminal ı got this error [ error: incorrect rpcuser or rpcpassword (authorization failed)] – saadia Dec 19 '19 at 13:23
  • to enable testnet you need to add testnet=1 to bitcoin.conf and restart bitcoind. It uses mainnet by default. does it work without the -testnet option? Also you can remove any rpcuser and rpcpassword from your configuration if you plan to use it locally as it will authenticate with the cookie – Pedro Dec 19 '19 at 13:27
  • Also remove rpcbind and rpcallowip if you have any. – Pedro Dec 19 '19 at 13:31
  • İ will try it..without -testnet it gave me this erroer 8333 failed after select(): Connection refused (111). And bitcoin-cli was working when i don't specify the directory – saadia Dec 19 '19 at 13:36
  • when i removed what you told me ı got this error: error: Could not locate RPC credentials. No authentication cookie could be found, and RPC password is not set. See -rpcpassword and -stdinrpcpass. Configuration file: (/home/saadia/.bitcoin/bitcoin.conf) – saadia Dec 19 '19 at 13:42
  • I am guessing it's an issue with permissions, do you see anything being filed in your /mnt/d/... folder? try running sudo bitcoin-cli ... and what does your /mnt/d/.../debug.log say? – Pedro Dec 19 '19 at 13:45
0

You need to run bitcoind with a different -datadir parameter. This is, all the blockchain data is under a folder (binaries and database files from LevelDB). What you need to do is something like the following:

/path-to-bitcoin/bitcoind -datadir=/path-to-directory/
AntMor
  • 173
  • 4
  • Thank you for your answer! How can I find the path of D partition because ubuntu that I have used allows me to use just the terminal so I can just type commands. How D partition is known inside ubuntu? – saadia Dec 18 '19 at 19:01