On Mon, Apr 9, 2012 at 1:38 PM, Canek Peláez Valdés <[email protected]> wrote:
> On Mon, Apr 9, 2012 at 2:59 PM, Mark Knecht <[email protected]> wrote:
>> Hi,
>> This has long been a sort of hack area of me in terms of sys admin
>> at home - giving a user account access to the top of a new external
>> drive. I'd like to learn to do this right. Maybe someone can set me
>> straight about what root needs to do to make this work.
>>
>> OK, so as root I partition & format the USB drive to get it ready,
>> and then I modify fstab with the following addition:
>>
>> c2stable ~ # cat /etc/fstab | grep VideoLib
>> LABEL=VideoLib /mnt/VideoLib ext3
>> auto,rw,users 0 0
>> c2stable ~ #
>>
>> Having done that, as well as making the /mnt/VideoLib mount point,
>> my user account can now mount & umount the drive:
>>
>> mark@c2stable ~ $ mount /mnt/VideoLib/
>> mark@c2stable ~ $ df -h | grep VideoLib
>> /dev/sdf1 458G 199M 435G 1% /mnt/VideoLib
>> mark@c2stable ~ $ umount /mnt/VideoLib/
>> mark@c2stable ~ $ df -h | grep VideoLib
>> mark@c2stable ~ $
>>
>> The problem is that at this point my user account cannot create a
>> new directory on that drive:
>>
>> mark@c2stable ~ $ mount /mnt/VideoLib/
>> mark@c2stable ~ $ df -h | grep VideoLib
>> /dev/sdf1 458G 199M 435G 1% /mnt/VideoLib
>> mark@c2stable ~ $ mkdir /mnt/VideoLib/Video
>> mkdir: cannot create directory `/mnt/VideoLib/Video': Permission denied
>> mark@c2stable ~ $
>>
>> In the past I've gotten around this by having root mount the drive
>> and then change ownership to mark:users once it's mounted. Linux
>> remembers I've done that once and no longer requires me to do anything
>> else as root.
>>
>> Is that truly required or is there a way to give the user access to
>> the top of the new mount point without roots' involvement?
>
> Have you tried:
>
> # cat /etc/fstab | grep VideoLib
> LABEL=VideoLib /mnt/VideoLib ext3
> auto,rw,users,uid=X,gid=Y 0 0
>
> where X is mark's user id, and Y is users' group id?
>
> On the other hand, do you use a desktop environment? Because GNOME
> does everything you want for you, and I suppose KDE does the same.
>
> Regards.
> --
> Canek Peláez Valdés
> Posgrado en Ciencia e Ingeniería de la Computación
> Universidad Nacional Autónoma de México
>
I had not tried those but they seem to cause problems so clearly I
don't have it right yet:
c2stable ~ # cat /etc/fstab | grep VideoLib
LABEL=VideoLib /mnt/VideoLib ext3
auto,rw,users,uid=1000,gid=100 0 0
c2stable ~ #
mark@c2stable ~ $ mount /mnt/VideoLib/
mount: wrong fs type, bad option, bad superblock on /dev/sdf1,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so
mark@c2stable ~ $
I tried both
uid=X,gid=Y
and
setuid=X,setgid=Y
Same results.
The man page sure reads like that should work but it didn't.
Thanks,
Mark