Re: Automatically mounting USB storage devices under their correct mount points



Ignoramus23760 staggered into the Black Sun and said:
On 2008-05-02, K. Jennings wrote:
I have two USB sticks and two USB hard drives connected. How can
things be configured so that each of those drives gets mounted under
its correct mount point at boot time?

In general, if something can be unplugged easily, you shouldn't mount it
at boot time. If these things are going to stay attached to one machine
permanently, why didn't you use faster and cheaper SATA disks? Or is
this an ad hoc solution?

Let's say that your stick's partition shows as
/dev/disk/by-id/usb-USB_USB_2.0_Flash_13DFA16D-0:0-part1
Then you can add a line to /etc/fstab like this:
/dev/disk/by-id/usb-USB_USB_2.0_Flash_13DFA16D-0:0-part1 /mnt/4gb \
auto noauto,user 0 0

This is overly verbose. Use e2label and whatever labeling conventions
that JFS uses (jfstune?) to give each filesystem a unique label. That
reduces the fstab line to:

LABEL=label1 /mnt/label1 auto noatime 0 0

....which is easier to deal with.

and then it will be automounted the next time you insert the thumb
drive.

No, it won't, not unless you're running an automounter. The "noauto"
option you wrote in your fourth fstab field also makes it so that device
will not be mounted automatically at boot time.

If I understand it correctly, the actual SCSI device associated to
each piece of hardware will be selected at boot time, but I do not
understand how that is done, or whether one has any control over it.

First SCSI disk detected = /dev/sda. Second = /dev/sdb. Detection
order is at least partially controlled by the BIOS if you have a Real
SCSI controller. USB devices usually have higher letters than SCSI or
SATA devices, unless the machine boots from a USB device. This is why
many people use labels and/or the LV names that LVM provides.

--
Really, I'm not out to destroy Microsoft. That will just be a
completely unintentional side effect. --Linus Torvalds
My blog and resume: http://crow202.dyndns.org:8080/wordpress/
Matt G|There is no Darkness in Eternity/But only Light too dim for us to see
.



Relevant Pages

  • Problem booting 2 USB devices
    ... When I have two USB devices plugged in at boot time (say a USB keyboard and a ... Mass Storage Device), only one will enumerate. ... It doesn't seem to matter which USB devices are used - I get the same ...
    (microsoft.public.windowsce.platbuilder)
  • Re: spca5xx driver problem
    ... Do you have other USB devices plugged ... Good questions Patrick. ... I've had problems in the past like this if I had a USB flash card ... boot time but no problem if the flash card media was not in the device. ...
    (Fedora)
  • USB devices not detected unless plugged in at boot
    ... On my Lenny system, USB devices are only ... If plugged in after boot time, or removed and replugged, ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ...
    (Debian-User)
  • RE: A SCSI problem
    ... I seemingly am unable to make this work at boot time. ... I believe I followed Alexanders instructions correctly, ... I cannot mount the drives after I do a manual modprobe aix*. ... Alexander Dalloz | Enger, Germany ...
    (Fedora)
  • Re: mpt problems. (Re: Dell hardware raid 0 (sas5ir) or gmirror?)
    ... The error messages from mpt are attached in the file called 'messages'. ... The kernel probe boot time log is attached as dmesg.log. ... at boot time both drives report that they have 255 tag ... drives to anything 120 or above the drive controller complains under ...
    (freebsd-stable)