mount drives so they have the correct permissions.

Zululander

New Member
Joined
Apr 24, 2024
Messages
19
Reaction score
5
Credits
155
I have mounted two different drives using the fstab file:

UUID=cf14a09f-f8cb-6acd-9af9-a3aebbc5bbbc /mnt/cctvdata ext4 defaults 0 0

//192.168.55.75/cctvarchive /mnt/cctvarchive cifs credentials=/etc/cred/nxwitnessshare 0 0

When I look at the permissions I see that they both have different ones

sysadmin@nxwitness:/mnt$ ls -l
total 4
drwxr-xr-x 2 root root 0 Jun 14 21:28 cctvarchive
drwxr-xr-x 5 sysadmin sysadmin 4096 Jun 10 10:52 cctvdata

I am needing the cctarchive permisisons to be the same as for cctvdata.

I have tried using chown but nothing changes.
 


You need to give mount options for the samba share that will mount the share with a local user and group.
Code:
uid=arg
gid=arg
For example using your fstab entry.
//192.168.55.75/cctvarchive /mnt/cctvarchive cifs uid=sysadmin,gid=sysadmin,credentials=/etc/cred/nxwitnessshare 0 0
It will be useful if you add a "_netdev" in there to because it being a network share, that way it will way to mount the share until the network is up.
//192.168.55.75/cctvarchive /mnt/cctvarchive cifs uid=sysadmin,gid=sysadmin,credentials=/etc/cred/nxwitnessshare,_netdev 0 0
 
Thanks so much. both suggestions worked a treat.

Jus for my learning, why did I need to set uid and gid for the network share but not for the UUID mount?
 
Jus for my learning, why did I need to set uid and gid for the network share but not for the UUID mount?
Because for the local UUID mount is a local filesystem where the permissions get set by the local user and the samba share is a network filesystem where the permissions are terminated by the fileshare server so when mounting a samba share you have to define locally with what user and group you wanted it mounted or else it will default mounting to root.
 

Members online

No members online now.

Top