patch to bsdinstall to support BSD partitions

Allan Jude freebsd at allanjude.com
Sat May 17 15:58:29 UTC 2014


On some Lenovo machines, booting ZFS off MBR partitions does not work

On the Lenovo X61s that we were able to test on at the BSDCan Hackers
Lounge, we were able to get them to boot properly using a BSD
partitioning scheme instead.


The attached patch makes the following changes:

Add support for BSD partition type

Moved the write of the MBR boot sector to the end of the process to
avoid it being nuked by the pedantic zpool labelclear commands

Change the MBR code to not always create 2 zpools when using MBR. The
user only wants 2 pools (1 unencrypted to boot, and one encrypted for
data) in the case where they enable encryption. Due to the simplicity of
the code in previous versions of bsdinstall, two pools were used to
avoid a problem with the order of the creation of the partitions to
ensure that there was a partition at the front of the drive for the boot
code, and that the swap partition was the 2nd partition (BSD partition 'b')

Some style cleanup to make the flow of the MBR section more

fix an syntax error introduced in the previous patch where a newline was
not escaped

Write the zfsboot code to the two different places require for MBR and
BSD. Write the larger section first because writing the first sector
first seems to make the BSD partition disappear and appear as an empty
MBR (No idea why this was happening, reproduced on two Lenovo laptops)

Resolve variable reuse by renaming 'disksize' in second card to
'usablesize' to avoid disksize being disksize less swap+boot size

Sponsored By: ScaleEngine Inc.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: zfsboot.bsd_partition_v2.patch
Type: text/x-patch
Size: 11860 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-sysinstall/attachments/20140517/a028b5e7/attachment.bin>


More information about the freebsd-sysinstall mailing list