Quote:> I know that /dev/hda1 means "first" partition. The question is in what
> sense do you mean first? Let me give you an example. I have a hard drive
> (hdb) with the following layout:
> Linux Ext2, primary, /dev/hdb2
> HPFS, logical, /dev.hdb5
> FAT16, logical, /dev/hdb6
> FAT32, logical, /dev/hdb7
> Linux Ext2, logical (four of them), /dev/hdb8-11
> Linux Swap, logical, /dev/hdb12
> The extended partition itself is hdb1.
> When viewed through Partition Magic, /dev/hdb2 appears to be the first
> partition. It does occupy space at the beginning of the drive. So why
> isn't it /dev/hdb1 and the extended partition /dev/hdb2?
Because someone numbered it that way. Partitions /dev/hda[1-4] are set by a
number loaded into the partition table, not by the order of the drives. It's
actually possible to associate /dev/hda1 with, say, cylinders 100-200, and
/dev/hda4 with cylinders 1-99. I've seen it done, usually by Partition Magic
swapping partitions around or expanding them to fill an earlier space on the
disk without renumbering the partitions.
Quote:> After thinking about it, it appears to me that Windows, OS and OS/2
> assign drive letters based on their physical location on the drive while
> Linux assigns numbers based on the location of the partition's entry in
> the partition table with primary partitions getting numbers 1 through 4
> and logical partitions getting numbers 5 and up.
Oh. *Really*. Then why is the "A:" drive a floppy, "B:" drive the secondary
removable drive, whichever partition is marked as active and gets booted
with the "C:" drive, whichever partition is found next on the same drive the
"D:" drive, etc., etc.? DOS, the background OS for Microsoft's drive
handling decisions, makes things up to stack the drives the way Micro$oft
expects them.
Linux actually reads the partition table and associates partitions with the
first four partition numbers. It allows you to see a good bit more of the
internals, and control them more precisely.
Quote:>The order in the
> partition table is based on when the partition was created. (Does this
> depend on what partitioning tool you use? It appears to be true of
> Partition Magic.). For example, if I were to delete and recreate the
> HPFS partition, it would become /dev/hdb12 and partitions /dev/hdb6-12
> would move down one to /dev/hdb5-11 even though it was recreated in the
> same location. For another example, if there were free space between the
> HPFS partition and the FAT16 partition and I created a partition in that
> space, it would become /dev/hdb13 rather than /dev/hdb6.
It's not the tool, it's how you use it. If you create partitions 1 and 2,
delete 1, then expand 2 to fill the same space, it's still partition 2. PM
will allow you to create more primary partitions, but 2 will now be the
first partitions on the drive.
PM is the only tool I've used that allows this.
Quote:> The partitioning tools that I use (Partition Magic and Drive
> Image) allow you to control the physical location of partitions and thus
> you can control drive letter assignment by Windows, DOS and OS/2.
> However, there does not appear to be any way to directly control the
> numbers that would be assigned by Linux. Well, at least not with
> PowerQuest tools. Are there alternatives that can handle this kind of
> thing?
Nobody cares that much about drive numbers in the Linux world, except for
restrictive partitioning tools. It's just a number! It's where you mount the
partitions that is key to arranging things the way you want. Both PM and
Linux's parted and fdisk variants have the tools to shuffle directories,
copy them elsewhere, recreate them, delete them and give them new numbers.
So you can do this sort of thing with other tools, except that fdisk will
throw a hissy fit if you try to set one partition in front of another one on
the disk that already has a higher partition number.