The pains of modern disk storage
I spent today building some of the infrastructure that will hopefully let us safely Kickstart-install Fedora Core 4 on the new generation of SATA-based PC workstations. (Safely, because destroying a server by accidentally starting a Kickstart install on it is one of my quiet nightmares.)
What makes this difficult is a a simple decision, by itself sane and rational: the Linux kernel people decided that rather than making up a new set of block devices for things like USB memory sticks or SATA disks, they would just reuse the SCSI system. (This is helped along by the fact that pretty much every new disk interface uses some subset of the SCSI command set.)
This means that if you have a /dev/sda
on a modern Linux system, you
don't know very much about what it is. It might be a real SCSI disk
on a server; it might be a SATA disk on a workstation; it might even
be the USB memory stick you just booted a new computer from. (USB
memory sticks look like hard drives to the PC, which has other
interesting consequences.)
Enter Fedora Core 4's buggy Anaconda (still not fixed, not that I'm bitter or anything). The 'cannot repartition drives' bug means that we need to manually destroy the partition table on the install disk. Which means that we need to work out what the install disk is.
Our old workstations were pure IDE systems, so the answer was simple:
/dev/hda
, if it existed. If it didn't exist, we didn't want to go on
anyways. On a SATA-based system, the main drive will be /dev/sda
when the system finishes installing, but might not be during an
install from a USB memory stick. And our servers have /dev/sda
drives that we definitely don't want to wipe out.
Today I built a program that works out what kernel module is responsible
for which 'SCSI' disk, if any of them exist (using Linux's sysfs
filesystem, which exports a bunch of kernel information). The next step
is to make our Kickstart system not touch a /dev/sda
that is owned by
aic7xxx
(real SCSI on servers) or usb-storage
(USB memory drives),
but be willing to zap others.
(Unfortunately, as far as I know there is no way to tell that a particular device has the generic property 'SATA device'. If there was, it would simplify life.)
|
|