Gentoo Archives: gentoo-user

From: Mark Knecht <markknecht@×××××.com>
To: Gentoo User <gentoo-user@l.g.o>
Subject: [gentoo-user] User can mount/umount but not write to top the new drive
Date: Mon, 09 Apr 2012 20:01:24
Message-Id: CAK2H+eddgVMBoVUFR0V8QA79y9eE_3hMcQDdAW-UwhyOY+mEdQ@mail.gmail.com
1 Hi,
2 This has long been a sort of hack area of me in terms of sys admin
3 at home - giving a user account access to the top of a new external
4 drive. I'd like to learn to do this right. Maybe someone can set me
5 straight about what root needs to do to make this work.
6
7 OK, so as root I partition & format the USB drive to get it ready,
8 and then I modify fstab with the following addition:
9
10 c2stable ~ # cat /etc/fstab | grep VideoLib
11 LABEL=VideoLib /mnt/VideoLib ext3
12 auto,rw,users 0 0
13 c2stable ~ #
14
15 Having done that, as well as making the /mnt/VideoLib mount point,
16 my user account can now mount & umount the drive:
17
18 mark@c2stable ~ $ mount /mnt/VideoLib/
19 mark@c2stable ~ $ df -h | grep VideoLib
20 /dev/sdf1 458G 199M 435G 1% /mnt/VideoLib
21 mark@c2stable ~ $ umount /mnt/VideoLib/
22 mark@c2stable ~ $ df -h | grep VideoLib
23 mark@c2stable ~ $
24
25 The problem is that at this point my user account cannot create a
26 new directory on that drive:
27
28 mark@c2stable ~ $ mount /mnt/VideoLib/
29 mark@c2stable ~ $ df -h | grep VideoLib
30 /dev/sdf1 458G 199M 435G 1% /mnt/VideoLib
31 mark@c2stable ~ $ mkdir /mnt/VideoLib/Video
32 mkdir: cannot create directory `/mnt/VideoLib/Video': Permission denied
33 mark@c2stable ~ $
34
35 In the past I've gotten around this by having root mount the drive
36 and then change ownership to mark:users once it's mounted. Linux
37 remembers I've done that once and no longer requires me to do anything
38 else as root.
39
40 Is that truly required or is there a way to give the user access to
41 the top of the new mount point without roots' involvement?
42
43 Thanks,
44 Mark

Replies

Subject Author
Re: [gentoo-user] User can mount/umount but not write to top the new drive "Canek Peláez Valdés" <caneko@×××××.com>
Re: [gentoo-user] User can mount/umount but not write to top the new drive Neil Bothwick <neil@××××××××××.uk>
Re: [gentoo-user] User can mount/umount but not write to top the new drive Stroller <stroller@××××××××××××××××××.uk>