This mini guide will focus on using PTEDIT32.EXE (the 32-bit version of Powerquest’s Partition Table Editor) to edit partition settings to enable booting Windows from a Logical Volume. Note - this page has been adapted from Dan Goodell's Understanding MultiBooting and Booting Windows from an Extended Partition guide - it focuses on calculating the logical volume offset and editing the logical volume's hidden sector value. Please do refer to Dan's excellent guide for more detailed information.
PTEDIT32 will display partition information based on Cylinder/Head/Sector (CHS) and Logical Block Addressing (LBA) values. NOTE - Any cylinder values greater than 1023 will not be displayed in PTEDIT (this includes any partitions starting after the first 8 GB (assuming a sector size of 512 bytes). LBA values will however be displayed correctly.
The screenshots used in this guide were captured from a Virtual Hard Disk (.VHD) created and partitioned using Windows 7 Diskpart - partitions are aligned in Megabytes (they are not aligned to virtual cylinder boundaries as per the Windows NT5 partitioning scheme). The partitioning scheme for this disk is as follows -
PTEDIT32 uses the term EPBR (Extended Partition Boot Record) instead of EBR (Extended Boot Record). Every Logical Volume in an Extended Partition will be preceeded by its own EPBR. The EPBR will contain a partition table with up to two entries - the first entry will display the Logical Volumes offset from the EPBR, the second entry will display the next EPBR's offset from this EPBR.
Start PTEDIT. On the start screen ensure that the correct disk is displayed, then
click on the Goto EPBR (Extended Partition Boot Record) button - see figure 1.
figure 1.
After clicking on the Goto EPBR button, the next window will display the partition information for the first logical
volume in the extended partition (figure 2) -
figure 2.
Make a note of the Partition Table at
sector... entry (the offset in sectors of the extended partition
table for this volume - in this case 106956800), and the Sectors Before entry (this value gives
us the offset for the volume boot record from the EPBR - in this case 2048)- see figure 3.
figure 3.
Add the values for Partition Table at
sector... and Sectors Before together (refer to step 5) - in this case adding the two entries gives us 106958848. Now click on the Boot Record button (you will need to click somewhere in the relevant partition entry to enable this button) - see figure 4.
figure 4.
Find the entry for Hidden Sectors - this will show the offset from the EPBR to the start of the Logical Volume (it will probably be 63 if the partition was created using Windows 2000/XP/2003, or 2048 if the partition was created using Windows Vista/2008/7/8/10 default alignment) - see figure 5.
figure 5.
The Hidden Sectors value needs to be changed to the LBA (the sector offset from the beginning of the disk) for the volume boot record, as calculated previously in steps 3-4. That's the offset for the volume boot record - not the Extended Partition Boot Record. Add the sum of the Partition Table start sector
+ Sectors Before (e.g. 106958848) and input it in this box (any edits will be displayed in red text), then click on Write - see figure 6.
figure 6.
Click on Yes to apply the changes - see figure 7.
figure 7.
The new value will be displayed in black text if the EPBR was edited correctly. Click on Close to continue - see figure 8.
figure 8.
With this correction the boot record will now be able to find the rest of its own partition when it starts up.
Each Logical Volume is preceeded by it's own EPBR which essentially contains a partition table with entries for the logical volume it describes and the offset for the next EPBR (assuming the extended partition contains another logical Volume).
As EPBR's are linked from one to the next in a chain format, if any EPBR's become corrupted then any subsequent entries will be lost!
If another logical volume is contained within the extended partition then clicking on Goto EPBR....
....will display the next volumes EPBR -
with its own Partition Table at
sector... entry. Repeat steps 2 - 8 for each volume.
Note that in the screenshot above there is only one partition entry (for the logical volume) - there are no additional entries as this is the last logical volume in the chain.