Installing a USB card reader for Compact Flash on Linux

I managed to make an external reader for Compact Flash memory cards work with my Linux machine, but it required patching the kernel… Here is what I did.

Kernel configuration

In the kernel configuration, I enabled SCSI support [CONFIG_SCSI], including SCSI disk support [CONFIG_BLK_DEV_SD], and SCSI generic support [CONFIG_CHR_DEV_SG]. All of them are compiled as modules.

Also in the kernel configuration, I enabled USB support [CONFIG_USB], including preliminary USB device filesystem [CONFIG_USB_DEVICEFS], UHCI [CONFIG_USB_UHCI] and USB mass storage support [CONFIG_USB_STORAGE]. All were compiled as modules. It may be that you need the "alternative UHCI driver [CONFIG_USB_UHCI_ALT], if you have a different motherboard.

The 2.4.20 kernel doesn't have any built-in information about this card reader, and its signature needs to be added to the kernel source code. (Yes, you'll have to edit the kernel source!). I found the instructions on the Web. The following line must be added to the file drivers/usb/storage/unusual_devs.h in the kernel source (typically under /usr/src/linux):

UNUSUAL_DEV( 0x0aec,0x5010,0x0000,0x1a00,
       "Datafab", "DTACFSM-USB Card Reader/Writer",
       US_SC_SCSI, US_PR_BULK, NULL, US_FL_FIX_INQUIRY ),

The same instructions probably work for other 2.4.x kernels. The card reader is apparently sold under different names (and with different packaging?), but the above instructions should work for all devices that have vendor vendor 0AEC and prodid 5010.

Using the card reader

Linux presents the card reader as a SCSI device, so when the card reader is connected and a memory card inserted, there will be a SCSI device in /dev. It was my second SCSI device, so its name was /dev/sdb1 and to make it available I used

mount /dev/sdb1 /mnt

After which "ls /mnt" showed the contents. If it is the only SCSI device, the name should be /dev/sda1 instead.

In case of errors, the following might provide some useful information:

More info: Using a USB CF reader in Linux

Bert Bos
Created 23 April 2003