From 30223a3203dcefb74ff818cdda913a9c8f75ffb9 Mon Sep 17 00:00:00 2001 From: Xin LI Date: Thu, 9 Oct 2008 06:23:04 +0000 Subject: [PATCH] =?UTF-8?q?Add=20some=20examples=20to=20demostrate=20gpart?= =?UTF-8?q?(8).=20--=E6=AD=A4=E8=A1=8C=E5=8F=8A=E4=BB=A5=E4=B8=8B=E5=86=85?= =?UTF-8?q?=E5=AE=B9=E5=B0=86=E4=BC=9A=E8=A2=AB=E5=BF=BD=E7=95=A5--?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sbin/geom/class/part/gpart.8 | 37 +++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/sbin/geom/class/part/gpart.8 b/sbin/geom/class/part/gpart.8 index 350633409380..f97204014965 100644 --- a/sbin/geom/class/part/gpart.8 +++ b/sbin/geom/class/part/gpart.8 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd Jun 17, 2008 +.Dd Oct 9, 2008 .Dt GPART 8 .Os .Sh NAME @@ -404,6 +404,41 @@ action or reverted with the action. .Sh EXIT STATUS Exit status is 0 on success, and 1 if the command fails. +.Sh EXAMPLES +Create GPT scheme on +.Pa ad0 . +.Bd -literal -offset indent +/sbin/gpart create -s GPT ad0 +.Ed +.Pp +Embed GPT bootstrap code into protective MBR. +.Bd -literal -offset indent +/sbin/gpart bootcode -b /boot/pmbr ad0 +.Ed +.Pp +Create a dedicated +.Pa freebsd-boot +partition that can boot FreeBSD from a +.Pa freebsd-ufs +partition, and install bootstrap code into it. +This partition must be larger than +.Pa /boot/gptboot , +or the GPT boot you are willing to write, +a size of 15 blocks (7680 bytes) would be sufficient for +booting from UFS, but let's use 128 blocks (64 KB) here in +this example, in order to reserve some space for potential +future need (e.g. from a ZFS partition). +.Bd -literal -offset indent +/sbin/gpart add -b 34 -s 128 -t freebsd-boot ad0 +/sbin/gpart bootcode -p /boot/gptboot -i 1 ad0 +.Ed +.Pp +Create a 512MB-sized +.Pa freebsd-ufs +partition that would contain UFS where the system boot from. +.Bd -literal -offset indent +/sbin/gpart add -b 162 -s 1048576 -t freebsd-ufs ad0 +.Ed .Sh SEE ALSO .Xr geom 4 , .Xr geom 8 ,