Re: IDE hot-swap kernel support

From: Seth M LaForge (sethml@ofb.net)
Date: Sun Jul 02 2000 - 01:43:18 EST


Andrzej Krzysztofowicz:
> > It seems to me that what I need is a way to stimulate the ide driver
> > to reprobe for a drives on an ide bus. From looking at
> > linux/drivers/ide-probe.c, I don't see any way to manually trigger a
> > probe. Perhaps one should be added - 'echo 1 > /proc/ide/ide1/reprobe'?
> > Or even 'echo slave > /proc/ide/ide1/reprobe'?
>
> There's an ioctl() already in ide.c - HDIO_SCAN_HWIF.

Yeah, I'd noticed, and it seems to do the right thing for me under 2.2
kernels, although the under the uniform IDE patches the system oopses
if I invoke the ioctl. However, the ioctl only helps if the drive
you're probing for is the only drive on that IDE bus. On the system I
want to put this hot-swap bay on, I can't devote an entire IDE channel
to it.

Also, the ioctl is incredibly klugy. First off, you have to invoke it
on an IDE device, but the device you're invoking on it is completely
irrelevant. What if you have no IDE devices set up and you want to
probe to find one? You can't open a device to invoke the ioctl. Also
the logic of the ioctl parameters is pretty twisted. From what I can
tell from the source, given ioctl(fd, HDIO_SCAN_HWIF, &(data_port,
ctl_port, irq)), if an interface with io port data_port is found, it
is rescanned otherwise the first unused interface is rescanned. After
rescanning, the interface is given ctl_port if nonzero, and is always
given irq. That's just really gross. In order to rescan an interface
you must know it's data port and irq?

I propose one or both of the following:
  - Add entries to /proc for rescanning. Perhaps as I said earlier,
    'echo 1 > /proc/ide/ide1/reprobe' or 'echo master >
    /proc/ide/ide1/reprobe' or 'echo slave > /proc/ide/ide1/reprobe'.
    Unfortunately this doesn't let systems without /proc rescan.
    Perhaps not an issue.
  - Allow opening of devices for IDE drives which don't exist. Add a
    HDIO_RESCAN_DRIVE ioctl, which scans for a drive at that location.
    All other ioctls would fail when there's no drive at that ioctl.

Andre Hedrick:
> If you want empty bays at boot, then there needs to be code that handles
> the exception. You yank a device out of some hosts and boot and the host
> is never loaded. You are now talking about a re-init process to
> wake-up and INT19 hook some the the add-on cards with BIOS to the
> Mainboard BIOS. That will get UGLY.

Huh? I don't understand what you're trying to say. What's a "host"?
An IDE interface? If you're talking about add-on IDE cards which
don't load their BIOS when they have no drives - well, that's not a
problem in 99% of cases (in most cases the drive will be on a
motherboard IDE interface, or there will be some other drive on the
same interface). In the cases in which it is a problem, well, it's
the add-on card manufacturer's fault, not Linux's. The problem will
occur under Windows too. It's no excuse for not making the typical
case work.

For motivation, let me explain why this is important. Cheap IDE hard
drives are now below $5 per gig (a Maxtor 61.4GB 5400 rpm drive can
be had for $299). Travan backup tape media costs $4.40 per gig. DLT
media costs $1.60-$3.20/gig, and the drives cost thousands of dollars.
Backing up to a hard drive is fast, and you can use simple tools like
cp. Backing up to a tape drive is much slower, and requires more
sophisticated tools. Restoring from a hard drive is, again, a simple
matter of using cp. Restoring from a tape drive often takes hours (if
the tape is not indexed and you have to search the entire tape for the
files you want).

So, it's really beginning to make sense to use cheap IDE hard drives
and a hot-swap bay for medium-scale backups. Drives are cheap enough
that you can buy half a dozen, and stick one in off-site storage every
month or so. And with hard drives you take advantage of the amazing
improvements in hard drive density and cost that keep taking place,
whereas with a tape drive you have to pay several thousand dollars now
for a tape drive which won't be any faster or bigger two years hence,
and you have to pay to buy/develop advanced backup software or limp
by with tar and dump.

Tape drive manufacturers are surely feeling really worried right now,
as they well should be. Linux has an opportunity to become the backup
server of choice, if it handles IDE hot-swap well.

Seth

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Jul 07 2000 - 21:00:10 EST