Gentoo Archives: gentoo-user

From: James Lockie <bjlockie@××××××.ca>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] external USB harddrive
Date: Thu, 04 Jan 2007 20:48:55
Message-Id: 459D6588.1060600@lockie.ca
In Reply to: RE: [gentoo-user] external USB harddrive by "Nelson
1 Nelson, David (ED, PAR&D) wrote:
2 >> -----Original Message-----
3 >> From: James Lockie [mailto:bjlockie@××××××.ca]
4 >> Sent: 04 January 2007 05:28
5 >> To: Gentoo User Mailing List
6 >> Subject: [gentoo-user] external USB harddrive
7 >>
8 >>
9 >> Does anyone have one of these? :-)
10 >> It mounts when I connect it but a user can't unmount it.
11 >> My USB memory stick and USB card reader work fine.
12 >> It is only the hard drive that I can't unmount as a user.
13 >> I don't have or want an /etc/fstab entry for it, I should be able to
14 >> configure KDE to handle it.
15 >>
16 >> --
17 >> gentoo-user@g.o mailing list
18 >>
19 >>
20 >
21 > I would add it to fstab (I reckon this would be the easiest way) - the same fstab entry should work for USB memory sticks/card readers as well, to my knowledge.
22 >
23 > Or if you wanted to get really fancy I believe you could write a udev rule so it recognises that device and assigns it /dev/externalhdd or the like :)
24 >
25 > David
26 > Note: These views are my own, advice is provided with no guarantee of success. I do not represent anyone else in any emails I send to this list.
27 >
28 >
29 I tried creating 10-my-udev.rules
30 # http://wiki.archlinux.org/index.php/Udev
31 KERNEL=="sd[c-z]", NAME="%k", SYMLINK+="usbhd-%k", GROUP="users",
32 OPTIONS="last_
33 rule"
34 ACTION=="add", KERNEL=="sd[c-z][0-9]", SYMLINK+="usbhd-%k",
35 GROUP="users", NAME=
36 "%k"
37 ACTION=="add", KERNEL=="sd[c-z][0-9]", RUN+="/bin/mkdir -p /media/usbhd-%k"
38 ACTION=="add", KERNEL=="sd[c-z][0-9]", RUN+="/bin/ln -s /media/usbhd-%k
39 /mnt/usb
40 hd-%k"
41 ACTION=="add", KERNEL=="sd[c-z][0-9]", PROGRAM=="/lib/udev/vol_id -t
42 %N", RESULT
43 =="vfat", RUN+="/bin/mount -t vfat -o
44 rw,noauto,sync,dirsync,noexec,nodev,noatim
45 e,dmask=000,fmask=111 /dev/%k /media/usbhd-%k", OPTIONS="last_rule"
46 ACTION=="add", KERNEL=="sd[c-z][0-9]", RUN+="/bin/mount -t auto -o
47 rw,noauto,syn
48 c,dirsync,noexec,nodev,noatime /dev/%k /media/usbhd-%k", OPTIONS="last_rule"
49 ACTION=="remove", KERNEL=="sd[c-z][0-9]", RUN+="/bin/rm -f /mnt/usbhd-%k"
50 ACTION=="remove", KERNEL=="sd[c-z][0-9]", RUN+="/bin/umount -l
51 /media/usbhd-%k"
52 ACTION=="remove", KERNEL=="sd[c-z][0-9]", RUN+="/bin/rmdir
53 /media/usbhd-%k", OPT
54 IONS="last_rule"
55 but then KDE doesn't see the new drive.
56
57 --
58 gentoo-user@g.o mailing list