1 |
On Tue, 22 May 2012 20:26:03 -0400 |
2 |
"Walter Dnes" <waltdnes@××××××××.org> wrote: |
3 |
|
4 |
> I'm not really a fan of automount, but I understand that lots of |
5 |
> people are. I'm trying to get it fully functional under mdev, and |
6 |
> then do a write-up on the wiki page. A Google search turns up lots of |
7 |
> examples of code. However, the examples are for embedded devices, and |
8 |
> they assume the only user is root. I've got the automounting and |
9 |
> autounmounting working. Everybody can read the mounted USB stick, but |
10 |
> only root can write. I've tried pmount with the umask option, but it |
11 |
> doesn't help. Assume the scrpt gets passed MDEV="sdb1" |
12 |
> |
13 |
> # |
14 |
> # Create the directory in /media |
15 |
> mkdir -p /media/${MDEV} |
16 |
> # |
17 |
> # Change permissions to allow read+write by all |
18 |
> chmod 777 /media/${MDEV} |
19 |
> # |
20 |
> # Mount the directory in /media |
21 |
> pmount --noatime --umask 000 /dev/${MDEV} |
22 |
> |
23 |
> But after the mount... |
24 |
> user2@aa1 /media $ ll |
25 |
> total 3 |
26 |
> drwxr-xr-x 3 root root 1024 May 22 19:02 . |
27 |
> drwxr-xr-x 19 root root 1024 May 21 20:41 .. |
28 |
> drwxr-xr-x 5 root root 1024 May 16 01:42 sdb1 |
29 |
> |
30 |
> Every directory and file belongs to user:group root:root. On the |
31 |
> USB stick all directories are 755 and files are 744. As a |
32 |
> heavy-handed ugly hack, I could... |
33 |
> |
34 |
> chgrp -R users /media/${MDEV} |
35 |
> chmod -R g+w /media/${MDEV} |
36 |
> |
37 |
> to a USB stick. I obviously don't wnt to do that on the external USB |
38 |
> drive that I rsync my system to every few weeks. Any ideas? And oh |
39 |
> yes, I do realize I'm trying to re-invent the wheel. The old one has |
40 |
> a broken udev :( |
41 |
> |
42 |
|
43 |
What filesystem is on that stick? |
44 |
|
45 |
For vfat and ntfs what you are truing should work. |
46 |
For Unix file systems (ext*, reiser, etc), it will not work. You cannot |
47 |
override owners and permissions with the mount command on those. |
48 |
|
49 |
|
50 |
|
51 |
|
52 |
-- |
53 |
Alan McKinnnon |
54 |
alan.mckinnon@×××××.com |