LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 03-30-2005, 04:16 AM   #1
anand_kt
Member
 
Registered: Dec 2004
Location: Chennai, India
Distribution: Red Hat, Knoppix
Posts: 86

Rep: Reputation: 15
Mount a raid array with SGID bit set, howto?


Guys,

Distro: RH EL AS 3 ( kernel 2.4 )

I have a RAID 0 array at /dev/md1

I am able to mount it at boot time by apending the fstab with this line:

/dev/md1 /data/sysadmin ext3 defaults 0 0

But i need to do one more thing, i need to Set GUID on the mount point, ie 'sysadmin' directory so that all files created henceforth will heave group as 'sysadmin' irrespective of the one who creates it.

Can anyone help?

ps: i know that i can pass more options along with 'defaults' in the fstab file, but i am unaware of the exact syntax. please give me the exact syntax.

Regards
Anand
 
Old 03-30-2005, 05:16 AM   #2
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
You should refer to the man mount pages.

Consider using 'man -Tps mount >mount.ps

This will produce a nice looking postscript file that you can print out.

Another option is 'man -Tdvi mount >mount.dvi
You can view and print out the file in 'kdvi' or 'xdvi' programs.

Other man or info pages to look at are 'fstab' 'fileutils' and 'coreutils'.

If the directory needs to have write access for users who are not members of the group you mentioned, then you need to use the 'chmod o+w' command on the directory to give them write access. However this would give everyone write access to the directory, so you may need to come up with a different group name, and make all users with write access members of the group, or make these users members of 'sysadmin'.

Another alternative is to use SELinux, which allows fine tuning of file access using ACLs (Access Control Lists). This might require a re-install and would entail study and planning. Red Hat may have an SELinux kernel package you can install, but there would be more to it, and someone else would have to give you the details.
 
Old 03-30-2005, 05:28 AM   #3
anand_kt
Member
 
Registered: Dec 2004
Location: Chennai, India
Distribution: Red Hat, Knoppix
Posts: 86

Original Poster
Rep: Reputation: 15
Thanks for your insights onto how to format and use man page outputs.
Real help.

and 'chmod' command, yes i know how to work on it and set permissions/suid/sgid/sticky.

But, I know this can be done by putting a entry in to the 'options' field of the 'fstab' file. Exact syntax of which is I need to know. Would be of some help if you somone can answer (only) that
 
Old 04-01-2005, 01:10 AM   #4
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
You would use either the umask or the fmask and dmask options when mounting a fat32 or ntfs or smb partition. It is done this way because these are foreign file systems which don't contain the normal unix file information. You can even use a uid and gid mounting option in fstab to determine the owner and group of the partition. When used in the /etc/fstab file, these options determine what the permissions on files and directories will be.

However for a unix file-system, the umask is a function of the shell and not a particular partition. It is the default file creation mask, and is used to filter out (eliminate) file permissions when a file is being created. However, the partition might contain older files and directories with different permissions.

In contrast, the umask and fmask options in the /etc/fstab file determine what the permissions of all of the files will be.

On an ext3 partition or directory, you use the chmod command to change permissions on a mounted partition. After doing it once, it will retain those permissions the next time it is mounted. In other words this information is contained in the file-system being mounted except for certain file-systems that don't contain unix/linux file-system information (Such as Fat32, NTFS and Samba). That is when you include them in the mount command. However these permissions will apply to the entire partition.

One last note. The fmask and dmask options I mentioned earlier are similar to the umask option, but the fmask effects files while the dmask effects directories. This allows you to mask out the execution bit for files on a world writeable directory. The 'x' bit is different for directories. It allows one to enter the directory.

Last edited by jschiwal; 04-01-2005 at 01:24 AM.
 
Old 04-01-2005, 01:30 AM   #5
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
OK, I just reread through the manpage of mount.

Quote:
grpid or bsdgroups / nogrpid or sysvgroups
These options define what group id a newly created file gets. When grpid is set, it takes the group id of the directory in which it is created; otherwise (the default) it takes the fsgid of the current process, unless the directory has the setgid bit set, in which case it takes the gid from the parent directory, and also gets the setgid bit set if it is a directory itself
This is the section for 'ext2' filesystems. The 'ext2' options are a subset of the 'ext3' options.

This answers your question, but I found the answer by doing precisely what I suggested you do! But double check the man page on your system to make sure. Also, I've noticed that the '-T' option isn't available on Mandrake for AMD64, so always double check things you get off the web on your own system to make sure that they hold.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Raid Array wwnexc Linux - Hardware 1 09-25-2005 05:47 PM
SuSE 9.0 Pro 64-bit Version Won't Recognize SATA RAID Array mjohns Linux - Distributions 2 05-04-2004 06:45 PM
How to verify Raid 0 array? fclifton Linux - Newbie 2 05-03-2004 03:32 PM
power for raid array rtp405 Linux - Hardware 1 02-05-2003 05:36 PM
moving a md array (RAID) MorrisIS Linux - General 2 10-04-2001 11:41 PM


All times are GMT -5. The time now is 04:16 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration