Magicstor Microdrive and Linux
A microdrive
is a hard drive of a Compact Flash size and similar use:
digital photography, handheld PCs, PDAs, etc.
The Magicstor 2 GB Microdrive is a CF+ Type II device. That means it can be used in the CF+ Type II slot with an ejection mechanism or you can use an adapter plugged into USB port or PCMCIA slot. I have tested the microdrive with both adapter types on 2.4.25 kernel.
USB Adapter
The USB adapter that came with the drive is USB 2.0 capable
and therefore you should load the ehci-hcd module
first. Make sure that SCSI drivers are compiled in the kernel
or as modules. In my case, I loaded the following modules:
modprobe ehci-hcdmodprobe sd_modmodprobe usb-storage
The log shows following information when the microdrive is connected to the USB port:
Jun 10 20:25:35 lepjmlap kernel: hub.c: new USB device
00:1d.7-1, assigned address 3
Jun 10 20:25:35 lepjmlap kernel: scsi1 : SCSI emulation for
USB Mass Storage devices
Jun 10 20:25:35 lepjmlap kernel: Vendor: USB Model: Storage
Device Rev: 2.00
Jun 10 20:25:35 lepjmlap kernel: Type: Direct-Access ANSI
SCSI revision:02
Jun 10 20:25:35 lepjmlap kernel: Attached scsi removable disk
sdb at scsi1, channel 0, id 0, lun 0
Jun 10 20:25:36 lepjmlap kernel: SCSI device sdb: 4161315
512-byte hdwr sectors (2131 MB)
Jun 10 20:25:36 lepjmlap kernel: sdb: Write Protect is
off
Jun 10 20:25:37 lepjmlap kernel:
/dev/scsi/host1/bus0/target0/lun0: p1
Now the microdrive can be mounted as /dev/sdb
or /devices/scsi/host1/bus0/target0/lun0/p1. For
example:
mount -t vfat /dev/sdb /mnt
The hdparm utility can estimate a realistic
access speed to a drive (see the manpage for details). When
using USB 2.0, the speed is approximately 2.60 MB/sec in
contrast to sluggish 600 kB/sec when connected to USB 1.0 (your
numbers may vary of course).
PCMCIA Adapter
The Magicstor microdrive fits the PCMCIA adapter sold with the IBM microdrive . However, the Magicstor microdrive in the PCMCIA adapter causes my laptop to freeze for a while (about a minute) on insert. The log shows:
Jun 10 22:17:33 lepjmlap kernel: hdg: GS-Magicstor
1022C 10140116, CFA DISK drive
Jun 10 22:17:33 lepjmlap kernel: hdh: no response (status =
0xff), resetting drive
Jun 10 22:17:33 lepjmlap kernel: hdh: no response (status =
0xff)
Jun 10 22:17:33 lepjmlap kernel: ide3 at 0x100-0x107,0x10e on
irq 10
Jun 10 22:17:33 lepjmlap kernel: hdg: attached ide-disk
driver.
Jun 10 22:17:33 lepjmlap kernel: hdg: status timeout:
status=0xd0 { Busy }
Jun 10 22:17:33 lepjmlap kernel:
Jun 10 22:17:33 lepjmlap kernel: hdg: drive not ready for
command
Jun 10 22:17:33 lepjmlap kernel: hdg: 4161315 sectors (2131
MB) w/128KiB Cache, CHS=4128/16/63
Jun 10 22:17:33 lepjmlap kernel:
/dev/ide/host3/bus0/target0/lun0:hdg: status timeout:
status=0xd0 { Busy }
Jun 10 22:17:33 lepjmlap kernel:
Jun 10 22:17:33 lepjmlap kernel: hdg: drive not ready for
command
Jun 10 22:17:33 lepjmlap kernel: ide3: reset: success
Jun 10 22:17:33 lepjmlap kernel: [PTBL] [259/255/63] p1
Jun 10 22:17:33 lepjmlap kernel: ide_cs: hdg: Vcc = 3.3, Vpp
= 0.0
In spite of the timeouts, the drive can be mounted as
/dev/hdg1 or
/devices/ide/host3/bus0/target0/lun0/part1. I can
transfer data to and from the microdrive but the log is full of
error messages:
Jun 10 22:29:23 lepjmlap kernel: hdg:
task_no_data_intr: status=0x51 { DriveReady SeekComplete
Error }
Jun 10 22:29:23 lepjmlap kernel: hdg: task_no_data_intr:
error=0x04 { DriveStatusError }
Jun 10 22:29:23 lepjmlap kernel: hdg: Write Cache FAILED
Flushing!
Jun 10 22:29:32 lepjmlap kernel: hdg: task_no_data_intr:
status=0x51 { DriveReady SeekComplete Error }
Jun 10 22:29:32 lepjmlap kernel: hdg: task_no_data_intr:
error=0x04 { DriveStatusError }
Jun 10 22:29:32 lepjmlap kernel: hdg: Write Cache FAILED
Flushing!
Jun 10 22:29:43 lepjmlap kernel:
/dev/ide/host3/bus0/target0/lun0: p1
Jun 10 22:30:38 lepjmlap kernel: hdg: status timeout:
status=0xd0 { Busy }
Jun 10 22:30:38 lepjmlap kernel:
Jun 10 22:30:38 lepjmlap kernel: hdg: no DRQ after issuing
WRITE
Jun 10 22:30:38 lepjmlap kernel: ide3: reset:
success
In spite of the error messages, the written and read data appear to be correct. However, I am not going to use the PCMCIA adapter anyway because the drives connected to PCMCIA slots can transfer only 1 MB/sec of data.