Solved

question regarding linux mount

Posted on 2014-04-28
10
560 Views
Last Modified: 2014-04-29
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
Comment
Question by:sudhirgoogle
  • 3
  • 3
  • 2
  • +2
10 Comments
 
LVL 34

Expert Comment

by:Duncan Roe
ID: 40026982
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
 
LVL 1

Author Comment

by:sudhirgoogle
ID: 40027011
how do i mount using  applmgr user ?
0
 
LVL 16

Expert Comment

by:gurutc
ID: 40027027
Hi,

you can create the mount point: HFM_BPC_TRIGGER_FILES

using the applmgr userid.

- gurutc
0
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 
LVL 62

Accepted Solution

by:
gheist earned 500 total points
ID: 40027035
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
 
LVL 34

Expert Comment

by:Duncan Roe
ID: 40027079
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
 
LVL 62

Expert Comment

by:gheist
ID: 40027088
It actually accepts user names, but only in multiuser mode, i.e. not in fstab
0
 
LVL 34

Expert Comment

by:Duncan Roe
ID: 40027103
Weird
0
 
LVL 62

Expert Comment

by:gheist
ID: 40027107
Exactly. numbers are much safer...
0
 
LVL 13

Expert Comment

by:Sandy
ID: 40028956
Check with NAS for POSIX permission he has choosed..

TY/SA
0
 
LVL 1

Author Closing Comment

by:sudhirgoogle
ID: 40029013
Thanks for your solution.
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question