Gentoo Archives: gentoo-user

From: mikey <abc.mikey@××××××××××.com>
To: gentoo-user@l.g.o
Subject: [gentoo-user] Fwd: Set mount point of external drive with udev rules
Date: Tue, 30 Mar 2010 17:04:00
Message-Id: 4ebfceac1003300910q5e881fafwe1e1be617997b6d1@mail.gmail.com
1 Hi I have an external drive that I would like mounted with HAL, so
2 that it doesn't mount on boot (which takes ages for it to spin up) and
3 so that I can add and remove it easily.
4
5 As I understand it udev rules are the way of doing this.
6
7 I have spent quite a while reading about these and understand roughly
8 what i want but I can't get any response from the changes I have made
9 (and have had to guess about things I don't want to guess about) so
10 how do I set them:
11
12 My guess to see if I can select the right drive
13 /etc/udev/rules.d/10-local.rules:
14
15 SUBSYSTEMS=="block", ATTRS{serial}=="2HBEQTN2", KERNEL=="sd?",
16 NAME="%k", SYMLINK+="external", GROUP="storage"
17 SUBSYSTEMS=="scsi", ATTRS{serial}=="2HBEQTN2",KERNEL=="sd?1",
18 SYMLINK+="external", GROUP="storage"
19
20
21 Produces no /dev/external when I restart HALD
22
23 This is the info about my drive:
24
25 $ /sbin/udevadm info -a -p $(/sbin/udevadm info -q path -n /dev/sdb)
26
27 Udevadm info starts with the device specified by the devpath and then
28 walks up the chain of parent devices. It prints for every device
29 found, all possible attributes in the udev rules key format.
30 A rule to match, can be composed by the attributes of the device
31 and the attributes from one single parent device.
32
33  looking at device
34 '/devices/pci0000:00/0000:00:02.1/usb1/1-2/1-2:1.0/host4/target4:0:0/4:0:0:0/block/sdb':
35    KERNEL=="sdb"
36    SUBSYSTEM=="block"
37    DRIVER==""
38    ATTR{range}=="16"
39    ATTR{ext_range}=="256"
40    ATTR{removable}=="0"
41    ATTR{ro}=="0"
42    ATTR{size}=="976773168"
43    ATTR{alignment_offset}=="0"
44    ATTR{capability}=="52"
45    ATTR{stat}=="     295      954     4852    38240       14        1
46     120       10        0    38130    38250"
47
48  looking at parent device
49 '/devices/pci0000:00/0000:00:02.1/usb1/1-2/1-2:1.0/host4/target4:0:0/4:0:0:0':
50    KERNELS=="4:0:0:0"
51    SUBSYSTEMS=="scsi"
52    DRIVERS=="sd"
53    ATTRS{device_blocked}=="0"
54    ATTRS{type}=="0"
55    ATTRS{scsi_level}=="3"
56    ATTRS{vendor}=="Maxtor  "
57    ATTRS{model}=="Basics Desktop  "
58    ATTRS{rev}=="0122"
59    ATTRS{state}=="running"
60    ATTRS{timeout}=="30"
61    ATTRS{iocounterbits}=="32"
62    ATTRS{iorequest_cnt}=="0x14f"
63    ATTRS{iodone_cnt}=="0x14f"
64    ATTRS{ioerr_cnt}=="0x9"
65    ATTRS{modalias}=="scsi:t-0x00"
66    ATTRS{evt_media_change}=="0"
67    ATTRS{queue_depth}=="1"
68    ATTRS{queue_type}=="none"
69    ATTRS{max_sectors}=="240"
70
71  looking at parent device
72 '/devices/pci0000:00/0000:00:02.1/usb1/1-2/1-2:1.0/host4/target4:0:0':
73    KERNELS=="target4:0:0"
74    SUBSYSTEMS=="scsi"
75    DRIVERS==""
76
77  looking at parent device
78 '/devices/pci0000:00/0000:00:02.1/usb1/1-2/1-2:1.0/host4':
79    KERNELS=="host4"
80    SUBSYSTEMS=="scsi"
81    DRIVERS==""
82
83  looking at parent device '/devices/pci0000:00/0000:00:02.1/usb1/1-2/1-2:1.0':
84    KERNELS=="1-2:1.0"
85    SUBSYSTEMS=="usb"
86    DRIVERS=="usb-storage"
87    ATTRS{bInterfaceNumber}=="00"
88    ATTRS{bAlternateSetting}==" 0"
89    ATTRS{bNumEndpoints}=="02"
90    ATTRS{bInterfaceClass}=="08"
91    ATTRS{bInterfaceSubClass}=="06"
92    ATTRS{bInterfaceProtocol}=="50"
93    ATTRS{modalias}=="usb:v0D49p7410d0122dc00dsc00dp00ic08isc06ip50"
94    ATTRS{supports_autosuspend}=="0"
95
96  looking at parent device '/devices/pci0000:00/0000:00:02.1/usb1/1-2':
97    KERNELS=="1-2"
98    SUBSYSTEMS=="usb"
99    DRIVERS=="usb"
100    ATTRS{configuration}==""
101    ATTRS{bNumInterfaces}==" 1"
102    ATTRS{bConfigurationValue}=="1"
103    ATTRS{bmAttributes}=="c0"
104    ATTRS{bMaxPower}=="  2mA"
105    ATTRS{urbnum}=="1392"
106    ATTRS{idVendor}=="0d49"
107    ATTRS{idProduct}=="7410"
108    ATTRS{bcdDevice}=="0122"
109    ATTRS{bDeviceClass}=="00"
110    ATTRS{bDeviceSubClass}=="00"
111    ATTRS{bDeviceProtocol}=="00"
112    ATTRS{bNumConfigurations}=="1"
113    ATTRS{bMaxPacketSize0}=="64"
114    ATTRS{speed}=="480"
115    ATTRS{busnum}=="1"
116    ATTRS{devnum}=="2"
117    ATTRS{version}==" 2.00"
118    ATTRS{maxchild}=="0"
119    ATTRS{quirks}=="0x0"
120    ATTRS{authorized}=="1"
121    ATTRS{manufacturer}=="Maxtor  "
122    ATTRS{product}=="Basics Desktop  "
123    ATTRS{serial}=="2HBEQTN2    "
124
125  looking at parent device '/devices/pci0000:00/0000:00:02.1/usb1':
126    KERNELS=="usb1"
127    SUBSYSTEMS=="usb"
128    DRIVERS=="usb"
129    ATTRS{configuration}==""
130    ATTRS{bNumInterfaces}==" 1"
131    ATTRS{bConfigurationValue}=="1"
132    ATTRS{bmAttributes}=="e0"
133    ATTRS{bMaxPower}=="  0mA"
134    ATTRS{urbnum}=="40"
135    ATTRS{idVendor}=="1d6b"
136    ATTRS{idProduct}=="0002"
137    ATTRS{bcdDevice}=="0206"
138    ATTRS{bDeviceClass}=="09"
139    ATTRS{bDeviceSubClass}=="00"
140    ATTRS{bDeviceProtocol}=="00"
141    ATTRS{bNumConfigurations}=="1"
142    ATTRS{bMaxPacketSize0}=="64"
143    ATTRS{speed}=="480"
144    ATTRS{busnum}=="1"
145    ATTRS{devnum}=="1"
146    ATTRS{version}==" 2.00"
147    ATTRS{maxchild}=="10"
148    ATTRS{quirks}=="0x0"
149    ATTRS{authorized}=="1"
150    ATTRS{manufacturer}=="Linux 2.6.31-gentoo-r10 ehci_hcd"
151    ATTRS{product}=="EHCI Host Controller"
152    ATTRS{serial}=="0000:00:02.1"
153    ATTRS{authorized_default}=="1"
154
155  looking at parent device '/devices/pci0000:00/0000:00:02.1':
156    KERNELS=="0000:00:02.1"
157    SUBSYSTEMS=="pci"
158    DRIVERS=="ehci_hcd"
159    ATTRS{vendor}=="0x10de"
160    ATTRS{device}=="0x005b"
161    ATTRS{subsystem_vendor}=="0x1043"
162    ATTRS{subsystem_device}=="0x815a"
163    ATTRS{class}=="0x0c0320"
164    ATTRS{irq}=="21"
165    ATTRS{local_cpus}=="ffffffff"
166    ATTRS{local_cpulist}=="0-31"
167    ATTRS{modalias}=="pci:v000010DEd0000005Bsv00001043sd0000815Abc0Csc03i20"
168    ATTRS{broken_parity_status}=="0"
169    ATTRS{msi_bus}==""
170    ATTRS{companion}==""
171
172  looking at parent device '/devices/pci0000:00':
173    KERNELS=="pci0000:00"
174    SUBSYSTEMS==""
175    DRIVERS==""

Replies

Subject Author
Re: [gentoo-user] Fwd: Set mount point of external drive with udev rules Paul Hartman <paul.hartman+gentoo@×××××.com>
Re: [gentoo-user] Fwd: Set mount point of external drive with udev rules Neil Bothwick <neil@××××××××××.uk>
[gentoo-user] Re: Set mount point of external drive with udev rules "»Q«" <boxcars@×××.net>