External usb permission issue

hello everyone,

I have an issue that has slowly been driving me mad, and despite checking and asking around pretty much everywhere, no solution yet.

I have a nextcloudpi setup. I want to add a usb stick as additional storage (so not move the entire database to the usb stick). When i insert it, and add it using external storages (using the path /media/usblabel), neither the admin nor the normal account has write permissions for the folder.

How do i fix the permissions?

I have tried

  • reformatting to ext4 (instead of btrfs)
  • Changing permissions the usb using chmod
  • changing ownership of the usb using chown
  • rebooting, reinstalling and re-enabling my entire nextcloudpi
  • banging my head against the wall
  • changing/adjusting all the external storages settings (in the admin settings menu)
  • renaming, reformatting and re-inserting the drive.
  • praying to the unix gods
  • different usb drives

Error message Nothing has worked so far, and all have resulted in the same message: “you don’t have permission to upload or create files here”

Use the same permissions and ownership as your Nextcloud data folder.

I have tried that. By changing the ownership (chown) to www-data, and adjusting the permissions to match the permissions of the data folder (drwxr-x—). yet no luck.
I have reset everything (again), and the /media folder has these 4 entries:

drwxr-xr-x 3 root root 4096 [date] [time] .
drwxr-xr-x 21 root root 4096 [date] [time] …
drwxr-xr-x 4 root root 4096 [date] [time] USBlabel
lrwxrwxrwx 1 root root 23 [date] [time] USBdrive → /media/USBlabel

Using Chown (sudo chown -R www-data:www-data /media/USBlabel), I change it to:

drwxr-xr-x 3 root root 4096 [date] [time] .
drwxr-xr-x 21 root root 4096 [date] [time] …
drwxr-xr-x 4 www-data www-data 4096 [date] [time] USBlabel
lrwxrwxrwx 1 root root 23 [date] [time] USBdrive → /media/USBlabel

It then has more permissions than needed, but that should not be an issue. Yet still, the error persists.

And you do have it mounted in the OS as read-write and also mounted as read-write in NC?

There is no option to “mount as read-write” in nc, which is part of the issue.
Not sure how i can check whether it is mounted as rw in the os.

It probably is, but you can check by typing mount. It’ll say either ro or rw.

As for NC, I don’t have local external storage on mine since I use Docker, but I do have one that’s SFTP, and it has a check box for read only.

Ther is a checkbox for read only, true. of course i have not selected it. Selecting and deselecting did nothing.
Will ssh in to look into the mount issue. thanks for your patience.