I have an Ubuntu 10.04 box with an EXT4 partition. This partition is set to automatically mount in /etc/fstab. For the purposes of this post, we'll call it: /media/foo.

Unfortunately, only root can create/delete files/directories on the root filesystem of foo. For other users to perform file/io on this volume, root needs to create a directory and chmod the permissions to others.

I would like to mount the volume such that anybody would be able to read/write to the volume without the need of root to chmod.

Below is my fstab entry:

/dev/sda8    /media/foo    ext4    rw,user,exec 0 0

The entry originally had defaults instead of rw,user,exec. I added the additional entries, namely, rw so any user can read/write.

Unfortunately, the fstab entry does not work. It mounts fine, but it still requires root to intervene.

And, just in case anybody asks, simply running: chmod -R 777 * on /media/foo as root does not work.

link|improve this question

80% accept rate
feedback

5 Answers

up vote 8 down vote accepted

The mount option user only allows the filesystem to be mounted by any user. The rw option makes the filesystem not readonly. You will have to use permissions to make the parent directory writeable.

chmod 777 /media/foo

The chmod command you show only affects the existing files within /media/foo.

link|improve this answer
This works. Thanks for the help! :) – Phanto Aug 11 '10 at 16:59
feedback

I think it would be simpler to change the fstab entry to:

/dev/sda8    /media/foo    ext4    rw,user,exec,umask=000 0 0

umask=000 means that anyone can read, write or execute any file or directory in foo. The usual default is 022, which means that users cannot write.

link|improve this answer
feedback

Well for one thing, you want to make sure the directory of /media/foo itself is writeable. If it isn't already, run the following command:

chmod +w /media/foo

Remember, star only applies to the visible contents of the directory, not the directory itself nor any files that are not visible.

link|improve this answer
feedback

I had the same problem on openSUSE, but I think the solution can apply to this too. All the users I want to share the mounted filesystem belong to the same primary group: users

I have the following line in my fstab:

/dev/<partition> <mount_point>          ext4       rw,acl       0 0

and I ran the following commands:

sudo chgrp -R users <mount_point>
sudo setfacl -d -m g::rwx <mount_point>

so that newly created files or directories get those permissions. This implies that you have the acl package installed.

link|improve this answer
feedback

It seems that umask is not valid mount option for ext4. When I try to mount my hd with umask I get the following error:

EXT4-fs (sda1): Unrecognized mount option "umask=000" or missing value

I'm trying to solve the same problem here. I want to mount my ext4 formatted hard drive to /home/share and make it writeable for the "users" group. I also want to set the sticky bit on it.

What is the proper way to do this (just with fstab, or with fstab and invoking chmod after mount finishes, or some other way)?

I'm using Debian.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.