How to add nfs storage?

I briefly tested the beta1 of ns8. For apps with high storage demands (eg. nextcloud), I want to use capacity of my file server. Easiest way would be to create the nextcloud data directory on an nfs mount.
However, there is no obvious, or documented way how to do that. Will this be added later?

Hi @jaywalker

And welcome to the NethServer community!

Nextcloud stores files and folders as objects in it’s database. If that database is ever screwed, no one, not even root of that server will have access to the files or folders. It’s also much slower than file access.
→ Using this is a VERY bad idea!

Use the built in External Storage module of Nextcloud (It’s already installed, but not “activated”, under Apps…).
That can handle NFS, SMB and more, yet the files stay on the file server or whatever share you use.
Every file and folder accessible - with or without NextCloud.
→ Much safer!

I’m using this for my 30+ clients…

The above IS documented - on Nextcloud…

My 2 cents
Andy

1 Like

Hi Andy,

Thank you for your quick reply.
My main question is whether ns8 will support nfs mounts for apps with high storage demands in the future. This does not only apply to nextcloud, but also e.g. for the mail server.
Instead of provisioning 100s of GB storage to the VM running nethserver (our imap store alone is around 100GB), for me it would be much easier to mount the storage into the VM from the fileserver that has the storage capacity anyway. Please note that this is a supported use case in ns7, nfs mounts are even configurable via the web interface.

For nextcloud, I do not agree to what you wrote. Files stored in nextcloud without the external storage plugin end up in the nextcloud data directory as regular files in the filesystem of the server. The database just stores metainformation for these files. By regular backups of the database, it is of course possible to recover from catastrophic failures in the db as well. However, even if you loose your DB completely, the files are still there in the filesystem. I run a nextcloud server in such a configuration successfully.
This might be equivalent to using external storage plugin with the local storage provider (which again requires you to mount the storage on the nextcloud server first). External storage in nextcloud with samba backend has shown slower performance and higher maintenance efforts for me, so I do not want to use it again.

Best,
jaywalker

What? No, that isn’t how Nextcloud works (by default, anyway). Files and folders are stored in the filesystem, and a variety of metadata is stored in the database. If the database is borked, the files themselves are still there–users may not be able to access them through Nextcloud itself, but whoever has shell access to the server and appropriate permissions can read them off the disk.

Now, if you enable E2EE or possibly other encryption features, that could change–but that has nothing to do with using external storage.

2 Likes

Ciao Heiner,
using a mounted NFS volume for Podman storage path is not allowed, according to Podman manual:

podman does not support container storage over NFS

In general, I’m interested about integrating external storage solutions with NS8 and also make NS8 a software-defined storage provider (e.g. S3, Ceph…). This is not a priority now, but it can change if new use cases arise.

2 Likes

Hi Davide,

thank you for the information. Unfortunately, if the email store cannot be put on an nfs share, nethserver is currently no option for me. In case you start developing this feature, please let me know in case I can help (at least with testing…).

Best,
jaywalker

Folks… simple suggestion, don’t use ns8 in the title, just add the #ns8 label
I edited the title

@jaywalker , @danb35

You’re both right. Was on the road and hit a very very old reference (Owncloud?)…
I’m more used to Desktop screen size, than mobile size, especially for referencing stuff.

On the other hand, External Storage mount’s it’s stuff by itself, and works very stable for me & my clients, absolutely no issues.

My 2 cents
Andy

4 posts were split to a new topic: Nextcloud external storage SMB CIFS shares not working

Hi,

I read into this topic a little bit. There is no need to have the container itself on an nfs mount. However, within the container I want to mount an nfs folder, e.g. for the mail system to finally store the mailbox data, or as the file storage in nextcloud.
This should be possible with podman from what I understood, see e.g.

or

1 Like

It would be great to make such setup work, however I doubt we can merge it as a standard feature.

Mounting just the volume over NFS seems possible, but it looks really complex to achieve for a rootless container because it requires root privileges. Furthermore Dovecot needs specific configuration for NFS. I didn’t read Nextcloud docs about NFS, but I guess some special config is needed too.

Ok, thank you for the feedback.
If I provision the necessary storage directly into the ns8 VM, how are storage full conditions handled? I understood that all data goes to the /home partition. If now e.g. nextcloud files up that partition, can you make sure that e-mails can still be received?

They are not handled at all. There is no disk quota limit for NS8 modules (Unix users). Setting up limits for disk and other resources usage could be addressed by future releases of NethServer: there are no plans for them today.

A monitoring module is already available though GitHub - NethServer/ns8-node_exporter

1 Like

Hi,

is it possible to mount a nfs storage on the nethserver host and use it as local external storage in nextcloud? That would require that the nextcloud container gets access to the nfs mount somehow, and I am not sure how this could be done.

Thank you!