Gentoo Archives: gentoo-user

From: K Barter <kbarter@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Teaching Linux to remember USB
Date: Mon, 27 Feb 2006 01:22:31
Message-Id: d5413e0a0602261714n5088f245l1e255c84d698b2b6@mail.gmail.com
In Reply to: [gentoo-user] Teaching Linux to remember USB by daniel
1 I just did something similar today. I have a USB hard drive, and a USB mp3
2 player, and I used udev to set up the nodes so that they will always be the
3 same.
4
5 I created a new file under /etc/devfs/rules.d, and called it 10-local.rules.
6 I used 10 so that it will be processed before the main rules files for udev.
7
8 The contents of the file are:
9 # Thompson/RCA MP3 player. Mounts as a USB removable drive
10 # For mounting
11 BUS=="usb", KERNEL=="sd?1", SYSFS{product}=="RCA_MPCF2473_US ", NAME="%k",
12 SYMLINK="rca_mp3"
13 # For fdisk
14 BUS=="usb", KERNEL=="sd?", SYSFS{product}=="RCA_MPCF2473_US ", NAME="%k",
15 SYMLINK="rca_mp3_fdisk"
16
17 # External USB Hard Drives
18 BUS=="usb", KERNEL=="sd*", SYSFS{serial}=="DEF10B2734EF", NAME="%k",
19 SYMLINK="usbhd%n"
20
21 As a reference, I used this
22 document.<http://reactivated.net/writing_udev_rules.html>
23
24 Now I can reference the new /dev entries in /etc/fstab like this:
25 # MP3 Player/USB Storage
26 /dev/rca_mp3 /media/rca_mp3 auto noauto,noatime,user
27 0 0
28
29 # USB Hard disk
30 # VFAT partition for windows stuff
31 /dev/usbhd1 /media/usbhd_10g_vfat auto \
32 noauto,noatime,user 0 0
33 # Ubuntu Linux that can boot from the drive
34 /dev/usbhd2 /media/usbhd_9gig_ubuntu auto \
35 noauto,noatime,user 0 0
36 # boot directory for Ubuntu
37 /dev/usbhd3 /media/usbhd_15m_boot auto \
38 noauto,noatime,user 0 0
39 # ext3 partition with lots of space
40 /dev/usbhd5 /media/usbhd_47G_ext3 auto \
41 noauto,noatime,user 0 0
42 /dev/usbhd6 /media/usbhd_211G_ext3 auto \
43 noauto,noatime,user 0 0

Replies

Subject Author
Re: [gentoo-user] Teaching Linux to remember USB daniel <danstemporaryaccount@×××××.ca>