[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 602
  • Last Modified:

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 ?
0
sudhirgoogle
Asked:
sudhirgoogle
  • 3
  • 3
  • 2
  • +2
1 Solution
 
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
 
gurutcCommented:
Hi,

you can create the mount point: HFM_BPC_TRIGGER_FILES

using the applmgr userid.

- gurutc
0
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 
gheistCommented:
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:
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

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 3
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now