LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-15-2008, 03:13 PM   #1
stabu
Member
 
Registered: Mar 2004
Location: dublin IRL
Distribution: Slackv12.1, Slamd64v12.1,Xubuntu v8.10_64, FC8_64
Posts: 438
Blog Entries: 5

Rep: Reputation: 32
fstab=nest vipers


One thing that I'm very unsuccessful at is giving normal users write rights on mounted drives.

The key to this is fstab, but I have to admit that its syntax melts my brain (when I had one to melt:-)).

In the end, I just sud su to root and I have never bothered allowing users write to the mounts.

Can anyone say what the magic combo is for giving normalusers write-rights on mounts? "rw" doesn't cut it really, I think I need something else

Thanks!
 
Old 11-15-2008, 04:11 PM   #2
yowi
Member
 
Registered: Dec 2002
Location: Au
Distribution: Debian
Posts: 209

Rep: Reputation: 55
You're not very specific about your situation but the mount option "user" may meet your needs.

From man fstab:
Common for all types of file system are the options ‘‘noauto’’ (do not mount when "mount -a" is given, e.g., at boot time), ‘‘user’’ (allow a user to mount), and ‘‘owner’’ (allow device owner to mount), and ‘‘comment’’ (e.g., for use by fstab-maintaining programs).
 
Old 11-15-2008, 04:44 PM   #3
stabu
Member
 
Registered: Mar 2004
Location: dublin IRL
Distribution: Slackv12.1, Slamd64v12.1,Xubuntu v8.10_64, FC8_64
Posts: 438

Original Poster
Blog Entries: 5

Rep: Reputation: 32
thanks yowi, I will try that. I did have "users" in there ... you know that's the group my normalusers belong to ... maybe I got fizzled on that.
Cheers!
 
Old 11-15-2008, 05:25 PM   #4
yowi
Member
 
Registered: Dec 2002
Location: Au
Distribution: Debian
Posts: 209

Rep: Reputation: 55
user/users is applicable if the users are mounting the filesystem, if it's being mounted by root then you will need to play around with mount options and/or permissions, depending on what FS type it is you are mounting.
See man mount for the gory details.
 
Old 11-15-2008, 05:58 PM   #5
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
There are many separate issues.

If the file system is being mounted from fstab, then you need to pay attention to the file system you are using. With regular file systems you need "rw", which is the default anyway. The rest of the problem is giving access and write permission into the mount point once the drive is mounted. The owner also matters, this can be easily checked with ls -ld <mountpoint> once the drive is mounted. And can be changed with chmod and chown.

Different file systems might have different options to set the effective UID and / or GID for the mount, and others, like ntfs or fat which do not support the Linux scheme, just emulate all the permissions. So the can't be set using chmod nor chown. Instead they are set at mount time via the umask option. Use umask=000 for full permissions.

Note that the user and users options are not directly related to permissions. They just allow the regular users to mount drives, but that doesn't imply that they will have write permissions, at all. You should really check the man page for fstab, and, even more important, the man page for mount, where all the options (including all the ones I mentioned in this post) are described.
 
Old 11-15-2008, 10:16 PM   #6
egibbs
LQ Newbie
 
Registered: Aug 2003
Location: Santa Monica , CA
Distribution: mandrake & knoppix
Posts: 3

Rep: Reputation: 0
fstab

To read/write to a ntfs volume you may need to add: uid=xxx,gid=xxx to the mount options section of fstab.
 
Old 11-15-2008, 10:51 PM   #7
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Check the permissions of the mount point as a start. If you created it as root you may not have write access as a normal user.
 
Old 11-16-2008, 10:30 PM   #8
zinger919
LQ Newbie
 
Registered: Aug 2003
Posts: 7

Rep: Reputation: 0
I think i92guboj hit the nail on the head; chmod is your friend. Specifically, (assuming this is a mounted linux partition) try

[sudo] chmod 1777 <mount point>

This will give the same permissions typically assigned to /tmp, ie: all users would be allowed to create files & directories but not clobber those of other users (unless of course their permissions allow it). BTW, I would recommend you NOT do this for any partition that is used by the system (like /, /var, /usr, /etc, etc).

Last edited by zinger919; 11-16-2008 at 10:43 PM.
 
Old 11-17-2008, 05:01 AM   #9
stabu
Member
 
Registered: Mar 2004
Location: dublin IRL
Distribution: Slackv12.1, Slamd64v12.1,Xubuntu v8.10_64, FC8_64
Posts: 438

Original Poster
Blog Entries: 5

Rep: Reputation: 32
thanks for the replies.

i am aware of the different mechanisms, such as chmod and special situations with ntfs. my latest experimentations have focused on the umask property as the possible "panacea" or "magic combo" that I'm looking for.

However, I have not progressed much.I still get into trouble with an "easy" case, that is ext3

E.g. with the following line
Code:
/dev/sda6   /mnt/sda6   ext3 auto,user,rw,umask=000   0  0
I get an error saying it doesn't understand

Maybe I need quotation marks around the umask? Maybe be 000 is not allowed. As usual there are a series of potential causes that one must test and eliminate.

Any further pointers, still appreciated.
 
Old 11-17-2008, 07:08 AM   #10
yowi
Member
 
Registered: Dec 2002
Location: Au
Distribution: Debian
Posts: 209

Rep: Reputation: 55
wouldn't you want 777 as the mask? 000 isn't going to do anything.
 
Old 11-17-2008, 10:30 AM   #11
zinger919
LQ Newbie
 
Registered: Aug 2003
Posts: 7

Rep: Reputation: 0
You need to get off this "The key to this is fstab" kick. You're getting the error because "umask=000" is not applicable to ext3 filesystems. rw ext3 permissions are controlled by standard unix permission mechanisms. At the risk of repeating myself, chmod is your friend. You don't need the "user" in the fstab line (the system will mount it at boot). You want to change the last "0" in your fstab to "2" so the partition will be fsck'd. In other words, change fstab line to:

/dev/sda6 /mnt/sda6 ext3 auto,rw 0 2

then (one time only - as root or using sudo):
prompt> [sudo] mount /mnt/sda6
prompt> [sudo] chmod 1777 /mnt/sda6
 
Old 11-17-2008, 02:03 PM   #12
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
See for example http://www.linuxquestions.org/questi...ighlight=umask
 
Old 11-17-2008, 04:54 PM   #13
yowi
Member
 
Registered: Dec 2002
Location: Au
Distribution: Debian
Posts: 209

Rep: Reputation: 55
oops, missed that, umask invalid for ext3, listen to zinger919...
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
can you nest backticks? BrianK Programming 10 07-18-2023 06:49 PM
[bash] How do I nest for arrays? blckleprd Programming 3 06-05-2008 10:49 PM
how to nest commands new_2_unix Linux - Newbie 2 11-16-2007 10:20 PM
I am getting an error trying to nest Dynebolic, And a graphic anomaly McBidgeyFuggalo Linux - Newbie 0 09-03-2004 12:30 AM
flex c++ code about nest file?? chuanyung Programming 0 01-20-2004 03:36 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:59 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration