summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authorallanjude <allanjude@FreeBSD.org>2016-01-16 19:25:16 +0000
committerallanjude <allanjude@FreeBSD.org>2016-01-16 19:25:16 +0000
commit1ed62f8c4a2aca2e5f3797cda5912d71a00a4fe1 (patch)
tree69c0537ebdb645feb9e3a3d562221411ee4d9a89 /usr.sbin
parente18c504ec0c5fd91ce3c4175489580acf97c26b9 (diff)
downloadFreeBSD-src-1ed62f8c4a2aca2e5f3797cda5912d71a00a4fe1.zip
FreeBSD-src-1ed62f8c4a2aca2e5f3797cda5912d71a00a4fe1.tar.gz
Never 4k align the MBR bootpool because zfsldr can not deal with a gap
If the bootpool does not start at the first sector of the BSD partition then zfsldr seeks to the wrong offset inside the ZFS vdev label, and is unable to find zfsboot, so the system does not boot If 4k alignment is requested, align the BSD partition in the MBR table, and align the swap and data pool, but the bootpool must start at sector 1 While here, if 4k alignment is requested, disable MBR CHS alignment, as this results in not-4k aligned partitions. Reported by: Alex Wilkinson MFC after: 5 days Sponsored by: ScaleEngine Inc.
Diffstat (limited to 'usr.sbin')
-rwxr-xr-xusr.sbin/bsdinstall/scripts/zfsboot4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.sbin/bsdinstall/scripts/zfsboot b/usr.sbin/bsdinstall/scripts/zfsboot
index b42591b..5c3fc80 100755
--- a/usr.sbin/bsdinstall/scripts/zfsboot
+++ b/usr.sbin/bsdinstall/scripts/zfsboot
@@ -825,6 +825,7 @@ zfs_create_diskpart()
if [ "$ZFSBOOT_FORCE_4K_SECTORS" ]; then
align_small="-a 4k"
align_big="-a 1m"
+ sysctl kern.geom.part.mbr.enforce_chs=0
fi
case "$ZFSBOOT_PARTITION_SCHEME" in
@@ -940,11 +941,12 @@ zfs_create_diskpart()
#
# Always prepare a boot pool on MBR
+ # Do not align this partition, there must not be a gap
#
ZFSBOOT_BOOT_POOL=1
f_eval_catch $funcname gpart \
"$GPART_ADD_ALIGN_INDEX_WITH_SIZE" \
- "$align_small" 1 freebsd-zfs ${bootsize}b ${disk}s1 ||
+ "" 1 freebsd-zfs ${bootsize}b ${disk}s1 ||
return $FAILURE
# Pedantically nuke any old labels
f_eval_catch -d $funcname zpool "$ZPOOL_LABELCLEAR_F" \
OpenPOWER on IntegriCloud