[PC-BSD Commits] r22031 - pcbsd/current/src-sh/pc-sysinstall/backend

svn at pcbsd.org svn at pcbsd.org
Tue Apr 2 07:46:07 PDT 2013


Author: kris
Date: 2013-04-02 14:46:06 +0000 (Tue, 02 Apr 2013)
New Revision: 22031

Modified:
   pcbsd/current/src-sh/pc-sysinstall/backend/functions-bsdlabel.sh
Log:

Work around a bug in gpart with certian disk drives. On a number of systems
gpart may try to align the ZFS MBR partition to 4k, fail and the result is a
non-bootable system. This only effects MBR setups, GPT seems fine



Modified: pcbsd/current/src-sh/pc-sysinstall/backend/functions-bsdlabel.sh
===================================================================
--- pcbsd/current/src-sh/pc-sysinstall/backend/functions-bsdlabel.sh	2013-04-02 14:39:09 UTC (rev 22030)
+++ pcbsd/current/src-sh/pc-sysinstall/backend/functions-bsdlabel.sh	2013-04-02 14:46:06 UTC (rev 22031)
@@ -392,7 +392,15 @@
         rc_halt "gpart add ${SOUT} -t ${PARTYPE} ${_pDisk}"
       else
         sleep 2
-        rc_halt "gpart add ${SOUT} -t ${PARTYPE} -i ${CURPART} ${_wSlice}"
+
+	# When we install to ZFS on a MBR slice, align the partition to 512b
+	# This corrects some issues with cranky disks causing gpart alignment
+	# to 4k to fail, resulting in zfsboot hanging...
+	aOpt=""
+	if [ "$CURPART" = "1" -a "$PARTYPE" = "freebsd-zfs" ] ; then
+	   aOpt="-a 512b"
+	fi
+        rc_halt "gpart add ${SOUT} ${aOpt} -t ${PARTYPE} -i ${CURPART} ${_wSlice}"
       fi
 
       # Check if this is a root / boot partition, and stamp the right loader



More information about the Commits mailing list