sudhirgoogle
asked on
question regarding linux mount
I have directory which is mounted to cifs share via /etc/fstab file, the directory has permission has shown below when it is not mounted.
# ll
total 11509
drwxrwxrwx 2 applmgr dba 198 Apr 28 01:26 HFM_BPC_TRIGGER_FILES
when i do mount -a, immediately the above directory owner changes to root as shown below
# mount -a
# ll
total 11510
drwxr-xr-x 1 root root 4096 Apr 28 01:38 HFM_BPC_TRIGGER_FILES
here is the /etc/fstab file entry for the about mount point
//windowserver/BPC/ /oracle/HFM_BPC_TRIGGER_FI LES cifs rw,credentials=/opt/int9/. pass,file_ mode=0644, dir_mode=0 755 0 0
when the folder is mounted i want the file permission to be retained as shown below
drwxrwxrwx 2 applmgr dba 198 Apr 28 01:26 HFM_BPC_TRIGGER_FILES
how can i achieve this ?
# ll
total 11509
drwxrwxrwx 2 applmgr dba 198 Apr 28 01:26 HFM_BPC_TRIGGER_FILES
when i do mount -a, immediately the above directory owner changes to root as shown below
# mount -a
# ll
total 11510
drwxr-xr-x 1 root root 4096 Apr 28 01:38 HFM_BPC_TRIGGER_FILES
here is the /etc/fstab file entry for the about mount point
//windowserver/BPC/ /oracle/HFM_BPC_TRIGGER_FI
when the folder is mounted i want the file permission to be retained as shown below
drwxrwxrwx 2 applmgr dba 198 Apr 28 01:26 HFM_BPC_TRIGGER_FILES
how can i achieve this ?
mount always mounts everything as root. Or, more correctly, the owner of the mount point becomes the owner of the directory that is mounted there. When mounting a file system, that will be / so owned by root.
ASKER
how do i mount using applmgr user ?
Hi,
you can create the mount point: HFM_BPC_TRIGGER_FILES
using the applmgr userid.
- gurutc
you can create the mount point: HFM_BPC_TRIGGER_FILES
using the applmgr userid.
- gurutc
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Just before EE went down, I tried to post that cifs mounts have a uid option (which does accept user names as well as numbers). It also has forceuid for when the remote system tries to send a uid. See man 8 mount.cifs
It actually accepts user names, but only in multiuser mode, i.e. not in fstab
Weird
Exactly. numbers are much safer...
Check with NAS for POSIX permission he has choosed..
TY/SA
TY/SA
ASKER
Thanks for your solution.