Main

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:

CAUSE

This problem may be caused by a error in Logical Disk Manager. If the partition that hosts Windows Vista was created during the installation of Windows Vista, a 1-megabyte (MB) alignment boundary is created on the partition. This alignment boundary differs from the alignment boundary that is created by Windows XP. Therefore, when you use Windows XP to create a new partition, the different alignments may cause this problem.

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  
 ActCylHeadSectTypeCylHeadSectHidden SectorsNumber of sectors
 0:

 80

01171023254636333527592
 1:  0102301171023254633352765533527655
 2:  0102301f10232546367055310 58749705
 3:  0000000000

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

1023117102325463638385867

 1:

  01023015102325463 83859308385930

 2:

  0000000000
3:0000000000

 

0:

01023117102325463638385867

1:

0000000000

2:

0000000000
 3:  0000000000

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:

 

XP disk manger - click for larger image

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:

 ActCylHeadSectTypeCylHeadSectHidden SectorsNumber of sectors
 0:

  0

1023117102325463638385867
 1:  01023015102325463 83859308385930
 2:  0000000000
3:0000000000
 
0:01023117102325463638385867
1:01023254635102325463167718608390174
2:0000000000
 3:  0000000000
 
0:0102325463710232546315668388608
1:01023254635102325463251620348390656
2:0000000000
 3:  0000000000
 
0:0102325463710232546320488388608
1:01023254635102325463335526908390656
2:0000000000
 3:  0000000000
 
0:0102325463710232546320488388608
1:0000000000
2:0000000000
 3:  0000000000

Notice the change in the hidden sectors as well as the starting CHS values. Disk manager in XP can easily display the above:

XP disk manager - click for larger image

But if you attempt to add a partition in the free space from XP the following happens:

XP disk manager - click for larger image

Notice that the Vista created logical volumes no longer exist. Now when we look at the partition table we see the following:

 ActCylHeadSectTypeCylHeadSectHidden SectorsNumber of sectors
 0:

  0

1023117102325463638385867
 1:  01023015102325463 83859308385930
 2:  0000000000
3:0000000000
 
0:01023117102325463638385867
1:01023254635102325463167718608390174
2:0000000000
 3:  0000000000
 
0:0000000000
1:01023254635102325463251620348390656
2:0000000000
 3:  0000000000
 
0:0000000000
1:01023254635102325463335526908390656
2:0000000000
 3:  0000000000
 
0:0000000000
1:01023217265102325463419433468388299
2:0000000000
 3:  0000000000
 
0:01023218266102325463638388236
1:0000000000
2:0000000000
 3:  0000000000

Conclusion

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.

Copyright 2004, 2005, 2006, 2007 [Walter Clayton]. All rights reserved.
Revised: 03/27/07.