Adding Storage via PCMCIAUSB

Adding Storage via PCMCIA/USB

Other methods of adding storage include USB, FireWire, and PCMCIA devices, and similar troubleshooting techniques are used for each. The unique aspect of PCMCIA storage is how the drivers are called with regard to sharing a single interrupt for multiple function devices. Among PCMCIA devices, the most common device type is a modem or Ethernet combo card (storage type PCMCIA cards are very rare). Note that combo cards share a single interrupt. In the following example, a single-function PCMCIA card illustrates the drivers that are loaded after the PCMCIA core finds the newly added device.

  1. Collect lsmod so that a pre-driver list can be collected.

  2. Insert PCMCIA storage device with IDE interface connecting a 5200-RPM laptop drive.

  3. Run lsmod so that a post-driver list can be collected.

  4. Run dmesg to view the actions taken by the kernel.

When you run dmesg, it reports:

cs: memory probe 0xa0000000-0xa0ffffff: excluding 0xa0000000-0xa01fffff Probing IDE interface ide2... hde: HITACHI_DK239A-65B, ATA DISK drive ide2 at 0x180-0x187,0x386 on irq 3 hde: max request size: 128KiB hde: 12594960 sectors (6448 MB) w/512KiB Cache, CHS=13328/15/63 hde: cache flushes not supported  hde: hde1 hde2 < hde5 hde6 > hde3 hde4 ide-cs: hde: Vcc = 5.0, Vpp = 0.0

The lsmod output reflects that the kernel module ide_cs was installed, which bound to modules ds, yenta_socket, and pcmcia_core.

This is what you see before the driver installation:

ds                      17796  6 yenta_socket            19840  0 pcmcia_core             66100  2 ds,yenta_socket

This is what you see after the driver installation:

ide_cs                   7556  1 ds                      17796  7 ide_cs yenta_socket            19840  1 pcmcia_core             66100  3 ide_cs,ds,yenta_socket

But how does the correct driver become installed? To answer this question, we look at the PCMCIA core definitions located in directory /etc/pcmcia/. In this directory, a configuration file exists called config.

Within this file, sections exist such as the following:

card "ATA/IDE Fixed Disk" function fixed_disk bind "ide-cs"

The sections define how the newly attached device should be handled with respect to the driver. Within this same directory, another file exists that allows certain parameters always to be in play when a newly added PCMCIA device is attached using only IDE. The file is called ide.opts and contains options such as the following:

#INFO="Sample IDE setup" #DO_FSTAB="y" ; DO_FSCK="y" ; DO_MOUNT="y" #FSTYPE="msdos" #OPTS="" #MOUNTPT="/mnt/ide"

Some of the ATA/IDE fixed-disk device parameters follow:

  • DO_FSTAB A boolean (y/n) setting that specifies whether an entry should be added to /etc/fstab for this device.

  • DO_FSCK A boolean (y/n) setting that specifies whether the filesystem should be checked before being mounted with fsck -Ta'.

  • DO_MOUNT A boolean (y/n) setting that specifies whether this device should be automatically mounted at card insertion time.

  • FSTYPE OPTS MOUNTPT The filesystem type mount options and mount point to be used for the fstab entry and/or mounting the device.

The following example of an ide.opts enTRy demonstrates the first partition of any ATA/IDE card with an XFS filesystem to be mounted on /mnt.

case "$ADDRESS" in *,*,*,1)     #INFO="Sample IDE setup"     DO_FSTAB="y" ; DO_FSCK="n" ; DO_MOUNT="y"     #FSTYPE="xfs"     #OPTS=""     #MOUNTPT="/mnt"     ;; *,*,*)     #PARTS="1"     # Card eject policy options     NO_CHECK=n     NO_FUSER=n     ;; esac

With any new Linux machine, adding PCMCIA storage is second nature; however; on the special occasion in which we find ourselves with an older IDE device and kernel, we must remember that spin-up times vary. Longer spin-up times can surpass the maximum allowed card setup time. A simple workaround for this feature, "a positive spin on a bad issue," was developed starting around release 3.0.6 of the ide_cs driver to automatically retry the device probe. This workaround provides any device with ample time to initialize. However, if you find yourself with an even older version of ide_cs, load the pcmcia_core module with the following:


For those who are trying to use a PCMCIA ATA/IDE CD-ROM device, your kernel must be compiled with CONFIG_BLK_DEV_IDECD enabled. Again, this is the default for almost all newer kernels; however, it is something to remember when developing a new custom kernel.

Linux Troubleshooting for System Administrators and Power Users
Real World Mac Maintenance and Backups
ISBN: 131855158
EAN: 2147483647
Year: 2004
Pages: 129
Authors: Joe Kissell

Similar book on Amazon © 2008-2017.
If you may any questions please contact us: