USB Hard Drive issues

Ken Moffat ken at linuxfromscratch.org
Tue Jan 6 05:59:16 PST 2009


On Tue, Jan 06, 2009 at 06:59:01AM -0600, Randy McMurchy wrote:
> Jack Stone wrote:
> 
> > As the udev_retry script is after the mountfs script I tried adding an 
> > extra_mount script after udev_retry which does a "mount -a".
> 
> The 'mount -a' command will only mount those filesystems
> identified in /etc/fstab. And typically you would not put
> a USB device in /etc/fstab. Have you identified the USB
> drive in that file? If so, how do you ensure that the drive
> always has the same device filename every time?
> 
> Admittedly, I do not have a lot of experience mounting
> a removable device at boot time, so this message may not
> be of much help.
> 
 Perhaps slightly OT to the problem, but to explain how to reference
usb devices in fstab:

 I don't mount removable usb devices at boot time, but reliable
access to them is one of the reasons for udev.  For example, to
mount a *particular* usb stick I used to have a rule

BUS=="usb", SYSFS{serial}=="07450D1404ED", KERNEL=="sd?1", NAME="%k"
SYMLINK="stick", MODE="0660", GROUP="goodusers", OPTIONS="last_rule"

(all on one line) which creates a /dev/stick symlink, so fstab can
have

/dev/stick  /media/stick  vfat     noauto,user,rw    0    0

 There are loads of other ways of configuring this in sysfs, e.g. by
SYSFS{manufacturer} - convenient if you have e.g. more than one
camera from the same manufacturer, but you cannot plug in more than
one at a time and expect it to work.

 I now have everal usb sticks - this gets slightly more interesting,
some think they are "USB Flash Memory" and others think they are
"DISK 2.0" so I have two rules, both create /dev/stick.  Again, I
have the limitation that i can only attach one stick at a time.

 I used 'udevinfo -q path -n /dev/sdX' last time I needed to read the
information.  I suppose it is now 'udevadm info -q path -n /dev/sdX'.

ĸen
-- 
das eine Mal als Tragödie, das andere Mal als Farce



More information about the lfs-support mailing list