ipfs / kubo

An IPFS implementation in Go
https://docs.ipfs.tech/how-to/command-line-quick-start/
Other
15.95k stars 2.99k forks source link

IPFS repo cannot be stored on a NAS (SMB, etc.). #8005

Open madranet opened 3 years ago

madranet commented 3 years ago

Version information:

go-ipfs version: 0.8.0 Repo version: 11 System version: amd64/darwin Golang version: go1.15.8

OSX Version: 10,14,8

Description:

As per title. IPFS worked fine with default setup [ie. storing data locally]. I then tried to move my repo to a NAS [mounted via SMB] by adding export IPFS_PATH=/Volumes/stuzbot/IPFS to my ~/.zshrc file and re-initialising.

Now, when I run ipfs daemon I get the following error:

Initializing daemon...
go-ipfs version: 0.8.0
Repo version: 11
System version: amd64/darwin
Golang version: go1.15.8

Error: cannot acquire lock: Lock FcntlFlock of /Volumes/stuzbot/IPFS/repo.lock failed: operation not supported

I've tried both reinitialising the repo from scratch at the new NAS location with ipfs init and also copying over the existing contents from the old default ~/.ipfs location. But I get the same error each time. I can see that, after running ipfs daemon a zero bytes repo.lock file is actually created in the repo directory but the error message still persists.

I have full read/write permissions for the NAS itself and for the directory I am trying to use as my IPFS repo.

welcome[bot] commented 3 years ago

Thank you for submitting your first issue to this repository! A maintainer will be here shortly to triage and review. In the meantime, please double-check that you have provided all the necessary information to make this process easy! Any information that can help save additional round trips is useful! We currently aim to give initial feedback within two business days. If this does not happen, feel free to leave a comment. Please keep an eye on how this issue will be labeled, as labels give an overview of priorities, assignments and additional actions requested by the maintainers:

Finally, remember to use https://discuss.ipfs.io if you just need general support.

hsanjuan commented 3 years ago

This has been posted here: https://discuss.ipfs.io/t/error-cannot-acquire-lock-lock-fcntlflock-of-path-to-repo-repo-lock-failed-operation-not-supported/10620/3

Stebalien commented 3 years ago

Unfortunately, SMB doesn't support file locks which are required by go-ipfs. Furthermore, performance is likely going to be absolutely terrible if you want to put your entire repo on a remote machine so the likelihood of anyone trying to make this work in the future is pretty low.

If you want to do this, I recommend mounting your SMB directory under ~/.ipfs/blocks so that only the blockstore (where most of the data goes) gets stored on the remote machine.

madranet commented 3 years ago

If you want to do this, I recommend mounting your SMB directory under ~/.ipfs/blocks so that only the blockstore (where most of the data goes) gets stored on the remote machine.

As simple as that eh? That was what I wanted to know anyway. How to move the actual data onto an external HDD. I thought it might involve a lot of complex config jiggery-pokery. There's enough room on the Raspberry Pi to store the other 'stuff' but the actual file data needs to be somewhere else. I'll give this a go and see if it works.

Stebalien commented 3 years ago

Yep, as long as you're using the default datastore configuration (if you see a "blocks" directory, putting that directory on the NAS should do it).