External harddisk cannot be accessed using external storage

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 29.0.5): 29.0.4
Operating system and version (eg, Ubuntu 24.04): 24.04
Apache or nginx version (eg, Apache 2.4.25): replace me
PHP version (eg, 8.3): 8.2.20

I installed my nextcloud using on my Ubuntu machine.

sudo snap install next cloud

Everything works fine except the external storage drive. In my case I have a 1TB usb harddisk that is connected to the computer where nextcloud is installed. I have mounted the harddisk at:

/mnt/usbdrive

I also assured that the owner of the folders from mnt and its subfolders are www-data:www-data using this command:

sudo chown www-data:www-data -R /mnt
sudo chmod 775 -R /mnt

I checked that the folders from mnt and its subfolders all are owned by www-data:www-data and the permissions are correct.

From the Nextcloud’s web app, I setup the external storage app, and setup the folder location at /mnt/usbdrive. I see the green tick indicating that the setup is successful. However, when I from Files entered my usbdrive, I don’t see any files.

Upon checking the log I see

[PHP] Fejl: opendir(/mnt/usbdrive/): Failed to open directory: Permission denied at /snap/nextcloud/43563/htdocs/lib/private/Files/Storage/Local.php#164
	PROPFIND /remote.php/dav/files/JianWu/newUSB/
	from 94.147.65.45 by JianWu at 25. aug. 2024, 08.33.10

@JianWu,

this is not correct for Nextcloud snap:

Q: What permissions should external media have?

See Snap confinement

Removable media must be mounted to either /media or /mnt as root with root permissions and connected to Snap!

The interface providing the ability to access removable media is not automatically connected upon install, so if you’d like to use external storage (or otherwise use a device in /media or /mnt for data), you need to give the snap permission to access removable media by connecting that interface:

sudo snap connect nextcloud:removable-media

see FAQ’s and removable media and readme

Thanks that solved the problem. Can that be updated into the documentation?

what is missing?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.