svn commit: r225185 - stable/8/sbin/geom/class/part

Andrey V. Elsukov ae at
Fri Aug 26 04:58:33 UTC 2011

Author: ae
Date: Fri Aug 26 04:58:33 2011
New Revision: 225185

  MFC r225003:
    Add new section "BOOTSTRAPPING" to the gpart(8), that describes
    bootstrap code images used to boot from MBR, GPT, BSD and VTOC8
  MFC r225023:
    o Fix mdoc formatting for the '.Fx' macro. [1]
    o Add information about APM scheme and fix typos. [2]
    Submitted by:	gjb [1], nwhitehorn [2]

Directory Properties:
  stable/8/sbin/geom/class/part/   (props changed)

Modified: stable/8/sbin/geom/class/part/gpart.8
--- stable/8/sbin/geom/class/part/gpart.8	Thu Aug 25 21:20:11 2011	(r225184)
+++ stable/8/sbin/geom/class/part/gpart.8	Fri Aug 26 04:58:33 2011	(r225185)
@@ -24,7 +24,7 @@
 .\" $FreeBSD$
-.Dd June 6, 2011
+.Dd August 19, 2011
 .Dt GPART 8
@@ -255,29 +255,21 @@ and
 .Fl i Ar index ) .
 Not all partitioning schemes have embedded bootstrap code, so the
 .Fl b Ar bootcode
-option is scheme-specific in nature.
-For the GPT scheme, embedded bootstrap code is supported.
-The bootstrap code is embedded in the protective MBR rather than the GPT.
+option is scheme-specific in nature (see the section entitled
 .Fl b Ar bootcode
 option specifies a file that contains the bootstrap code.
 The contents and size of the file are determined by the partitioning
-For the MBR scheme, it is a 512 byte file of which the first 446 bytes
-are installed as bootstrap code.
 .Fl p Ar partcode
 option specifies a file that contains the bootstrap code intended to be
 written to a partition.
-For the VTOC8 scheme, it is a 8192 byte file of which the last 7680 bytes
-are installed as bootstrap code.
 The partition is specified by the
 .Fl i Ar index
-For the VTOC8 scheme, if the
-.Fl i Ar index
-option is omitted, the bootstrap code is written to all sufficiently large
 The size of the file must be smaller than the size of the partition.
 Additional options include:
@@ -711,6 +703,101 @@ The scheme-specific attributes for PC98:
 .It Ar active
 .It Ar bootable
+supports several partitioning schemes and each scheme uses different
+bootstrap code.
+The bootstrap code is located in the specific disk area for each partitioning
+scheme and also it might have different size.
+The bootstrap code could be separated into two types.
+The first one is embedded in the partitioning scheme's metadata, the second
+type is located on the specific partition.
+The embedding bootstrap code should be done only with the
+.Cm gpart bootcode
+command with
+.Fl b Ar bootcode
+The GEOM PART class has knowlege on how to embed bootstrap code into specific
+partitioning scheme metadata without damage.
+The Master Boot Record (MBR) uses 512-bytes bootstrap code image, embedded into
+partition table's metadata area.
+There are two variants of this bootstrap code:
+.Pa /boot/mbr
+.Pa /boot/boot0 .
+The first one searches partition with
+.Cm active
+attribute (see the
+section) in the partition table.
+Then it runs next bootstrap stage.
+.Pa /boot/boot0
+image contains a boot manager with some additional interactive functions.
+The BSD disklabel is usually created on top of the MBR partition (slice)
+with type
+.Cm freebsd
+(see the
+It uses 8 KB size bootstrap code image
+.Pa /boot/boot ,
+embedded into partition table's metadata area.
+Both types of bootstrap code are used to boot from the GUID Partition Table.
+First of all, a protective MBR is embedded into first disk sector from the
+.Pa /boot/pmbr
+It searches the
+.Cm freebsd-boot
+partition (see the
+section) in the GPT and runs next bootstrap stage from it.
+.Cm freebsd-boot
+partition should be smaller than 545 KB.
+There are two variants of bootstrap code to write to this partition:
+.Pa /boot/gptboot
+.Pa /boot/gptzfsboot .
+The first one is used to boot from UFS.
+It searches in the GPT partition with type
+.Cm freebsd-ufs ,
+and it runs the third bootstrap stage (
+.Pa /boot/loader )
+if it is found.
+.Pa /boot/gptzfsboot
+is used to boot from ZFS.
+It searches partition with type
+.Cm freebsd-zfs
+and starts
+.Pa /boot/zfsloader
+from it.
+The VTOC8 scheme does not support embedding bootstrap code.
+Instead, the 8 KBytes bootstrap code image
+.Pa /boot/boot1
+should be written with
+.Cm gpart bootcode
+command with
+.Fl p Ar bootcode
+option to all sufficiently large VTOC8 partitions.
+To do this the
+.Fl i Ar index
+option could be ommited.
+The APM scheme also does not support embedding bootstrap code.
+Instead, the 800 KBytes bootstrap code image
+.Pa /boot/boot1.hfs
+should be written with
+.Cm gpart bootcode
+command to a partition of type
+.Cm freebsd-boot ,
+which should also be 800 KB in size.
 Actions other than the
 .Cm commit
@@ -889,6 +976,7 @@ and 
 .Xr dd 1 ,
 .Xr geom 4 ,
+.Xr boot0cfg 8 ,
 .Xr geom 8

More information about the svn-src-stable-8 mailing list