Gentoo Archives: gentoo-user

From: Paul Hartman <paul.hartman+gentoo@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Fwd: Set mount point of external drive with udev rules
Date: Tue, 30 Mar 2010 17:05:30
Message-Id: 58965d8a1003300920q1d9cd371v2e7449c5d63a1a74@mail.gmail.com
In Reply to: [gentoo-user] Fwd: Set mount point of external drive with udev rules by mikey
1 On Tue, Mar 30, 2010 at 11:10 AM, mikey <abc.mikey@××××××××××.com> wrote:
2 > Hi I have an external drive that I would like mounted with HAL, so
3 > that it doesn't mount on boot (which takes ages for it to spin up) and
4 > so that I can add and remove it easily.
5 >
6 > As I understand it udev rules are the way of doing this.
7 >
8 > I have spent quite a while reading about these and understand roughly
9 > what i want but I can't get any response from the changes I have made
10 > (and have had to guess about things I don't want to guess about) so
11 > how do I set them:
12 >
13 > My guess to see if I can select the right drive
14 > /etc/udev/rules.d/10-local.rules:
15 >
16 > SUBSYSTEMS=="block", ATTRS{serial}=="2HBEQTN2", KERNEL=="sd?",
17 > NAME="%k", SYMLINK+="external", GROUP="storage"
18 > SUBSYSTEMS=="scsi", ATTRS{serial}=="2HBEQTN2",KERNEL=="sd?1",
19 > SYMLINK+="external", GROUP="storage"
20 >
21 >
22 > Produces no /dev/external when I restart HALD
23
24 I recently did this with a bit more generic rule, this works for me:
25
26 #LaCie 2TB USB hard drive
27 SUBSYSTEMS=="usb", ATTRS{manufacturer}=="LaCie",
28 ATTRS{product}=="LaCie Hard Disk", NAME{all_partitions}="lacie",
29 SYMLINK="lacie"
30
31 It will create /dev/lacie1 for the first partition, /dev/lacie2 for second, etc.