Permissions of local external storage

Hello to everyone,

i’m running nextcloud on Ubuntu 20.04 LTS with apache on a hyper-v host. It’s running fine with the inluded SSD in the host.

When i want to mount an usb drive as external storage i got the issue, that every user has the permission to see (means read+write) the folders and files of other users.

What i have done is to mount the usb drive via fstab und including it with the built in application for external storage support (local storage).

The owner of the mountpoint folder /media is set: chown -R www-data:www-data /media.
Also chmod -R 0750 /media is set.

Can someone explain to me how i can get it, that every user is only able to see and modify his folders and files?

Best regards

Not sure if this is possible with the external storage app. Maybe this helps…

Or you could move the the whole nextcloud data folder to the external drive, then you would not have to deal with the external storage app at all. And make sure you do regular backups from this disk. A single USB-Drive ist not a suitable storage solution for a production like multi-user environment. Just sayin’ :wink:

Thank you very much for your reply.

Yeah thats right - backup is important. For that I’m using Veeam :slight_smile:

Apart from mounting a usb drive as local external storage i would have the same issue when mounting the storage as ftp storage via external storage app.

Is there a recommended way to move the data folder to external usb drive? Is that as easy to cp -a the folder and change the directory in the config.php?

Best regards

Unfortunatly there are a few quirks and it is not officially supported. Pleas search the forums… There are extensive topics and howtos allready, that explain it a lot better, than I could :wink:

But since you want to move it to an external drive, there might be an easier way. Move your current data directory to the external drive and then mount it to your current data directory location. Add it to fstab so it is mounted at boot and you should be good go.

Hello,

Finding this as I were looking for something else, I might have some ideas you would want to use. I did this specific setup (data storage for different users on a USB drive) and here is how I did it:

  • have one user be the “master” (can be the administrator of nextcloud, or not) mount your media root;
  • create one folder for each user;
  • with the master user, go to the root folder in the web interface and share each user folder with the desired user: click on the share icon (thee dots linked by a line) and then type in the user name you want in the text box.

Take this with a grain of salt though since I successfully did this on an old owncloud setup but I struggle with my external storage on my new nextcloud setup for different reasons. So I can’t say I tested it on a recent setup!

Hope this helps.

Regards