Re: fstab entries for two different pendrives?
On Saturday 26 August 2006 11:56, Rodolfo Medina wrote:
> Hi, all.
>
> I have the following problem:
> yesterday I bought a new 256 MB pendrive, that wants to be mounted
> as `/dev/sda' whereas the other one I have wants `/dev/sda1'.
> Now, if in /etc/fstab I put the sda entry first, then can't mount sda1;
> and vice versa, if I put sda1 first then I can't mount sda.
>
Use udev to recognise the pendrive from its manufactures name, and create a
symlink (or actual device) called /dev/flash. Mount that in /etc/fstab
[Sorry about mail wordwrap in the stuff below - you need to un wordwrap it in
the real file]
I have a file in /etc/udev/rules.d called 01akcspecialrules that is shown
below. I am not doing the same thing, but you would use a similar thing to
my first two devices, except something like this (where the jumpdrive is not
partitioned and the other device is)
# Portable Flash Storage
BUS=="usb", SYSFS{product}=="JUMPDRIVE ELITE", KERNEL=="sd*", NAME="flash"
SYMLINK="jumpdrive flash"
BUS=="usb", SYSFS{product}=="USB DISK 2.0", KERNEL=="sd?1", NAME="flash"
SYMLINK="integral_storage flash"
# use this line to get rid of the /dev/sda type entry for the partitioned
device
BUS=="usb", SYSFS{product}=="USB DISK 2.0", KERNEL=="sd*", NAME=""
SYMLINK="integral_storage flash"
in order to find the right {product} etc lines you need to checkout udevinfo
something like
udevinfo -a -p /block/sdc/sda1
============================ (my 01akcspecialrules )
# Portable Flash Storage
BUS=="usb", SYSFS{product}=="JUMPDRIVE ELITE", KERNEL=="sd?1",
SYMLINK="jumpdrive flash"
BUS=="usb", SYSFS{product}=="USB DISK 2.0", KERNEL=="sd?1",
SYMLINK="integral_storage flash"
# IRiver T30
BUS=="usb" SYSFS{product}=="t30", KERNEL=="sd?1", NAME="iriver_t30",
SYMLINK="audioplayer", GROUP="audio"
# Digital Camera (either the C745UZ or the C220Z)
BUS=="usb", SYSFS{product}=="C220Z", KERNEL=="sd?1", NAME="olympus_c220z" ,
SYMLINK="camera"
BUS=="usb", SYSFS{product}=="C740UZ", KERNEL=="sd?1", NAME="olympus_c745uz",
SYMLINK="camera"
--
Alan Chandler
http://www.chandlerfamily.org.uk
Reply to: