# devfs and zip drive entry

## Kibab

I can't seem to find my zip drive entry with devfs.  It's on the second controller as a slave so it's normally listed as /dev/hdd.  Then I usually use /dev/hdd4 to mount vfat partitions and /dev/hdd1 for linux native partitions.

However, I can't figure out where it should be.

```

$ dmesg | grep hd

Kernel command line: root=/dev/hdg2 acpi=no-idle devfs=mount

    ide0: BM-DMA at 0xc000-0xc007, BIOS settings: hda:DMA, hdb:pio

    ide1: BM-DMA at 0xc008-0xc00f, BIOS settings: hdc:DMA, hdd:pio

    ide2: BM-DMA at 0xdc00-0xdc07, BIOS settings: hde:pio, hdf:pio

    ide3: BM-DMA at 0xdc08-0xdc0f, BIOS settings: hdg:pio, hdh:pio

hda: CR-48X8TE, ATAPI CD/DVD-ROM drive

hdc: FX4830T, ATAPI CD/DVD-ROM drive

hdd: IOMEGA ZIP 100 ATAPI, ATAPI FLOPPY drive

hde: IC35L040AVER07-0, ATA DISK drive

hdg: IC35L040AVER07-0, ATA DISK drive

hde: 80418240 sectors (41174 MB) w/1916KiB Cache, CHS=79780/16/63, UDMA(100)

hdg: 80418240 sectors (41174 MB) w/1916KiB Cache, CHS=79780/16/63, UDMA(100)

hda: ATAPI 40X CD-ROM CD-R/RW drive, 8192kB Cache, DMA

hdc: ATAPI 48X CD-ROM drive, 128kB Cache, UDMA(33)

hdd: No disk in drive

hdd: 98304kB, 32/64/96 CHS, 4096 kBps, 512 sector size, 2941 rpm

```

It's recognized as hdd on bootup?

In /dev I have:

```

$ ls -l /dev/hd* | cut -c65-200

/dev/hda -> ide/host0/bus0/target0/lun0/cd

/dev/hdc -> ide/host0/bus1/target0/lun0/cd

/dev/hde -> ide/host2/bus0/target0/lun0/disc

/dev/hde1 -> ide/host2/bus0/target0/lun0/part1

/dev/hde2 -> ide/host2/bus0/target0/lun0/part2

/dev/hde5 -> ide/host2/bus0/target0/lun0/part5

/dev/hde6 -> ide/host2/bus0/target0/lun0/part6

/dev/hde7 -> ide/host2/bus0/target0/lun0/part7

/dev/hde8 -> ide/host2/bus0/target0/lun0/part8

/dev/hde9 -> ide/host2/bus0/target0/lun0/part9

/dev/hdg -> ide/host2/bus1/target0/lun0/disc

/dev/hdg1 -> ide/host2/bus1/target0/lun0/part1

/dev/hdg2 -> ide/host2/bus1/target0/lun0/part2

/dev/hdg4 -> ide/host2/bus1/target0/lun0/part4

/dev/hdg5 -> ide/host2/bus1/target0/lun0/part5

/dev/hdg6 -> ide/host2/bus1/target0/lun0/part6

/dev/hdg7 -> ide/host2/bus1/target0/lun0/part7

/dev/hdg8 -> ide/host2/bus1/target0/lun0/part8

/dev/hdg9 -> ide/host2/bus1/target0/lun0/part9

```

Judging by the looks of things, I would guess that it would be at: ide/host0/bus1/target1/lun0/{something} but there are no entries at this point.

Any ideas?  Anyone else have a zip drive that they can access?

Thanks.

--Kibab

----------

## MBCook

That's what it's going to say because there are no partitions there. What happens when you stick a disk in the drive? Do partitions appear under that dev directory? If that didn't work, I would try booting with a disk in the drive just to see if it gets recignised with partitons that way.

----------

## Kibab

