1 |
2009/5/25 Mark Knecht <markknecht@×××××.com> |
2 |
|
3 |
> Hi, |
4 |
> I'm wondering what I need to read about and do to get a USB drive |
5 |
> to auto-mount reliably at boot time? I don't know anything about udev |
6 |
> so I tried what I thought used to work in my /etc/fstab file but it |
7 |
> doesn't work. The drive mounts by hand just fine: |
8 |
> |
9 |
> MacMini linux # cat /etc/fstab | grep video |
10 |
> /dev/sda1 /video ext3 auto,rw 0 2 |
11 |
> MacMini linux # df |
12 |
> Filesystem 1K-blocks Used Available Use% Mounted on |
13 |
> /dev/hda4 75890040 60601600 11433376 85% / |
14 |
> udev 10240 164 10076 2% /dev |
15 |
> shm 257396 0 257396 0% /dev/shm |
16 |
> MacMini linux # mount /dev/sda1 /video |
17 |
> MacMini linux # df |
18 |
> Filesystem 1K-blocks Used Available Use% Mounted on |
19 |
> /dev/hda4 75890040 60601604 11433372 85% / |
20 |
> udev 10240 164 10076 2% /dev |
21 |
> shm 257396 0 257396 0% /dev/shm |
22 |
> /dev/sda1 157566568 192068 149370520 1% /video |
23 |
> MacMini linux # |
24 |
> |
25 |
> Must I use udev (and if so how - what do I study to make this work) |
26 |
> or can I do this in fstab and I've just forgotten something simple? |
27 |
> |
28 |
> Also, what's the feeling these days about the reliability of |
29 |
> automounting by device? Would I be better to use e2label on the |
30 |
> partition? |
31 |
> |
32 |
> Thanks in advance, |
33 |
> Mark |
34 |
> |
35 |
> |
36 |
|
37 |
run *lsusb –v* |
38 |
|
39 |
you will see somethin like this |
40 |
|
41 |
*Bus 003 Device 010: ID 152d:2338* |
42 |
|
43 |
*Device Descriptor:* |
44 |
|
45 |
*...dVendor 0x152d* |
46 |
|
47 |
* idProduct 0x2338* |
48 |
|
49 |
* bcdDevice 1.00* |
50 |
|
51 |
* **iManufacturer 1* |
52 |
|
53 |
* iProduct 2* |
54 |
|
55 |
* iSerial 5* |
56 |
|
57 |
* bNumConfigurations 1* |
58 |
Now make file /etc/udev/rule.d/z98-usb-flash.rules with this content |
59 |
|
60 |
*SUBSYSTEM**=="block**", SYSFS**{idProduct**}=="2338", |
61 |
SYSFS**{idVendor**}=="152d**", NAME**="name**" **RUN+="/bin/mount |
62 |
/dev/name /media/name"* |
63 |
|
64 |
* |
65 |
Change idProduct and idVendor and to your data. And name too. With |
66 |
this name your device will apear in /dev. And of course mkfir |
67 |
/media/name |
68 |
* |