Gentoo Archives: gentoo-user

From: Joseph <syscon780@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] USB permission/owner - change not allowed as root
Date: Wed, 01 Jan 2014 02:14:41
Message-Id: 20140101021436.GA27695@syscon7.ed.shawcable.net
In Reply to: Re: [gentoo-user] USB permission/owner - change not allowed as root by Bruce Hill
1 On 12/31/13 12:03, Bruce Hill wrote:
2
3 [snip]
4 >
5 >The blkid output would have shown this device, it's UUID, and filesystem.
6 >
7 >At any rate, for my flash drives I want them mounted with perms for rw for
8 >user mingdao, so I put something like this in /etc/fstab:
9 >
10 >baruch ~ # blkid /dev/sdc1
11 >/dev/sdc1: LABEL="AMD" UUID="CA00-9136" TYPE="vfat"
12 >baruch ~ # grep CA00-9136 /etc/fstab
13 >UUID=CA00-9136 /AMD vfat noauto,users,rw,gid=1000,dmask=0002,fmask=0113 0 0
14 >
15 >Different for NTFS, of course. And btw, I don't automount anything anything
16 >that is plugged in. Just my preference.
17 >
18 >As Alan mentioned, "man mount" would be a good read; as well as "man fstab".
19 >And, did I give you a link to an article on file permissions?
20 >
21 >The difference between user and users mean simply that with "user" only the
22 >user who mounted the device can unmount it; with "users" any user can unmount
23 >it, not just the user who mounted it.
24 >
25 >Cheers,
26 >Bruce
27
28 Thanks for the input.
29 In my case "blkid" is not showing any LABEL
30
31 It depends on what USB I insert:
32
33 #blkid /dev/sdb1
34 /dev/sdb1: UUID="2f5fc53e-4f4c-4e74-b9c4-fca316b47fea" TYPE="ext2"
35
36 #blkid
37 /dev/sdb1: UUID="3136-3934" TYPE="vfat"
38
39 so it would be hard to specify UUID in fstab for each momory card I insert.
40 In the past the line in fstab:
41 /dev/sdb1 /media/stick auto noauto,rw,users 0 0
42
43 mounted both "ext2" and "vfat" USB as /media/stick so it is easier to reference to it in scripts.
44 But after recent update if I have this line in fstab the "ext2" USB is mounted as joseph:users
45 but "vfat" USB is mounted as "root:root"
46
47 If I remove the mounting line from fstab they mount with correct permission "joseph:users" but the mount point is reference as UUID and it makes it hard to reference
48 it in bash scripts.
49
50 --
51 Joseph

Replies

Subject Author
Re: [gentoo-user] USB permission/owner - change not allowed as root Neil Bothwick <neil@××××××××××.uk>