Gentoo Archives: gentoo-user

From: Walter Dnes <waltdnes@××××××××.org>
To: Gentoo Users List <gentoo-user@l.g.o>
Subject: [gentoo-user] OT: mount so that other users can write to mounted dir?
Date: Wed, 23 May 2012 03:04:15
Message-Id: 20120523002603.GA4469@waltdnes.org
1 I'm not really a fan of automount, but I understand that lots of
2 people are. I'm trying to get it fully functional under mdev, and then
3 do a write-up on the wiki page. A Google search turns up lots of
4 examples of code. However, the examples are for embedded devices, and
5 they assume the only user is root. I've got the automounting and
6 autounmounting working. Everybody can read the mounted USB stick, but
7 only root can write. I've tried pmount with the umask option, but it
8 doesn't help. Assume the scrpt gets passed MDEV="sdb1"
9
10 #
11 # Create the directory in /media
12 mkdir -p /media/${MDEV}
13 #
14 # Change permissions to allow read+write by all
15 chmod 777 /media/${MDEV}
16 #
17 # Mount the directory in /media
18 pmount --noatime --umask 000 /dev/${MDEV}
19
20 But after the mount...
21 user2@aa1 /media $ ll
22 total 3
23 drwxr-xr-x 3 root root 1024 May 22 19:02 .
24 drwxr-xr-x 19 root root 1024 May 21 20:41 ..
25 drwxr-xr-x 5 root root 1024 May 16 01:42 sdb1
26
27 Every directory and file belongs to user:group root:root. On the USB
28 stick all directories are 755 and files are 744. As a heavy-handed ugly
29 hack, I could...
30
31 chgrp -R users /media/${MDEV}
32 chmod -R g+w /media/${MDEV}
33
34 to a USB stick. I obviously don't wnt to do that on the external USB
35 drive that I rsync my system to every few weeks. Any ideas? And oh
36 yes, I do realize I'm trying to re-invent the wheel. The old one has
37 a broken udev :(
38
39 --
40 Walter Dnes <waltdnes@××××××××.org>

Replies

Subject Author
Re: [gentoo-user] OT: mount so that other users can write to mounted dir? Alan McKinnon <alan.mckinnon@×××××.com>