0

I have a Raspberry Pi 3. I'm running bitcoind for the first time and would like to save the blockchain to an external hard disk.

When I run bitcoind -datadir=/media/pi/FreeAgent\ GoFlex\Drive

I get the following error:

Error: Cannot obtain a lock on data directory /media/pi/FreeAgent GoFlex Drive
Bitcoin Core is probably already running. No such file or directory.

I tried stopping the process with

bitcoin-cli stop

But that didn't seem to do anything. Is the problem that the external hard disk has to be formatted and mounted, as per instructions here?

As a test, I tried writing a file to the hard disk from the system and received the following error:

mv: inter-device move failed: 'testfile' to '/media/pi/FreeAgent GoFlex Drive/testfile'; unable to remove target: Read-only file system

This does seem to confirm this hypothesis that the disk needs to be formatted/mounted.

1

I get the following error:

Error: Cannot obtain a lock on data directory /media/pi/FreeAgent GoFlex Drive
Bitcoin Core is probably already running. No such file or directory.

I tried stopping the process with

bitcoin-cli stop

Bitcoin Core is already stopped when you get that error. It can't run without the datadir.

But that didn't seem to do anything. Is the problem that the external hard disk has to be formatted and mounted, as per instructions [here][1]?

As a test, I tried writing a file to the hard disk from the system and received the following error:

mv: inter-device move failed: 'testfile' to '/media/pi/FreeAgent GoFlex Drive/testfile'; unable to remove target: Read-only file system

This does seem to confirm this hypothesis that the disk needs to be formatted/mounted.

No, it does not necessarily need to be formatted.

The problem is that your user does not have the correct permissions to write to your external drive. Make sure that your drive is writable and that your user has the permissions to write to the external drive. You may have to change how it is being mounted to the system (drives always have to be mounted in order to be accessible).

| improve this answer | |
  • thanks. It seems that it's a user permissions issue because I was able to view jpeg photos that I have on the external drive. Please let me know if that makes sense and that I only need to address the write permissions issue, but not the mounting. – matsuo_basho Feb 15 '18 at 13:59
  • 1
    You only need to fix file permissions. Mounting may still be related because file permissions could be related to how the drive is mounted. Note that it is already mounted because you are able to access it. – Andrew Chow Feb 15 '18 at 16:48
  • You wrote that Bitcoin core is already stopped when I get that error, and rather it can't run without datadir. Do you mean that I have to manually specify datadir before running bitcoind? When i ran bitcoin daemon it seemed to have started - I would imagine that the blockchain is written to a default directory if datadir is not specified. – matsuo_basho Feb 15 '18 at 21:34
  • There is a default datadir. When you specify a datadir, it does not attempt to fallback to anything. If it can't write to the datadir it is using (either specified or the default if none was specified), it will simply exit with an error. – Andrew Chow Feb 16 '18 at 0:05
  • I tried to change permissions with following command chmod 755 FreeAgent\ GoFlex\ Drive/. Got error: chmod: changing permisssons of 'FreeAgent GoFlex Drive/': Read-only file system. Also tried running sudo mount -o remount,rw '/media/FreeAgent\ GoFlex\ Drive/. Got error mount: mount point /media/FreeAgent\ GoFlex\ Drive/ does not exist – matsuo_basho Feb 17 '18 at 3:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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