ZIP drives under Linux

Well, you could go read the ZIP-drive mini HOWTO, but most of it deals with parallel port zip drives. I had some interesting experiences with SCSI and ATAPI ZIP drives that aren't covered there, so this may be of use to others.

ZIP drives come in many flavors. My experiences are only with the ZIP-100 in SCSI and ATAPI, so you will have to extrapolate from there to whatever you have (In particular, I have no experience with the newer ZIP-250 units). If you have a parallel port zip drive you should read the stock HOWTO.

What I discovered right off was that I could not read a disk that I wrote on one unit on the other and vice versa. To make a long story short, what happens is that the ATAPI model "hides" the first 32 sectors of the disk. The ATAPI model is supposed to have a jumper (and indeed mine does) called "Drive-A" versus "Not Drive-A", but in my case the presence or absence of the jumper did not change a thing. It may be that when my system BIOS probes the ATAPI bus, it is configuring the drive in some way (Perhaps this sounds unlikely, but this kind of behaviour has been confirmed for ASUS motherboards, and is mentioned on the ASUS web site ... my board is an EPOX, but they may use the same BIOS vendor).

My workaround is to set up a dummy partition at the front of the drive that allows either system to find partition 2 in the same way. This involves putting two copies of the MBR on the disks so that either system finds a sensible partition table where it thinks it should. Take a look at the following script which I run on my SCSI system (that can see the whole disk), to set up new ZIP disks for use under this scheme:

#!/bin/sh
# mkzip
# script to set up a ZIP100 disk for use between
# two systems, one of which hides the first 32 sectors
# on the disk.  (This should be run on the system that
# does NOT hide the first 32 sectors).

# Add the following line to the /etc/fstab (change the device as needed)
# (and mkdir /mnt/zip)
#/dev/sdd2               /mnt/zip                ext2    noauto,user     0 0

device=/dev/sdd
filesys=${device}2

dd if=/dev/zero of=$device count=64

sfdisk --force -L $device << EOF
unit: sectors

part1 : start=        1, size=      31, Id=83
part2 : start=       32, size=  196544, Id=83
part3 : start=        0, size=       0, Id= 0
part4 : start=        0, size=       0, Id= 0
EOF

rm -f /tmp/zipmbr
dd if=$device of=/tmp/zipmbr count=1
dd if=/tmp/zipmbr of=$device seek=32 count=1
rm -f /tmp/zipmbr

sfdisk --force -L $device << EOF
unit: sectors

part1 : start=        1, size=      63, Id=83
part2 : start=       64, size=  196544, Id=83
part3 : start=        0, size=       0, Id= 0
part4 : start=        0, size=       0, Id= 0
EOF

mke2fs $filesys

# THE END

Hey, it works for me and I don't mind loosing 64 sectors (32k) at the start of a 100M disk. Notice that I run this script on the system that can see the whole disk and first generate an MBR that will work on the system that hides the start of the disk, then use dd to move that where it belongs. Finally I generate the MBR for the system that can see the whole disk and then put an ext2 filesystem on the second partition which both machines will then be able to find.


Have any comments? Questions? Drop me a line!

Adventures in Computing / ttrebisky@as.arizona.edu