I have an MBR drive with a Windows XP installation on partition 2, which boots using a boot.ini entry that specifies patition(2). The partition table initially looks like this:
1. Windows recovery partition
2. Windows XP
3. Linux
4. Linux
I then remove partition #1 and replace it with an extended partition, which results in this table:
1. Extended partition
2. Windows XP
3. Linux
4. Linux
Now Windows XP won't boot, complaining of a missing hal.dll. The partition number in boot.ini hasn't changed, and the partition number in the MBR partition table hasn't changed. Nevertheless, when I change Windows XP's boot entry in boot.ini from partition(2) to partition(1) Windows XP starts with no problems again. I would like to know why, exactly.
I'm reading https://neosmart.net/wiki/rebuilding-boot-ini-file/ which has this to say about boot.ini partition numbering:
partition(y): The number of the partition on the drive rdisk(x). partition(y) starts counting from 1, so the first partition is partition(1), the second is partition(2), etc. partition(y) counts primary partitions first then counts logical partitions. The extended partition (the “container” for logical partitions) itself isn’t counted, though. These numbers are taken from the Partition Table in the Master Boot Record, which will generally be the order in which they were created, which will not necessarily be the same as the order in which they appear on the disk
Is this really true? Because from my perspective I seem to have changed the partition numbers simply by replacing partition entry 1 in the MBR.
For the record, parted tells me that the Windows XP partition is indeed number 2, and fdisk tells me it's /dev/sda2 (though I'm not entirely prepared to trust device numbering schemes to correspond exactly to MBR partition numbers). Even if the operation of removing and replacing partition 1 did result in rewriting the entire MBR partition table, surely this output should confirm that the Windows partition did in fact end up in the right place anyway?
Am I missing something in my understanding here?