Title: Dimke USB FDD support
Picture: Dimke USB FDD support
Explanation: Dimke USB FDD support shows how to integrate USB media into a Linux file system using UDEV device management.
It is also a good example how to write own installation scripts for supporting other USB devices by simply adapting the provided script.
How it works: First to mention: When a USB device like a memory stick, external harddisk, cdrom / dvd drive, or a floppy disk drive is connected to a Linux machine, then it has to be recognized by the (onboard or card) USB controller, and finally the so called Universal DEVice-manager "UDEV" is being triggered to create a "device node" in the /dev directory, representing the connected device.
This operation can be done "on the fly", which is widely known as "hotpluggable".

After that, this device node can be mounted to any place in the filesystem, making the connected device accessible.
For instance, when the USB FDD device is the first device which is plugged in then the harddisk will be /dev/sda (and /dev/sda1..15 are the possible partitions), and the USB device will be /dev/sdb. So, /dev/sdb can be mounted to /media/floppy for instance, and the files on the floppy diskette will be visible at location /media/floppy.
Well, this works fine as long as there is no other device like USB memory stick, or, as long as you plug in FDD first, and after that you plug in the other devices. If you don't, then, for instance, your memory stick will be represented by /dev/sdb (with all partitions), and as a consequence your floppy drive will be seen as /dev/sdc.
Well, when mounting these devices by hand, this will not be a big problem, but as soon as you try to make things easier by setting up a mounting command in the /etc/fstab, you will run into trouble, especially if you need a solution for less skilled users.
The solution to this problem will be to tell UDEV to always create the same, well known device file when a certain USB drive is found and mount it to a predefined place.
And this is what we do here.

The first step to get your new USB device to be suported is to open a shell and watch your syslog messages in real time:

tail -f /var/log/messages

as root, and then plug in your device. You will see a line like

New USB device found, idVendor=03ee, idProduct=6901

This example is taken from a Delock (Mitsumi) USB FDD drive, and these two values for idVendor and idProduct are assigned to variables in the script. So it will be very easy to adapt the script to support any available drive like HP, IBM, TEAC or any other you may have, by simply modifying these values.

The next step is to create the corresponding UDEV rule and write it to the right place in the file system. In the example it creates the two lines

# udev rule for delock usb fdd
SUBSYSTEM=="block", SYSFS{idProduct}=="6901", SYSFS{idVendor}=="03ee", NAME="usbfdd"


and stores it as a new rule in: /etc/udev/rules.d/88-usb_fdd.rules

This tells UDEV to do the following:
  • Wait for a device with idVendor="03ee" and idProduct="6901"

  • then create a block device in the /dev directory with name usbfdd

So, we always know under which device name we can access this device, and by setting up a simple mounting command for the /etc/fstab we can force the mount command to make our floppy disks' data always available at the same location:

# Entry for usb fdd:
/dev/usbfdd /media/usbfdd auto umask=0,users,iocharset=utf8 0 0
How to use: First, get the tgz archive and unpack it to any temporary directory you want, like /tmp, then execute the su command to become root and start the executable.
Then just follow the instructions provided by the script.
That's all.
Download installation script: usbfinst.tgz
[Developer Root] [Main Page]