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_FILES cifs rw,credentials=/opt/int9/.pass,file_mode=0644,dir_mode=0755   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 ?
LVL 1
sudhirgoogleAsked:
Who is Participating?
 
gheistConnect With a Mentor Commented:
add to mount parameters:
rw,credentials=/opt/int9/.pass,file_mode=0600,dir_mode=0700,uid=<numeric of applmgr>,gid=<numeric of dba>

(i remove unnecessary access to CIFS for non-oracle users - backups should go via RMAN and not file backup)
0
 
Duncan RoeSoftware DeveloperCommented:
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.
0
 
sudhirgoogleAuthor Commented:
how do i mount using  applmgr user ?
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
gurutcCommented:
Hi,

you can create the mount point: HFM_BPC_TRIGGER_FILES

using the applmgr userid.

- gurutc
0
 
Duncan RoeSoftware DeveloperCommented:
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
0
 
gheistCommented:
It actually accepts user names, but only in multiuser mode, i.e. not in fstab
0
 
Duncan RoeSoftware DeveloperCommented:
Weird
0
 
gheistCommented:
Exactly. numbers are much safer...
0
 
SandyCommented:
Check with NAS for POSIX permission he has choosed..

TY/SA
0
 
sudhirgoogleAuthor Commented:
Thanks for your solution.
0
All Courses

From novice to tech pro — start learning today.