2007-02-19
Microsoft has released a KB article, 931854, that is a bit vague. Basically it states that XP deletes Vista created partitions due to a "1 meg boundary alignment" issue.
I'm going to clarify things a bit and put things in a different light. First of all, the title of the article is accurate although the details leave a bit to be desired. To quote what the article states:
There are several inaccuracies with the above. First, the issue only pertains to logical volumes. Primary partitions are unaffected. Second, and this is debatable, it's not a "1-megabyte" alignment issue per se but it appears so on the surface. Finally, the problem requires that specific things happen in a specific order before the problem occurs.
Let's back into a few things first. Quoting KB 140418 there is a "hidden sector" parameter in the partition table that is supposed to be:
Hidden Sectors: This is the number of sectors on the physical disk preceding the start of the volume. (that is, before the boot sector itself) It is used during the boot sequence in order to calculate the absolute offset to the root directory and data areas.
For primary partitions this is a valid statement. However for logical volumes in an extended partition this is not the case. At the beginning of each logical volume there is a partition table that is used to daisy chain the volumes. For logical volumes the actual start of the data is rounded up to the beginning of the next track. Until the spec changes that means 63 sectors. When looking at partition table entries created prior to Vista you see the following:
| MBR Partition Information (HD0 - 0x5AEE3DBE) | ||||||||||
| (CHS: 1023/254/63) | ||||||||||
| Start | End | |||||||||
| Act | Cyl | Head | Sect | Type | Cyl | Head | Sect | Hidden Sectors | Number of sectors | |
| 0: | 80 | 0 | 1 | 1 | 7 | 1023 | 254 | 63 | 63 | 33527592 |
| 1: | 0 | 1023 | 0 | 1 | 17 | 1023 | 254 | 63 | 33527655 | 33527655 |
| 2: | 0 | 1023 | 0 | 1 | f | 1023 | 254 | 63 | 67055310 | 58749705 |
| 3: | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
I'm going to gloss over a lot of detail at the moment. There's a ton of information with regard partition structures on the internet and I'm concentrating on what's happening with Vista.
Volume information.
Act | Cyl | Head | Sect | Type | Cyl | Head | Sect | Hidden Sectors | Number of sectors | |
0: | 0 | 1023 | 1 | 1 | 7 | 1023 | 254 | 63 | 63 | 8385867 |
1: | 0 | 1023 | 0 | 1 | 5 | 1023 | 254 | 63 | 8385930 | 8385930 |
2: | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 3: | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| ||||||||||
0: | 0 | 1023 | 1 | 1 | 7 | 1023 | 254 | 63 | 63 | 8385867 |
1: | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2: | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 3: | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Some things to note. The fields in the 3rd and 4th entry in the partition table of logical volumes is always 0. The first entry describes the current partition and with the exception of the last partition, the second entry points to the next volume in the chain. Note that this is relative to the start of the extended partition rather than the start of the drive. The value 63 in the hidden sector field simply causes the data to start at a track boundary. This is what the extended partition structure looks like with 2 4G logical volumes. XP disk manager displays the above as:
So what happens when Vista gets into the picture? First off, the issue mentioned in the KB article does not apply to primary partitions. Vista has changed nothing in that regard. The issue occurs only when dealing with logical volumes in extended partitions. In the above the Healthy (Unknown Partition) is actually Vista. I'm using 3rd party boot management to keep XP from playing games with Vista. But that's a different article.
After booting into Vista and adding 3 more 4G logical volumes the partition tables in the extended partition now look as follows:
| Act | Cyl | Head | Sect | Type | Cyl | Head | Sect | Hidden Sectors | Number of sectors | |
| 0: | 0 | 1023 | 1 | 1 | 7 | 1023 | 254 | 63 | 63 | 8385867 |
| 1: | 0 | 1023 | 0 | 1 | 5 | 1023 | 254 | 63 | 8385930 | 8385930 |
| 2: | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 3: | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0: | 0 | 1023 | 1 | 1 | 7 | 1023 | 254 | 63 | 63 | 8385867 |
| 1: | 0 | 1023 | 254 | 63 | 5 | 1023 | 254 | 63 | 16771860 | 8390174 |
| 2: | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 3: | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0: | 0 | 1023 | 254 | 63 | 7 | 1023 | 254 | 63 | 1566 | 8388608 |
| 1: | 0 | 1023 | 254 | 63 | 5 | 1023 | 254 | 63 | 25162034 | 8390656 |
| 2: | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 3: | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0: | 0 | 1023 | 254 | 63 | 7 | 1023 | 254 | 63 | 2048 | 8388608 |
| 1: | 0 | 1023 | 254 | 63 | 5 | 1023 | 254 | 63 | 33552690 | 8390656 |
| 2: | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 3: | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0: | 0 | 1023 | 254 | 63 | 7 | 1023 | 254 | 63 | 2048 | 8388608 |
| 1: | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 2: | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 3: | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Notice the change in the hidden sectors as well as the starting CHS values. Disk manager in XP can easily display the above:
But if you attempt to add a partition in the free space from XP the following happens:
Notice that the Vista created logical volumes no longer exist. Now when we look at the partition table we see the following:
| Act | Cyl | Head | Sect | Type | Cyl | Head | Sect | Hidden Sectors | Number of sectors | |
| 0: | 0 | 1023 | 1 | 1 | 7 | 1023 | 254 | 63 | 63 | 8385867 |
| 1: | 0 | 1023 | 0 | 1 | 5 | 1023 | 254 | 63 | 8385930 | 8385930 |
| 2: | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 3: | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0: | 0 | 1023 | 1 | 1 | 7 | 1023 | 254 | 63 | 63 | 8385867 |
| 1: | 0 | 1023 | 254 | 63 | 5 | 1023 | 254 | 63 | 16771860 | 8390174 |
| 2: | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 3: | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0: | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 1: | 0 | 1023 | 254 | 63 | 5 | 1023 | 254 | 63 | 25162034 | 8390656 |
| 2: | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 3: | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0: | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 1: | 0 | 1023 | 254 | 63 | 5 | 1023 | 254 | 63 | 33552690 | 8390656 |
| 2: | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 3: | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0: | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 1: | 0 | 1023 | 217 | 26 | 5 | 1023 | 254 | 63 | 41943346 | 8388299 |
| 2: | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 3: | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0: | 0 | 1023 | 218 | 26 | 6 | 1023 | 254 | 63 | 63 | 8388236 |
| 1: | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 2: | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 3: | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
The Microsoft KB is correct to a degree, but it is not correct in placing all the fault with XP. Vista is doing some very non-standard things with data structures. In fact they make partition recovery a bit of a challenge. Until the need for the "1 meg boundary" is explained, rather than rely on Vista disk management tools as the article states, I'd recommend staying with XP tools or better yet, use a decent 3rd party partition management tool.