setting volume permissions

Alan McKinnon alan at linuxholdings.co.za
Tue Aug 8 10:03:44 UTC 2006


On Mon, 2006-08-07 at 18:42 +0000, pkaplan1 at comcast.net wrote:
> I have an external USB disk attached to an LTS6.06 box.  There is a vfat 
> partition and two ext3 partition, but normal users can't write files to any of 
> the partitions.  The mount points (/media/hd1, /media/hd2, and /media/hd3) are, 
> as expected, owned by root and this can't be changed even with sudo.
> 
> Since this is a single user system, only one normal user (and root) needs to be 
> able to r/w/x to the volume.  What do I have to enable this functionality?
> TIA
> Paul

Put the correct mount options into /etc/fstab. The ext3 partitions must
not be mounted ro for example. The vfat partition is trickier, as vfat
is [clue < 0] about permissions. man mount lists everything you need,
pay attention to the uid, gid, umask, fmask and dmask options.

Assuming the normal user is uid 1000, these options should work:

rw,uid=1000,dmask=0077,fmask=0177

files will have permissions rw-------
dirs  will have permissions rwx------

The default is to use 'umask=077' instead of fmask and dmask. I use the
long method as I find that having all files on vfat marked executable
and displayed in green to be insanely annoying... :-)

alan






More information about the ubuntu-users mailing list