External storage permissions with NTFS (manual installation)

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.3
Operating system and version (eg, Ubuntu 24.04): Ubuntu 24.04 LTS
Apache or nginx version (eg, Apache 2.4.25): 2.4.61
PHP version (eg, 8.3): 8.3

The issue you are facing:
Permissions issues when adding an external drive formatted NTFS. Nextcloud is unable to see the drive path: (ex: /media/user/shuttle/). If I just put “/media/user/” the red exclamation turns to a green check but the folder created in Nextcloud does not show any of the folders or files on the drive and says I do not have permission to create or edit anything in the folder. NTFS is a requirement for me as I have multiple drives with data on them already that I will be connecting to this machine.

Steps I’ve taken:

I followed Nextcloud’s documentation and changed ownership with
Sudo chown -R www-data:www-data /media/user/shuttle
and
Sudo chmod -R 0750 /media/user/shuttle

  • this unfortunately left me unable to access the drive at all outside of Nextcloud and Nextcloud still did not see the drive path.

To get access back I set it back to default (I think) with:
sudo chown -R root:root /media/user/shuttle
and
sudo chmod -R 0777 /media/user/shuttle

I’ve read through a a few similar posts here about this permissions issue. I’ve followed @szaimen 's solution here about it Add NTFS drive as external storage with no luck.
/etc/fstab currently has:
$UUID /media/user/shuttle ntfs-3g windows_names,uid=33,gid=33,umask=770 0 0
I used the drive’s UUID at the beginning and uid/gid of 33 in place of www-data as instructed in the post by @Fab mentioned here You don't have permissions to upload or create files here - local (external ntfs-3g storage)
*note the difference of umask=770 on mine because 007 makes the drive completely inaccessible outside of Nextcloud

Is this the first time you’ve seen this error? (Y/N): Y - It’s my first time attempting it.

Steps to replicate it:

  1. Green check if I use the partial path /media/user (permission denied/directory listing failed error in log)
  2. red exclamation if I try the path of any folder on the drive or the drive name (ex: /media/user/shuttle) (storage path does not exist error in log)

The output of your Nextcloud log in Admin > Logging:

Error	files_external	
StorageNotAvailableException Local storage path does not exist "/media/****/shuttle/"
"Jul 9, 2024, 1:47:49 PM"	
Error	files_external	
StorageNotAvailableException Local storage path does not exist "/media/****/shuttle/"
"Jul 9, 2024, 1:47:49 PM"	
Error	webdav	
ServiceUnavailable Directory listing failed
"Jul 9, 2024, 1:46:42 PM"	
Error	PHP	
opendir(/media/****/): Failed to open directory: Permission denied at /var/www/nextcloud/lib/private/Files/Storage/Local.php#164
"Jul 9, 2024, 1:46:42 PM"	
Error	webdav	
ServiceUnavailable Directory listing failed
"Jul 9, 2024, 1:46:42 PM"	
Error	PHP	

I doubt you want a umask of 770. That would prevent both the owner and the group from accessing anything on it. umask != chmod.

Yes, from what I understand they work pretty much the reverse of each other. Umask 007 is what 770 for chmod/chown would be. But umask= 007 made it so I could not access any of the external drive’s files in Ubuntu and had no affect on nextcloud. 770 is the current (temporary) setting because it’s functional, at least for normal file access when using the computer.

So there’s something funky going on with the permissions. That’s why I detailed the progression of permission/owner changes I’ve done. Hoping someone catches a mistake or has an idea of correction.

Much appreciated!