Problem while trying to setup local storage


I am trying to share an external HDD which is in NTFS format but i cannot see the files on the shared folder.

I have setup the mounted drive that i want to share but on the client i cannot see any files
What am i doing wrong?

I am using Ubuntu and i am new with linux so i would appreciate any help from you guys!


If it’s Ubuntu and you’re looking at an NTFS filesystem, have you looked at the permissions you’ve established for the mount? i.e. Is the user that nextcloud runs as (apache?) allowed to view the folder, but are the files set to a different permission level. First off I would suggest that you show us what the file permissions look like in the root of your shared folder…

# ls -laZ

The Z above will include the selinux context just in case that’s enabled, which can have an effect on things as well.

Can the nextcloud user read the share in linux terminal?

Starting up this thread again as I am not finding answers anywhere else. I have followed the usual tips to “chown” and “chmod”. This is what the file permissions look like when entering the command you suggested.

Any ideas?

Screenshot from 2023-01-31 16-31-23

I read somewhere that it could be a problem that the external storage is located in /media/user/storage and that it is better if it is placed directly in /media/storage. If so, how do I make it more permanently “stick” in /media/ in stead of going back to /media/user/ after a server reboot?

When trying to open the external storage I get a dialogue window telling me:

"External mount error

There was an error with message: Empty response from the server. Do you want to review mount point config in admin settings page?"

What does that tell me?

Thanks for any help!

I tried this command which was supposed to tell me if I have permission to use the storage:

sudo -u www-data ls -la /media/user/storage

I received the answer:

ls: cannot access ‘/media/night/a101e2cb-f18a-422d-afb7-c0e25617d131’: Permission denied

Apparently I do not have access to the storage. But what do I do about that? How can I give www-data access to the external storage?

I have already tried:

sudo chown -R www-data:www-data /path/to/HDD
sudo chmod -R 0750 /path/to/HDD

Any suggestions?

Thanks in advance!

Is this it? Should I give www-data access to my user?

Martin Book

I think I solved it:

I can configure my local external storage in Nextcloud and even get a green check mark. Trying to look in the folder I either got an empty folder or the response “External mount error - there was an error with message: Empty response from the server.”

Solution (maybe wrong but it works):
It seems that the permission I granted www-data only was given for the local drive itself, not for the parent directory. That seems to have caused the problem that www-data lacked permission also to access the local drive. I was able to unmount the drive and mount it in /media/drive, instead of /media/user/drive, then I gave www-data privileges both in /media and /media/drive using these commands:

sudo chown -R www-data:www-data /media
sudo -u www-data chown -R www-data:www-data /media/drive
sudo -u www-data chmod -R 0750 /media/
sudo -u www-data chmod -R 0750 /media/drive

I am unsure if both chmod commands are needed but after this it worked.