Re: [Linux-NTFS-Dev] Geometry determination

From: Patrick J. LoPresti
Date: Thu Apr 01 2004 - 18:08:46 EST


Andries Brouwer <Andries.Brouwer@xxxxxx> writes:

> What I also claim is that Linux has no way of knowing what geometry
> other operating systems will assign to a disk. Different operating
> systems invent different translations.

The only one that matters is the one Windows expects. Which is the
same as what DOS uses. Which is the geometry from the "legacy INT13"
BIOS interface.

> Moreover, there is the matter of the correspondence of BIOS disk
> numbers and Linux disk names. Especially when both IDE and SCSI
> disks are present, and when more than two disks are present, it may
> be impossible to get this correspondence right. Details depend on
> the type of BIOS.

True, multiple disks pose a problem. But for some applications (e.g.,
mine), the only disk that matters is the boot device. And although it
is theoretically "impossible" to determine the Linux disk name for the
boot device, somehow this has not prevented millions of installations
of Linux boot loaders.

The vast majority of systems do not have very many drives. So it is
possible to take a pretty good guess about how they are named.

Also, a fully modern EDD BIOS *will* let you perform this mapping
reliably by giving you PCI bus and device numbers. The EDD module
exposes this information, provided your BIOS makes it available...
Unfortunately, few do (yet).

> However, there is really no good reason why the kernel would try to
> guess at the geometry other systems like to see.

I agree that such guessing is better left to userspace. But I
disagree about applications using HDIO_GETGEO. By writing to
/proc/ide/hda/settings, I can alter the values returned by HDIO_GETGEO
for IDE devices. This is exactly what I want to do: Set the geometry
which ALL applications use.

For non-IDE devices, HDIO_GETGEO already returns useful geometry (in
my experience). So it is a perfectly fine way for applications to
determine the disk geometry.

> For the past years, the main thing the kernel did was inferring the
> desired geometry from the partition table. But fdisk or LILO or
> whatever can do that as well. So, really no kernel help is needed.

This is completely useless for my application, which is to install an
OS for the first time.

> (And, you say, what if I am partitioning an empty disk to be used by
> DOS/Windows? There my stock answer "look at the partition table"
> fails, but there is some EDD stuff that could be used instead. Of
> course one should always use the FDISK of some operating system to
> create partitions for that operating system.)

But I *am* partitioning an empty disk, and I want to use Linux (see
http://unattended.sourceforge.net/).

And I do. See:

http://www.ussg.iu.edu/hypermail/linux/kernel/0404.0/0269.html

Cheers!

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