Наши партнеры

Книги по Linux (с отзывами читателей)

Библиотека сайта rus-linux.net

Mass Storage Devices

The mass storage device driver can potentially be used with a wide a wide range of USB devices, not all of which would normally be considered to be mass storage. This is because the driver is really an interface between the USB stack and the SCSI layer. Despite this, the instructions in this section are oriented around devices like USB floppy drives, Zip drives, LS120 drives and USB CDROMs.

Since the mass storage driver presents the USB device as a SCSI device, you need to turn on SCSI support, which is under SCSI support in the configuration script.

You may find that you can only build this driver as a module. This is not abnormal, and is caused by the main kernel SCSI layer.

After you have compiled the kernel and rebooted (or added the relevant modules, which includes usb-storage in this case), you should check /proc/scsi/scsi. Information about your device should be listed. If it isn't, you will need to type the following, as root:
echo "scsi add-single-device 1 0 0 0" > /proc/scsi/scsi
You need to make an entry in /etc/fstab. A suitable entry for a floppy disk would be:
/dev/sda    /mnt/usbfd       auto            noauto,user 0   0
A suitable entry for a Zip disk would be:
/dev/sda4    /mnt/usbzip      vfat            noauto,user 0   0
A suitable entry for a CDROM disk would be:
/dev/scd0    /mnt/usbcdrom    iso9660         ro,noauto,user 0   0
A suitable entry for a hard disk with a single partition would be:
/dev/sda1    /mnt/usbhd       ext2            defaults   1   2

Note that the above entries assume you have no other SCSI devices. If you do have other devices, then the USB disk may not be /dev/sda, but could instead be /dev/sdb, /dev/sdc or some other device. You would then need to substitute the right device entry for /dev/sda or /dev/scd0 in the entries above.

Having created the entr[y/ies] in /etc/fstab, you need to create matching mount point[s] in the actual filesystem. So if you made an entry as shown above for the USB floppy disk, then the mount point would be made (as root) by:
mkdir /mnt/usbfd
You should now be able to mount your floppy disk with a command like:
mount /mnt/usbfd
or like:
mount /dev/sda