0770 permission for external HDD

I’ve installed nextcloud using this guide.

I want to mount an external USB HDD in my nextcloud-data folder.

I’ve used the following commands:
sudo mkdir /usr/share/nginx/nextcloud-data
sudo chown www-data:www-data /usr/share/nginx/nextcloud-data -R
sudo chmod 0770 /usr/share/nginx/nextcloud-data
sudo mount -o file_mode=0770,dir_mode=0770,nounix,uid=33,gid=33 /dev/sdb1 /usr/share/nginx/nextcloud-data

But the permissions are automatically changed and set to 0777 when the directory is mounted. So the 0770 permission error is displayed when I try to connect to my nextcloud via browser.

I also add /dev/sdb1 /usr/share/nginx/html/nextcloud-data ntfs uid=33,gid=33,dmode=770,fmode=770,nounix 0 0 in the /etc/fstab and reboot, but nothing changes.

How to fix such issue???

Can you show us the ls -lisa /usr/share/nginx/nextcloud-data?

Was it mounted properly?

Don’t forget to check the ubuntu community, if there are problems, they should know.

I fixed my problem. Now it works fine

What did you do (in case others run in the same problem)?

I set right permissions when mounting the external hhd

I solved the problem too. I inserted the following line into fstab:
UUID=0E96A3FA96A3E087 /mnt/orico ntfs defaults,nls=utf8,uid=www-data,gid=www-data,dmask=007,windows_names 0 0

orico - name my hdd (change to your)
UUID=0E96A3FA96A3E087 - change to your

1 Like