[Novalug] Device naming.

Bryan J Smith b.j.smith at ieee.org
Sun Mar 14 21:41:44 EDT 2010


On Sun, 2010-03-14 at 16:22 -0400, James Ewing Cottrell 3rd wrote:
> I agree, device names are basicly unpredictable. In fact, even Fixed 
> Device names are at risk. The recent usurping of the HD (IDE) disks into 
> the SD (SCSI) driver can cause some pains.
> For example, I have a computer with one PATA and one SATA disk. Older 
> systems call these HDA and SDA, and GRUB sees these as (hd0) and (hd1) 
> respectively. But one of my newer systems looks for the SATA drive 
> first, and calls SDB and SDA, rather than SDA and SDB.

If it's at boot time, that is your BIOS.  Your BIOS assigns disk 0x80
(GRUB hd0), disk 0x81 (GRUB hd1), etc...  Linux will order based on what
drivers load in what order.  If you pre-load a SCSI driver in your
initrd, then it will pre-empt any ATA driver.

In fact, one of the many reasons to the unified "every read/write device
is an sd* device" (and sr for read-only/optical) model was so one can
use the modprobe facilities to blacklist, scsi_hostadapter re-order,
etc... one ATA device without affecting the rest of the entire ATA
subsystem.

> And while I mount my disks by LABEL= (I think UUID= is fugly),

UUID might be fugly, but UUID guarantees uniqueness.  Try managing
petabytes of SAN without LABELs, let alone device names.  Furthermore,
users have proven themselves troublemakers, and will put more than one
disk in with more than one partition with the same LABEL.  Wouldn't
mention it if I hadn't seen it myself about ... oh ... 40 times.  ;)

> what was  previously HDA/(hd0) is now SDB/(hd1). Yeah, I could throw
> two map commands into grub, but I'd rather not.
> As for Peter's suggestion about udev, I would argue violently with the 
> word "clearly". Between HAL, UDEV, SYSFS, DEVFS, KUDZU et al (some of 
> these are obsolete), it's almost impossible to tell what is going on 
> anymore.

The idea is that you don't have to.  I've yet to have an issue myself in
many, many years.  But if you want to know, then writing udev rules is
very easy.

> Yeah, I know there are Too Many Devices, but how about dividing the 
> space into Important Devices That Most People Have and bless thoss names 
> and number assignments Forever, and Weird Stuff That We Support So We 
> Can Claim We Can Run Anything and Everything and let THAT stuff be 
> assigned dynamically?
> Make the Commonplace Easy, and the Random/Weird/Obscure stuff Hard.

I think always having the first disk as "sda" and the first optical as
"sr0" actually simplifies things.  That's exactly what the new solutions
do.  The installers and distros these days are pretty good.

I think it's more of an issue that people, people who were used to mix'n
and all the conflict resolution with the older system, don't want to
"learn the changes" -- even if they cause less conflicts.

In fact, the only people I hear complaining about this are the ones who
used to know how to hack "the old way."  Learn udev and you'll be better
off.  Trust me.  






More information about the Novalug mailing list