Well, assuming I know where the zip drive is going to show up, /dev/ide/host0/bus1/target1/lun0/*, then nothing shows up when I insert a zipdisk.

I presume it will show up when I boot with a zipdisk in the drive and will try it this afternoon to see for sure.

--Kibab

----------

## TomorrowPlusX

I can't remember which thread I read this on, but it seems the atapi  floppy drivers haven't been made devfs friendly yet. 

I could be wrong, and would happily be wrong -- because my thinkpad's beautiful superdrive zip 250 (which works fine under normal dev setups) is collecting dust :(

----------

## Kibab

Hmm.... that's strange if it is the case.  It is almost no more work to make a driver use devfs versus to not use devfs.  Generally you just call devfs_register_{blk,chr}dev(...) instead of register_{blk,chr}dev(...).  Although, it might be a little more difficult because of the removable aspect.

Anyone else have any thoughts?

--Kibab

----------

## MBCook

I'll check into that, but in the mean time, if you tell the kernel to use the ide-scsi driver for that drive (let's say it's hdd, then at bootup add "hdd=ide-scsi" to the kernel parameters) and it should work.

----------

## MBCook

You're right, it's not dev-fs aware. Looks like I found me a kernel project.

----------

## MBCook

You're right, it's not dev-fs aware. Looks like I found me a kernel project.

----------

## Kibab

I'll try it as a scsi-drive.  That will be an easy workaround if that is the case.

If you are going to work on the zip driver as a kernel project, let me know how it goes or if you need a hand.  I would do it myself if I weren't already busy with many other projects.

--Kibab

----------

## Kibab

Oh... I almost forgot, I have a friend who uses devfs with his zip drive with the ide drivers and it works fine.  His drive shows up as hdf4.  He is using a Redhat/Mandrake kernel, I don't remember which, so it may have been patched with something to provide that support, but I do know that it's possible.  Anyone else have their zip drive working under devfs?

--Kibab

----------

## MBCook

God i'm an idiot. I've been looking at the code. the ide-floppy doesn't ever touch devfs, because the main ide driver does this for it. This means that it IS devfs aware. So much for a kernel project  :Wink: . It should work, I'll go test mine. BTW, all zip disks (that aren't formatted differently by users) store data on partition 4, because that's the default partition number for macs for some odd reason. BRB, running downstairs to check things.

-- RUNS --

-- LOOKS --

-- TESTS --

-- RUNS --

Well, while I know the kernel knows it's there, it doesn't appear in /dev. Oh well. Sorry 'bout the double post too. Did you every try booting with a disk in the drive?

----------

## MBCook

I'm an idiot and should stop posting.

Now that that's out of the way, check it out. I went googling for the ide-floppy guy and found his page on it. It says that DevFS support isn't there because it will require touching some kernel subsystems. But if you want to give it a try, there are two patches you must apply (in order):

The first

And the second

His page says that they apply succesfully to .14 and .16, but doesn't say anything about anything newer. I guess you'll have to use scsi emulation (ide-scsi). Oh well.

----------

## smtanner

I got my zip drive working by using scsi emulation.  When I insert a zip disk, /dev/scsi/host0/bus0/target0/lun0/part4 magically appears.  Use this device in fstab and everything works.  The link /dev/sda4 which should point to the above part4 is not created unless I have the zip disk in during boot but it is not needed anyway.

----------

## wilbertnl

I added the following lines to my /etc/devfs.conf.

# Create /dev/discs/hde

LOOKUP          ^hde$           CFUNCTION GLOBAL mksymlink discs/disc1/disc hde

REGISTER        ^ide/host2/bus0/target0/lun0/zip$ CFUNCTION GLOBAL mksymlink $devname hde

UNREGISTER      ^ide/host2/bus0/target0/lun0/zip$ CFUNCTION GLOBAL unlink $devname hde

# Create /dev/discs/hde1

LOOKUP          ^hde1$           CFUNCTION GLOBAL mksymlink ide/host2/bus0/target0/lun0/part1 hde1

REGISTER        ^ide/host2/bus0/target0/lun0/part1$ CFUNCTION GLOBAL mksymlink $devname hde1

UNREGISTER      ^ide/host2/bus0/target0/lun0/part1$ CFUNCTION GLOBAL unlink $devname hde1

# Create /dev/discs/hde4

LOOKUP          ^hde4$           CFUNCTION GLOBAL mksymlink ide/host2/bus0/target0/lun0/part4 hde4

REGISTER        ^ide/host2/bus0/target0/lun0/part4$ CFUNCTION GLOBAL mksymlink $devname hde4

UNREGISTER      ^ide/host2/bus0/target0/lun0/part4$ CFUNCTION GLOBAL unlink $devname hde4

----------

