how to enable normal user to read/write ext3 partition
Linux - GeneralThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
Code:
/dev/sda7 /DATA ext3 noauto,owner,user,rw 0 0
to:
Code:
/dev/sda7 /DATA ext3 umask=0000,defaults 0 0
when i try to mount as root
there's error:
Code:
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
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.
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.