Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add nfs for storage #211

Open
max-nextcloud opened this issue Aug 16, 2023 · 2 comments
Open

Add nfs for storage #211

max-nextcloud opened this issue Aug 16, 2023 · 2 comments

Comments

@max-nextcloud
Copy link
Contributor

I'm working on adding an nfs container that can be attached as storage.

Collecting my notes here so they do not get lost.

@max-nextcloud
Copy link
Contributor Author

max-nextcloud commented Aug 16, 2023

Following https://blog.ruanbekker.com/blog/2020/09/20/setup-a-nfs-server-with-docker/ for a start.

Only difference is that i use ./data/nfs for the volume.

Trying to mount nfs from nextcloud instance fails due to missing statd.
docker-compose --env-file stable27.env exec nextcloud /bin/bash

root@90be4ba34a42:/var/www/html# mount -v -o vers=4,loud nfs:/ /mnt/nfs
mount.nfs: timeout set for Wed Aug 16 06:38:14 2023
mount.nfs: trying text-based options 'vers=4,addr=192.168.27.6,clientaddr=192.168.27.7'
mount.nfs: mount(2): Operation not permitted
mount.nfs: rpc.statd is not running but is required for remote locking.
mount.nfs: Either use '-o nolock' to keep locks local, or start statd.

root@90be4ba34a42:/var/www/html# update-rc.d rpcbind enable

root@90be4ba34a42:/var/www/html# update-rc.d nfs-common enable

root@90be4ba34a42:/var/www/html# service rpcbind restart
Stopping RPC port mapper daemon: rpcbind.
Starting RPC port mapper daemon: rpcbindln: failed to create symbolic link '/run/sendsigs.omit.d/rpcbind': No such file or directory
 failed!

root@90be4ba34a42:/var/www/html# mount -v -o vers=4,loud nfs:/ /mnt/nfs
mount.nfs: timeout set for Wed Aug 16 06:41:21 2023
mount.nfs: trying text-based options 'vers=4,addr=192.168.27.6,clientaddr=192.168.27.7'
mount.nfs: mount(2): Operation not permitted
mount.nfs: trying text-based options 'addr=192.168.27.6'
mount.nfs: prog 100003, trying vers=3, prot=6
mount.nfs: trying 192.168.27.6 prog 100003 vers 3 prot TCP port 2049
mount.nfs: portmap query retrying: RPC: Program/version mismatch
mount.nfs: prog 100003, trying vers=3, prot=17
mount.nfs: portmap query failed: RPC: Program not registered
mount.nfs: requested NFS version or transport protocol is not supported

So now it fails with mount(2): Operation not permitted.

setting `privileged: true' on the nextcloud container fixed this.

@max-nextcloud
Copy link
Contributor Author

max-nextcloud commented Aug 16, 2023

It was not possible to move the data folder out of the way because it was in use.

I ended up copying and removing it. Disabled the apached/sites-enabled - but maybe that was not necessary in the end because copy and move did the trick.

So basically

apt update && apt install nfs-client
mkdir /mnt/nfs
mount -v -o vers=4,loud nfs:/  /mnt/nfs
cp -ar data /mnt/nfs
rm -rf data/*
mount -v -o vers=4,loud nfs:/data  /var/www/html/data

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants