Adding USB mass storage devices in Fedora Core
|
|
Out of date |
|
This page discusses the method used in Fedora Core 1 and 2, but
does not cover Fedora Core 3 (HAL/udev).
|
|
|
|
USB mass storage devices |
|
Many USB devices, from digital cameras to disk-on-key units,
provide "mass storage" capabilities, which allow you to use them
just like a filesystem on a hard disk. To access the files on one
of these:
- plug it into the computer
- wait a second or two
- right-click on the desktop background in GNOME
- select the device in the "Disks" menu -- an icon should appear
on the desktop
- double-click on the new icon
Once you have finished using the device, make sure to right-click
on the icon and select "Unmount Volume".
|
|
|
|
..but that didn't work! |
|
If the above did not work, it will be for one of two reasons.
Either the device does not advertise itself as being in the USB
mass storage class of devices, or the USB model description it
provided did not give enough of a clue about how to access it.
First, an explanation of how it is intended to work. The method
used to make these devices visible to the user is as follows:
- the USB device is plugged in
- the kernel calls hotplug
- hotplug checks /etc/hotplug/usb.distmap to see
whether it needs to load a special driver (if, for example, the
class of the device is not "mass storage" but it provides mass
storage capabilities, hotplug needs to know about the device
specifically)
- hotplug calls updfstab (part of the kudzu package)
- updfstab will check the name of the device (its USB
description field) against the
/etc/updfstab.conf.default file and will create an entry
for the device in the /etc/fstab partition table, if it
finds a match
- the user can now mount the device by right-clicking on the
desktop and choosing "Disks" in the GNOME desktop
So, if it did not work as intended, there are two steps to
suspect: the hotplug step, and the upfstab step. Here is how to
diagnose the problem, and let the right people know how to fix
it:
- Remove the usb-storage modules:
rmmod usb-storage
- Plug your device in and check whether usb-storage is loaded
automatically:
dmesg
lsmod
- If the usb-storage driver didn't load automatically, you'll
need to modify /etc/hotplug/usb.distmap. The lines are
very long, and it would be a good idea to copy an existing line
and then edit that. The first field is the name of the driver to
be loaded (usb-storage in our case), and the rest you can get
from the output of lsusb. This takes some working out -- refer
to the first line of usb.distmap to see what each field
represents:
# usb module match_flags idVendor idProduct \
bcdDevice_lo bcdDevice_hi bDeviceClass bDeviceSubClass \
bDeviceProtocol bInterfaceClass bInterfaceSubClass \
bInterfaceProtocol driver_info
Once /etc/hotplug/usb.distmap is modified, unplug the
device, and repeat from step 1. File a bug against hotplug in Bugzilla to add
this entry, and remember to include the entire line that you
added to the usb.distmap file.
- Hopefully, the usb-storage loaded successfully in the
previous step. Now launch "updfstab -t" as root, and it should
show you the contents of /etc/fstab with a new entry
added for your device. If it says:
(nothing to do)
you will need to teach updfstab about your device. The USB
description that the device provided did not match anything that
upfstab knows about. To do this:
- Launch kudzu, so it updates /etc/sysconfig/hwconf:
service kudzu start
- Find the name of the device in
/etc/sysconfig/hwconf. You are looking for an entry
for the "HD" class, not the "USB" class. Here is an example,
with the important line emphasised:
class: HD
bus: USB
detached: 0
driver: usb-storage
desc: "Hewlett-Packard PSC 2200 Series"
usbclass: 8
usbsubclass: 6
usbprotocol: 50
usbbus: 1
usblevel: 1
usbport: 1
usbdev: 15
vendorId: 03f0
deviceId: 2911
usbmfr: Hewlett-Packard
usbprod: PSC 2200 Series
- In /etc/updfstab.conf.default, add a match for the
device now that you know the name. See the updfstab man page
for the details about how to do this. In the above example, I
added the line:
match hd PSC
to the "device camera" section of
/etc/updfstab.conf.default, "PSC" being part of the
"desc:" line in hwconf and knowing that
printer/scanner/copier devices providing USB mass storage
facilities are likely to be CF card readers. This means that
the mount point /mnt/camera will be created and will
refer to that class of devices.
- Go back to step 4 once you're done.
- File a
bug against kudzu if you needed to add an entry.
|
|
|
|
Small print |
|
Last updated: 16th Aug 2004
Many thanks to Bastien Nocera for providing insight into how
this all works.
Tim Waugh <tim@cyberelk.net>
|
|
|
|