misc/145735: sysinstall trashes Vista-created partition tables

Kent Hauser kent at khauser.net
Thu Apr 15 22:30:07 UTC 2010


>Number:         145735
>Category:       misc
>Synopsis:       sysinstall trashes Vista-created partition tables
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Apr 15 22:30:06 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     Kent Hauser
>Release:        8.0 Release / AMD64
>Organization:
>Environment:
Intel DP35DP motherboard (Firmware DPP3510J.86A.0572.2009.0715.2346)
WD20EADS (2.0T) install disk
Vista (original) or Vista SP2
Processor Intel Core 2 Duo (E8400) with 8G ram
>Description:
When using the 8.0-Release DVD (AMD64) to install FreeBSD on a disk with partitions created by Vista, sysinstall can trash the Cyl/Head/Sector entries in the partition, rendering the disk unable to boot. 

For me to be prevented from booting, I needed to have AHCI enabled in the BIOS. However, the bogus CHS entries should not be generated by sysinstall

Needless to say, rendering a computer inoperable is not a good result after running the system install program.

>How-To-Repeat:
I have just spent an inordinate amount of time running down a bad sysinstall bug. Please let me share the results.

I just replaced my boot disk on a vista / freebsd dual boot system. I replaced a failing 250G drive with a 2T drive. My motherboard is an Intel DP35DP (and crucially had AHCI enabled).

After restoring Vista, I used the vista storage snapin to allocate 3 100G partitions at the start of the disk assigning the remainder of the disk to a big NTFS partition.

Vista was already on the first 100G partition. I installed FreeBSD from 8.0-Release/AMD64 on the second. Upon rebooting, the computer would not even boot to the Blue BIOS screen. (It only showed a small cursor in the first screen position). I could only get to the BIOS screen if I removed the drive SATA data cable or moved the Motherboard jumper to the "Configuration" setting. (Disabling AHCI also works, but I didn't know this at the time.)

Turns out the problem was sysintall. It doesn't like the partition table entries Vista generates, so it creates bogus ones (which hang the motherboard). If sysinstall partitions the disk, there is one oddity, but the motherboard still boots. The details are show below:

1. Sysinstall creates 2 100G partitions on an empty disk.

Procedure: Boot FreeBSD install. When partitioning disk, delete all existing partitions. Then create a 100G partition (type = 7 for NTFS). Then create a second 100G partition (type 165 for FreeBSD).
Install FreeBSD on second partition. Install Vista on first partition (from Vista DVD). Install EasyBCD in Vista & use it to add FreeBSD to boot menu. You're good to go & your partition table looks like this:

(Using fdisk from FreeBSD live-DVD)

Geometry: Cyl = 3876021, Heads = 16, Sectors/Track = 63 (1008 Blocks/Cyl)

Partition Entry 1:
SysID=7 (NTFS) Start = 63, Size = 209714337, Flags = 80 (Active)
Start CHS = 0 / 1 / 1, End CHS = 1023 / 15 / 63

Partition Entry 2:
SysID=165 (FreeBSD) Start = 209714400 Size = 207714400, Flags = 0
Start CHS = 1023 / 255 / 63 End CHS = 1023 / 15 / 63

*** Note Partition 2 start CHS is odd. But the system still boots.

2. Vista creates 2 100G partitions on an empty disk.

Procedure: Boot Vista DVD (mine was 64bit version, pre-sp1).
Remove existing partitions as follows: Enter the repair mode, select command line interface, use "diskpart" command, then "select disk 0", "clean", and "exit". Close repair window & return to install.
At the install disk page, use advanced / new partition & create a "100000" MB partition. Install Vista on this.

After vista installs, use "administrative tools / computer management / storage" to create a  new "simple volume" of 100G (no format) which we will use to install FreeBSD.

Reboot into FreeBSD install disk & use fdisk in Fixit to examine partition table:

** Vista created partition table before sysinstall destroys it **

Geometry Cyl = 3876021, Heads = 16, Sectors/Track = 63 (**Unchanged from above)

Partition Entry #1:
SysID=7 (NTFS) Start=2048, Size = 204800000, Flags = 80
Start CHS = 2 / 0 / 33, End CHS = 1023 / 15 / 63

Partition Entry #2
SysID=6 (DOS) Start = 204802048, Size = 204800000, Flags = 0
Start CHS = 1023 / 15 / 63, End CHS = 1023 / 15 / 63

Exit Fixit & install FreeBSD. In partition display, select second 100G partition & change type from 6 to 165. Install no boot manager (MBR untouched) & complete install.

Since you can't re-enter fixit after installing, reboot FreeBSD install CD & examine partition table

** Partition table after sysinstall trashes it **

Partition Entry #1:
SysID = 7 (NTFS) Start = 2048, Size = 204800000, Flags = 0
Start CHS = 2 / 0 / 33, End CHS = 1023 / 10 / 10

(*** Note sysinstall trashed end CHS above for no particular reason)

Partition Entry #2:
SysID = 165 (FreeBSD) Start = 204802048, Size = 204800000, Flags = 0
Start CHS = 1023 / 255 / 63, End CHS = 1023 / 3 / 51

(*** Note sysinstall generated an odd beginning CHS entry & even odder end CHS entry)

As a bonus bug, fdisk helpfully reinitializes the partition table to a FreeBSD only setup when you try to edit the table.
If you put the partition table back like it is supposed to be, everything boots & works correctly.

>Fix:


>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list