Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - General
User Name
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.


  Search this Thread
Old 08-29-2007, 03:30 AM   #1
Registered: Aug 2004
Distribution: opensuse ,debian
Posts: 208

Rep: Reputation: 30
how to enable normal user to read/write ext3 partition

Hi all,

here's my current fstab
/dev/sda6      swap             swap        defaults         0   0
/dev/sda5      /                ext3        defaults         1   1
/dev/sda1      /DOS             ntfs        noauto,owner,user,ro  0   0
/dev/sda7      /DATA            ext3        noauto,owner,user,rw  0   0
/dev/cdrom     /mnt/cdrom       auto        noauto,owner,ro  0   0
devpts         /dev/pts         devpts      gid=5,mode=620   0   0
proc           /proc            proc        defaults         0   0
Currently only root can mount and write to /DATA.
I want normal user to be able to write also in /DATA but not necessarily be able to mount.
How to achieve this?

if i change this line
/dev/sda7     /DATA       ext3      noauto,owner,user,rw  0   0
/dev/sda7     /DATA       ext3      umask=0000,defaults  0   0
when i try to mount as root
there's error:
mount: wrong fs type, bad option, bad superblock on /dev/sda7,
       missing codepage or other error
       In some cases useful info is found in syslog - try
       dmesg | tail  or so
Anyone can help?
Old 08-29-2007, 11:26 AM   #2
Registered: Nov 2005
Location: Central New York
Distribution: Ubuntu
Posts: 405

Rep: Reputation: 31
I think that the easiest way to achieve this would be to set the mount options up like this:

/dev/sda7      /DATA            ext3        rw,suid,dev,exec,noauto,nouser,async  0   0
These should be the default options, with the exception of noauto. You might want to check the man page for mount on your system to double check these options.

You can then mount as root and create a directory with the proper permissions for your users to write to.
Old 08-29-2007, 12:50 PM   #3
LQ Guru
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 130Reputation: 130
Well, if it's only one user, the most straightforward solution may be to chown the /DATA partition.

From the terminal (as root)

chown -R username:username /DATA

By the way, you can't write unless you mount. You can't tap a foot you haven't got.

Last edited by jay73; 08-29-2007 at 12:52 PM.
Old 08-30-2007, 02:08 AM   #4
Registered: Aug 2004
Distribution: opensuse ,debian
Posts: 208

Original Poster
Rep: Reputation: 30
Tried both,didn't work.
sorry, i think I have to make it a clear question.
How to make my /DATA so that only root can mount but all users can have write access to this partition without using any separate dir ? is this possible
yes, i have read man mount especially about the options but i'm confused with suid,nodev,etc.
Old 08-30-2007, 02:12 AM   #5
LQ Guru
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
I did this a while ago; haven't been messing around with user permissions and mounting too much lately, but actually it was chown'ing/chmod'ing the directory (when mounted). With FAT partitions you can give the umask mount option, but with ext3 it should be just about giving the correct permissions to the mounted filesystem (mount directory too, the top of the mounted filesystem). With mount options you can then control who can mount it, root only or users aswell.
Old 08-30-2007, 06:11 AM   #6
LQ Addict
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,891

Rep: Reputation: 351Reputation: 351Reputation: 351Reputation: 351
Edit /etc/fstab to change option *user* to *nouser*. That prevents non-root users from mounting/umounting partitions. It's supposed to be the default behavior, so possibly just removing the *user* option would work. Explicitly stating *nouser* won't hurt anything.

Set the ownership of /DATA to root:users. Set the permissions to:
u +rwx
g +rwx
o --- (or whatever you want others to have).

The x permission on directories allows access to the directory (cd into) for members of the users group. Without x permission, users can't write to the directory.


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
Mount ext3 partition in /home/USER/Documents with read/write/execute acces for USER anonymous234 Linux - Hardware 2 01-12-2007 12:23 PM
How can i read and write to a ext3 partition from windows saini_mw Linux - Software 6 04-19-2006 02:07 AM
How can I do an automated Read/Write SMB mount for a normal user? molear Linux - Newbie 1 07-01-2004 02:45 PM
Read/Write access ext3 partition st00 *BSD 5 06-28-2004 08:46 PM
Cant read/write to second hard disk under normal user Nukem Linux - General 8 01-28-2004 07:03 AM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:22 AM.

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