Ed Greshko wrote:
Alan Evans wrote:
> Howdy!
>
> When I insert a USB thumb drive formatted with vfat, it gets
> automagically mounted under /media with appropriate permissions so the
> logged in user can write to the device. But if the thumb drive is
> formatted ext2, only root can write to it.
>
> $ mount
> /dev/sdb1 on /media/Devel type ext2 (rw,nosuid,nodev,uhelper=hal)
> /dev/sdc1 on /media/disk type vfat
> (rw,nosuid,nodev,uhelper=hal,shortname=lower,uid=500)
> $ ll
> total 20
> drwxr-xr-x 3 root root 4096 2009-01-05 21:27 Devel
> drwxr-xr-x 3 alan root 16384 1969-12-31 16:00 disk
>
> Is there a way to make that work?
>
>
>
With the USB mounted become root.... Then "chown alan /media/disk".
The ownership information is maintained in the ext2 structure. So, the
next time it is mounted it will retain ownership by alan.
One thing to keep in mind if you do this - if you move the drive to
another machine where the UID and GID for alan are different, you
will not be able to access the drive as alan. The owner/group
settings are the number, not the name, of the user/group.
You may want to use chown alan:alan /media/Devel instead of chown
alan /media/disk. This will set both the owner and group of the
disk. In this case, I would not use the -R option - I do not know
what the affect of changing the ownership of /media/Devel/lost+found
would be.
You also have the option of creating a directory on the USB drive
owned by alan. That way, you could have storage for more then one
user on the drive.
Mikkel
--
Do not meddle in the affairs of dragons,
for thou art crunchy and taste good with Ketchup!