Gentoo Archives: gentoo-user

From: "Canek Peláez Valdés" <caneko@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] User can mount/umount but not write to top the new drive
Date: Mon, 09 Apr 2012 20:39:45
Message-Id: CADPrc83BcPD9gk2wqnJKUTkZugfESx=HF5ErA0Ht9XNYcttxEg@mail.gmail.com
In Reply to: [gentoo-user] User can mount/umount but not write to top the new drive by Mark Knecht
1 On Mon, Apr 9, 2012 at 2:59 PM, Mark Knecht <markknecht@×××××.com> wrote:
2 > Hi,
3 >   This has long been a sort of hack area of me in terms of sys admin
4 > at home - giving a user account access to the top of a new external
5 > drive. I'd like to learn to do this right. Maybe someone can set me
6 > straight about what root needs to do to make this work.
7 >
8 >   OK, so as root I partition & format the USB drive to get it ready,
9 > and then I modify fstab with the following addition:
10 >
11 > c2stable ~ # cat /etc/fstab | grep VideoLib
12 > LABEL=VideoLib          /mnt/VideoLib           ext3
13 > auto,rw,users 0 0
14 > c2stable ~ #
15 >
16 >   Having done that, as well as making the /mnt/VideoLib mount point,
17 > my user account can now mount & umount the drive:
18 >
19 > mark@c2stable ~ $ mount /mnt/VideoLib/
20 > mark@c2stable ~ $ df -h | grep VideoLib
21 > /dev/sdf1       458G  199M  435G   1% /mnt/VideoLib
22 > mark@c2stable ~ $ umount /mnt/VideoLib/
23 > mark@c2stable ~ $ df -h | grep VideoLib
24 > mark@c2stable ~ $
25 >
26 >   The problem is that at this point my user account cannot create a
27 > new directory on that drive:
28 >
29 > mark@c2stable ~ $ mount /mnt/VideoLib/
30 > mark@c2stable ~ $ df -h | grep VideoLib
31 > /dev/sdf1       458G  199M  435G   1% /mnt/VideoLib
32 > mark@c2stable ~ $ mkdir /mnt/VideoLib/Video
33 > mkdir: cannot create directory `/mnt/VideoLib/Video': Permission denied
34 > mark@c2stable ~ $
35 >
36 >   In the past I've gotten around this by having root mount the drive
37 > and then change ownership to mark:users once it's mounted. Linux
38 > remembers I've done that once and no longer requires me to do anything
39 > else as root.
40 >
41 >   Is that truly required or is there a way to give the user access to
42 > the top of the new mount point without roots' involvement?
43
44 Have you tried:
45
46 # cat /etc/fstab | grep VideoLib
47 LABEL=VideoLib          /mnt/VideoLib           ext3
48 auto,rw,users,uid=X,gid=Y 0 0
49
50 where X is mark's user id, and Y is users' group id?
51
52 On the other hand, do you use a desktop environment? Because GNOME
53 does everything you want for you, and I suppose KDE does the same.
54
55 Regards.
56 --
57 Canek Peláez Valdés
58 Posgrado en Ciencia e Ingeniería de la Computación
59 Universidad Nacional Autónoma de México

Replies

Subject Author
Re: [gentoo-user] User can mount/umount but not write to top the new drive Mark Knecht <markknecht@×××××.com>