I am going to run a bitcoin core on a Linux server (Ubuntu 20.04). I don't have enough storage to store blockchain data. Therefore, I want to save the data over an NFS server (CentOS release 6.10). However, I get an error when I set the -datadir
to the shared folder.
The content of /etc/exports
file in the NFS server (I've seen the configuration from here):
/home/storage/ BITCOIN.CORE_IP(rw,sync,no_root_squash,no_subtree_check)
I mounted the remote shared directory in the Ubuntu 20.04 Linux server using the following command:
mount NFS_SERVER_IP:/home/storage/ /root/blockchain/
everything works fine, and the file system disk space usage report is: (df -h
)
Filesystem Size Used Avail Use% Mounted on
NFS_SERVER_IP:/home/storage/ 1.0T 682M 1.0T 1% /root/blockchain
After running the following command to change the data directory to the shared directory:
./bitcoin-0.20.0/bin/bitcoind -datadir=/root/blockchain
I get the following error:
Error: Cannot obtain a lock on data directory /root/blockchain. Bitcoin Core is probably already running.
I should note that the shared directory is empty before running the bitcoind, then after that, it contains an empty file, which name is .lock
. Moreover, If I set the -datadir
to any local folder, it will not return any error!
Thanks.
.lock
file (if it still exists), and then starting it again