I just did something similar today.  I have a USB hard drive, and a USB mp3 player, and I used udev to set up the nodes so that they will always be the same.

I created a new file under /etc/devfs/rules.d, and called it 10-local.rules.  I used 10 so that it will be processed before the main rules files for udev.

The contents of the file are:
# Thompson/RCA MP3 player.  Mounts as a USB removable drive
# For mounting
BUS=="usb", KERNEL=="sd?1", SYSFS{product}=="RCA_MPCF2473_US ", NAME="%k", SYMLINK="rca_mp3"
# For fdisk
BUS=="usb", KERNEL=="sd?", SYSFS{product}=="RCA_MPCF2473_US ", NAME="%k", SYMLINK="rca_mp3_fdisk"

# External USB Hard Drives
BUS=="usb", KERNEL=="sd*", SYSFS{serial}=="DEF10B2734EF", NAME="%k", SYMLINK="usbhd%n"

As a reference, I used this document.

Now I can reference the new /dev entries in /etc/fstab like this:
# MP3 Player/USB Storage
/dev/rca_mp3            /media/rca_mp3  auto noauto,noatime,user             0 0

# USB Hard disk
# VFAT partition for windows stuff
/dev/usbhd1             /media/usbhd_10g_vfat   auto \ noauto,noatime,user             0 0
# Ubuntu Linux that can boot from the drive
/dev/usbhd2             /media/usbhd_9gig_ubuntu        auto  \ noauto,noatime,user             0 0
# boot directory for Ubuntu
/dev/usbhd3             /media/usbhd_15m_boot   auto   \ noauto,noatime,user             0 0
# ext3 partition with lots of space
/dev/usbhd5             /media/usbhd_47G_ext3   auto   \ noauto,noatime,user             0 0
/dev/usbhd6             /media/usbhd_211G_ext3  auto   \ noauto,noatime,user             0 0

Reply via email to