Add a section that explicitly describes partitioning schemes. Modify
existing sections to refer to the new one. Rearrange partitioning scheme list so MBR and EBR types are together. Also add several corrections for grammar, clarity, and consistency. Approved by: gjb (mentor) MFC after: 1 week
This commit is contained in:
parent
bf3db314f7
commit
97982fcc82
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=227774
@ -24,7 +24,7 @@
|
|||||||
.\"
|
.\"
|
||||||
.\" $FreeBSD$
|
.\" $FreeBSD$
|
||||||
.\"
|
.\"
|
||||||
.Dd August 19, 2011
|
.Dd October 26, 2011
|
||||||
.Dt GPART 8
|
.Dt GPART 8
|
||||||
.Os
|
.Os
|
||||||
.Sh NAME
|
.Sh NAME
|
||||||
@ -37,52 +37,20 @@ lines in your kernel configuration file:
|
|||||||
.Bd -ragged -offset indent
|
.Bd -ragged -offset indent
|
||||||
.Cd "options GEOM_PART_APM"
|
.Cd "options GEOM_PART_APM"
|
||||||
.Cd "options GEOM_PART_BSD"
|
.Cd "options GEOM_PART_BSD"
|
||||||
.Cd "options GEOM_PART_EBR"
|
|
||||||
.Cd "options GEOM_PART_EBR_COMPAT"
|
|
||||||
.Cd "options GEOM_PART_GPT"
|
.Cd "options GEOM_PART_GPT"
|
||||||
.Cd "options GEOM_PART_MBR"
|
.Cd "options GEOM_PART_MBR"
|
||||||
|
.Cd "options GEOM_PART_EBR"
|
||||||
|
.Cd "options GEOM_PART_EBR_COMPAT"
|
||||||
.Cd "options GEOM_PART_PC98"
|
.Cd "options GEOM_PART_PC98"
|
||||||
.Cd "options GEOM_PART_VTOC8"
|
.Cd "options GEOM_PART_VTOC8"
|
||||||
.Ed
|
.Ed
|
||||||
.Pp
|
.Pp
|
||||||
The
|
These options provide support for the various types of partitioning
|
||||||
.Dv GEOM_PART_APM
|
schemes supported by the
|
||||||
option adds support for the Apple Partition Map (APM)
|
.Ns Nm
|
||||||
found on Apple Macintosh computers.
|
utility. See
|
||||||
The
|
.Sx "PARTITIONING SCHEMES"
|
||||||
.Dv GEOM_PART_BSD
|
below for more details.
|
||||||
option adds support for the traditional
|
|
||||||
.Bx
|
|
||||||
disklabel.
|
|
||||||
The
|
|
||||||
.Dv GEOM_PART_EBR
|
|
||||||
option adds support for the Extended Boot Record (EBR),
|
|
||||||
which is used to define a logical partition.
|
|
||||||
The
|
|
||||||
.Dv GEOM_PART_EBR_COMPAT
|
|
||||||
option enables backward compatibility for partition names
|
|
||||||
in the EBR scheme.
|
|
||||||
Also it makes impossible any types of actions
|
|
||||||
with such partitions.
|
|
||||||
The
|
|
||||||
.Dv GEOM_PART_GPT
|
|
||||||
option adds support for the GUID Partition Table (GPT)
|
|
||||||
found on Intel Itanium computers and Intel-based Macintosh computers.
|
|
||||||
The
|
|
||||||
.Dv GEOM_PART_MBR
|
|
||||||
option adds support for the Master Boot Record (MBR)
|
|
||||||
found on PCs and used on many removable media.
|
|
||||||
The
|
|
||||||
.Dv GEOM_PART_PC98
|
|
||||||
option adds support for the MBR variant as used on
|
|
||||||
NEC PC-98 computers.
|
|
||||||
The
|
|
||||||
.Dv GEOM_PART_VTOC8
|
|
||||||
option adds support for Sun's SMI VTOC8 label as
|
|
||||||
found on computers based on
|
|
||||||
.Tn SPARC64
|
|
||||||
and
|
|
||||||
.Tn UltraSPARC.
|
|
||||||
.Pp
|
.Pp
|
||||||
Usage of the
|
Usage of the
|
||||||
.Ns Nm
|
.Ns Nm
|
||||||
@ -190,7 +158,7 @@ utility:
|
|||||||
The
|
The
|
||||||
.Nm
|
.Nm
|
||||||
utility is used to partition GEOM providers, normally disks.
|
utility is used to partition GEOM providers, normally disks.
|
||||||
The first argument of which is the action to be taken:
|
The first argument is the action to be taken:
|
||||||
.Bl -tag -width ".Cm bootcode"
|
.Bl -tag -width ".Cm bootcode"
|
||||||
.\" ==== ADD ====
|
.\" ==== ADD ====
|
||||||
.It Cm add
|
.It Cm add
|
||||||
@ -245,7 +213,7 @@ about its use.
|
|||||||
.El
|
.El
|
||||||
.\" ==== BACKUP ====
|
.\" ==== BACKUP ====
|
||||||
.It Cm backup
|
.It Cm backup
|
||||||
Dump a partition table to standard output in special format used by
|
Dump a partition table to standard output in a special format used by the
|
||||||
.Cm restore
|
.Cm restore
|
||||||
action.
|
action.
|
||||||
.\" ==== BOOTCODE ====
|
.\" ==== BOOTCODE ====
|
||||||
@ -290,18 +258,17 @@ about its use.
|
|||||||
.It Cm commit
|
.It Cm commit
|
||||||
Commit any pending changes for geom
|
Commit any pending changes for geom
|
||||||
.Ar geom .
|
.Ar geom .
|
||||||
All actions are being committed by default and will not result in
|
All actions are committed by default and will not result in
|
||||||
pending changes.
|
pending changes.
|
||||||
Actions can be modified with the
|
Actions can be modified with the
|
||||||
.Fl f Ar flags
|
.Fl f Ar flags
|
||||||
option so that they are not being committed by default.
|
option so that they are not committed, but become pending.
|
||||||
As such, they become pending.
|
|
||||||
Pending changes are reflected by the geom and the
|
Pending changes are reflected by the geom and the
|
||||||
.Nm
|
.Nm
|
||||||
utility, but they are not actually written to disk.
|
utility, but they are not actually written to disk.
|
||||||
The
|
The
|
||||||
.Cm commit
|
.Cm commit
|
||||||
action will write any and all pending changes to disk.
|
action will write all pending changes to disk.
|
||||||
.\" ==== CREATE ====
|
.\" ==== CREATE ====
|
||||||
.It Cm create
|
.It Cm create
|
||||||
Create a new partitioning scheme on a provider given by
|
Create a new partitioning scheme on a provider given by
|
||||||
@ -309,16 +276,16 @@ Create a new partitioning scheme on a provider given by
|
|||||||
The
|
The
|
||||||
.Fl s Ar scheme
|
.Fl s Ar scheme
|
||||||
option determines the scheme to use.
|
option determines the scheme to use.
|
||||||
The kernel needs to have support for a particular scheme before
|
The kernel must have support for a particular scheme before
|
||||||
that scheme can be used to partition a disk.
|
that scheme can be used to partition a disk.
|
||||||
.Pp
|
.Pp
|
||||||
Additional options include:
|
Additional options include:
|
||||||
.Bl -tag -width 10n
|
.Bl -tag -width 10n
|
||||||
.It Fl n Ar entries
|
.It Fl n Ar entries
|
||||||
The number of entries in the partition table.
|
The number of entries in the partition table.
|
||||||
Every partitioning scheme has a minimum and a maximum number of entries
|
Every partitioning scheme has a minimum and maximum number of entries.
|
||||||
and this option allows tables to be created with the number of entries
|
This option allows tables to be created with a number of entries
|
||||||
that lies anywhere between the minimum and the maximum.
|
that is within the limits.
|
||||||
Some schemes have a maximum equal to the minimum and some schemes have
|
Some schemes have a maximum equal to the minimum and some schemes have
|
||||||
a maximum large enough to be considered unlimited.
|
a maximum large enough to be considered unlimited.
|
||||||
By default, partition tables are created with the minimum number of
|
By default, partition tables are created with the minimum number of
|
||||||
@ -392,7 +359,7 @@ about its use.
|
|||||||
.El
|
.El
|
||||||
.\" ==== RECOVER ====
|
.\" ==== RECOVER ====
|
||||||
.It Cm recover
|
.It Cm recover
|
||||||
Recover corrupt partition's scheme metadata on the geom
|
Recover a corrupt partition's scheme metadata on the geom
|
||||||
.Ar geom .
|
.Ar geom .
|
||||||
See the section entitled
|
See the section entitled
|
||||||
.Sx RECOVERING
|
.Sx RECOVERING
|
||||||
@ -489,7 +456,7 @@ or all geoms if none are specified.
|
|||||||
Additional options include:
|
Additional options include:
|
||||||
.Bl -tag -width 10n
|
.Bl -tag -width 10n
|
||||||
.It Fl l
|
.It Fl l
|
||||||
For partition schemes that support partition labels print them
|
For partitioning schemes that support partition labels, print them
|
||||||
instead of partition type.
|
instead of partition type.
|
||||||
.It Fl p
|
.It Fl p
|
||||||
Show provider names instead of partition indexes.
|
Show provider names instead of partition indexes.
|
||||||
@ -520,39 +487,93 @@ below for a discussion
|
|||||||
about its use.
|
about its use.
|
||||||
.El
|
.El
|
||||||
.El
|
.El
|
||||||
.\"
|
.Sh PARTITIONING SCHEMES
|
||||||
|
Several partitioning schemes are supported by the
|
||||||
|
.Nm
|
||||||
|
utility:
|
||||||
|
.Bl -tag -width ".Cm VTOC8"
|
||||||
|
.It Cm APM
|
||||||
|
Apple Partition Map, used by PowerPC(R) Macintosh(R) computers.
|
||||||
|
Requires the
|
||||||
|
.Cd GEOM_PART_APM
|
||||||
|
kernel option.
|
||||||
|
.It Cm BSD
|
||||||
|
BSD disklabel without an MBR.
|
||||||
|
Sometimes called
|
||||||
|
.Dq dangerously dedicated mode .
|
||||||
|
.Po
|
||||||
|
See
|
||||||
|
.Xr bsdlabel 8 for more information.
|
||||||
|
.Pc
|
||||||
|
Requires the
|
||||||
|
.Cm GEOM_PART_BSD
|
||||||
|
kernel option.
|
||||||
|
.It Cm GPT
|
||||||
|
GUID Partition Table is used on Intel-based Macintosh computers and
|
||||||
|
gradually replacing MBR on most PCs and other systems.
|
||||||
|
Requires the
|
||||||
|
.Cm GEOM_PART_GPT
|
||||||
|
kernel option.
|
||||||
|
.It Cm MBR
|
||||||
|
Master Boot Record is used on PCs and removable media.
|
||||||
|
Requires the
|
||||||
|
.Cm GEOM_PART_MBR
|
||||||
|
kernel option.
|
||||||
|
The
|
||||||
|
.Cm GEOM_PART_EBR
|
||||||
|
option adds support for the Extended Boot Record (EBR),
|
||||||
|
which is used to define a logical partition.
|
||||||
|
The
|
||||||
|
.Cm GEOM_PART_EBR_COMPAT
|
||||||
|
option enables backward compatibility for partition names
|
||||||
|
in the EBR scheme.
|
||||||
|
It also prevents any type of actions on such partitions.
|
||||||
|
.It Cm PC98
|
||||||
|
An MBR variant for NEC PC-98 and compatible computers.
|
||||||
|
Requires the
|
||||||
|
.Cm GEOM_PART_PC98
|
||||||
|
kernel option.
|
||||||
|
.It Cm VTOC8
|
||||||
|
Sun's SMI Volume Table Of Contents, used by
|
||||||
|
.Tn SPARC64
|
||||||
|
and
|
||||||
|
.Tn UltraSPARC
|
||||||
|
computers.
|
||||||
|
Requires the
|
||||||
|
.Cm GEOM_PART_VTOC8
|
||||||
|
kernel option.
|
||||||
|
.El
|
||||||
.Sh PARTITION TYPES
|
.Sh PARTITION TYPES
|
||||||
Partition types are identified on disk by particular strings or magic
|
Partition types are identified on disk by particular strings or magic
|
||||||
values.
|
values.
|
||||||
The
|
The
|
||||||
.Nm
|
.Nm
|
||||||
utility uses symbolic names for common partition types to avoid the
|
utility uses symbolic names for common partition types so the user
|
||||||
user needing to know these values or other details of the partitioning
|
does not need to know these values or other details of the partitioning
|
||||||
scheme in question.
|
scheme in question.
|
||||||
The
|
The
|
||||||
.Nm
|
.Nm
|
||||||
utility also allows the user to specify scheme-specific partition types
|
utility also allows the user to specify scheme-specific partition types
|
||||||
for partition types that do not have symbolic names.
|
for partition types that do not have symbolic names.
|
||||||
The symbolic names currently understood are:
|
Symbolic names currently understood are:
|
||||||
.Bl -tag -width ".Cm freebsd-vinum"
|
.Bl -tag -width ".Cm freebsd-vinum"
|
||||||
.It Cm bios-boot
|
.It Cm bios-boot
|
||||||
The system partition dedicated to second stage of the boot loader program.
|
The system partition dedicated to second stage of the boot loader program.
|
||||||
Usually it used by GRUB 2 loader when the partition table is GPT.
|
Usually it is used by the GRUB 2 loader for GPT partitioning schemes.
|
||||||
The scheme-specific type is
|
The scheme-specific type is
|
||||||
.Qq Li "!21686148-6449-6E6F-744E-656564454649" .
|
.Qq Li "!21686148-6449-6E6F-744E-656564454649" .
|
||||||
.It Cm efi
|
.It Cm efi
|
||||||
The system partition for computers that use the Extensible Firmware
|
The system partition for computers that use the Extensible Firmware
|
||||||
Interface (EFI).
|
Interface (EFI).
|
||||||
In such cases, the GPT partitioning scheme is being used and the
|
In such cases, the GPT partitioning scheme is used and the
|
||||||
actual partition type for the system partition can also be specified as
|
actual partition type for the system partition can also be specified as
|
||||||
.Qq Li "!c12a7328-f81f-11d2-ba4b-00a0c93ec93ab" .
|
.Qq Li "!c12a7328-f81f-11d2-ba4b-00a0c93ec93ab" .
|
||||||
.It Cm freebsd
|
.It Cm freebsd
|
||||||
A
|
A
|
||||||
.Fx
|
.Fx
|
||||||
partition that uses the
|
partition subdivided into filesystems with a
|
||||||
.Bx
|
.Bx
|
||||||
disklabel to sub-divide the
|
disklabel.
|
||||||
partition into file systems.
|
|
||||||
This is a legacy partition type and should not be used for the APM
|
This is a legacy partition type and should not be used for the APM
|
||||||
or GPT schemes.
|
or GPT schemes.
|
||||||
The scheme-specific types are
|
The scheme-specific types are
|
||||||
@ -581,7 +602,7 @@ for GPT, and tag 0x0901 for VTOC8.
|
|||||||
.It Cm freebsd-ufs
|
.It Cm freebsd-ufs
|
||||||
A
|
A
|
||||||
.Fx
|
.Fx
|
||||||
partition that contains a UFS or UFS2 file system.
|
partition that contains a UFS or UFS2 filesystem.
|
||||||
The scheme-specific types are
|
The scheme-specific types are
|
||||||
.Qq Li "!FreeBSD-UFS"
|
.Qq Li "!FreeBSD-UFS"
|
||||||
for APM,
|
for APM,
|
||||||
@ -606,7 +627,7 @@ for APM,
|
|||||||
.Qq Li "!516e7cba-6ecf-11d6-8ff8-00022d09712b"
|
.Qq Li "!516e7cba-6ecf-11d6-8ff8-00022d09712b"
|
||||||
for GPT, and 0x0904 for VTOC8.
|
for GPT, and 0x0904 for VTOC8.
|
||||||
.It Cm mbr
|
.It Cm mbr
|
||||||
A partition that is sub-partitioned by a master boot record (MBR).
|
A partition that is sub-partitioned by a Master Boot Record (MBR).
|
||||||
This type is known as
|
This type is known as
|
||||||
.Qq Li "!024dee41-33e7-11d3-9d69-0008c781f39f"
|
.Qq Li "!024dee41-33e7-11d3-9d69-0008c781f39f"
|
||||||
by GPT.
|
by GPT.
|
||||||
@ -712,27 +733,28 @@ The scheme-specific attributes for PC98:
|
|||||||
.Fx
|
.Fx
|
||||||
supports several partitioning schemes and each scheme uses different
|
supports several partitioning schemes and each scheme uses different
|
||||||
bootstrap code.
|
bootstrap code.
|
||||||
The bootstrap code is located in the specific disk area for each partitioning
|
The bootstrap code is located in a specific disk area for each partitioning
|
||||||
scheme and also it might have different size.
|
scheme, and may vary in size for different schemes.
|
||||||
.Pp
|
.Pp
|
||||||
The bootstrap code could be separated into two types.
|
Bootstrap code can be separated into two types.
|
||||||
The first one is embedded in the partitioning scheme's metadata, the second
|
The first type is embedded in the partitioning scheme's metadata, while the
|
||||||
type is located on the specific partition.
|
second type is located on a specific partition.
|
||||||
The embedding bootstrap code should be done only with the
|
Embedding bootstrap code should only be done with the
|
||||||
.Cm gpart bootcode
|
.Cm gpart bootcode
|
||||||
command with
|
command with the
|
||||||
.Fl b Ar bootcode
|
.Fl b Ar bootcode
|
||||||
option.
|
option.
|
||||||
The GEOM PART class has knowlege on how to embed bootstrap code into specific
|
The GEOM PART class knows how to safely embed bootstrap code into
|
||||||
partitioning scheme metadata without damage.
|
specific partitioning scheme metadata without causing any damage.
|
||||||
.Pp
|
.Pp
|
||||||
The Master Boot Record (MBR) uses 512-bytes bootstrap code image, embedded into
|
The Master Boot Record (MBR) uses a 512-byte bootstrap code image, embedded
|
||||||
partition table's metadata area.
|
into the partition table's metadata area.
|
||||||
There are two variants of this bootstrap code:
|
There are two variants of this bootstrap code:
|
||||||
.Pa /boot/mbr
|
.Pa /boot/mbr
|
||||||
and
|
and
|
||||||
.Pa /boot/boot0 .
|
.Pa /boot/boot0 .
|
||||||
The first one searches partition with
|
.Pa /boot/mbr
|
||||||
|
searches for a partition with the
|
||||||
.Cm active
|
.Cm active
|
||||||
attribute (see the
|
attribute (see the
|
||||||
.Sx ATTRIBUTES
|
.Sx ATTRIBUTES
|
||||||
@ -740,9 +762,10 @@ section) in the partition table.
|
|||||||
Then it runs next bootstrap stage.
|
Then it runs next bootstrap stage.
|
||||||
The
|
The
|
||||||
.Pa /boot/boot0
|
.Pa /boot/boot0
|
||||||
image contains a boot manager with some additional interactive functions.
|
image contains a boot manager with some additional interactive functions
|
||||||
|
for multi-booting from a user-selected partition.
|
||||||
.Pp
|
.Pp
|
||||||
The BSD disklabel is usually created on top of the MBR partition (slice)
|
A BSD disklabel is usually created inside an MBR partition (slice)
|
||||||
with type
|
with type
|
||||||
.Cm freebsd
|
.Cm freebsd
|
||||||
(see the
|
(see the
|
||||||
@ -750,17 +773,17 @@ with type
|
|||||||
section).
|
section).
|
||||||
It uses 8 KB size bootstrap code image
|
It uses 8 KB size bootstrap code image
|
||||||
.Pa /boot/boot ,
|
.Pa /boot/boot ,
|
||||||
embedded into partition table's metadata area.
|
embedded into the partition table's metadata area.
|
||||||
.Pp
|
.Pp
|
||||||
Both types of bootstrap code are used to boot from the GUID Partition Table.
|
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
|
First, a protective MBR is embedded into the first disk sector from the
|
||||||
.Pa /boot/pmbr
|
.Pa /boot/pmbr
|
||||||
image.
|
image.
|
||||||
It searches the
|
It searches the GPT
|
||||||
.Cm freebsd-boot
|
.Cm freebsd-boot
|
||||||
partition (see the
|
partition (see the
|
||||||
.Sx "PARTITION TYPES"
|
.Sx "PARTITION TYPES"
|
||||||
section) in the GPT and runs next bootstrap stage from it.
|
section) in the GPT and runs the next bootstrap stage from it.
|
||||||
The
|
The
|
||||||
.Cm freebsd-boot
|
.Cm freebsd-boot
|
||||||
partition should be smaller than 545 KB.
|
partition should be smaller than 545 KB.
|
||||||
@ -768,37 +791,39 @@ There are two variants of bootstrap code to write to this partition:
|
|||||||
.Pa /boot/gptboot
|
.Pa /boot/gptboot
|
||||||
and
|
and
|
||||||
.Pa /boot/gptzfsboot .
|
.Pa /boot/gptzfsboot .
|
||||||
The first one is used to boot from UFS.
|
.Pa /boot/gptboot
|
||||||
It searches in the GPT partition with type
|
is used to boot from UFS.
|
||||||
.Cm freebsd-ufs ,
|
It searches
|
||||||
and it runs the third bootstrap stage (
|
.Cm freebsd-ufs
|
||||||
.Pa /boot/loader )
|
GPT partitions and starts
|
||||||
if it is found.
|
.Pa /boot/loader
|
||||||
|
.Pq the third bootstrap stage
|
||||||
|
if found.
|
||||||
The
|
The
|
||||||
.Pa /boot/gptzfsboot
|
.Pa /boot/gptzfsboot
|
||||||
is used to boot from ZFS.
|
is used to boot from ZFS.
|
||||||
It searches partition with type
|
It searches
|
||||||
.Cm freebsd-zfs
|
.Cm freebsd-zfs
|
||||||
and starts
|
GPT partitions and starts
|
||||||
.Pa /boot/zfsloader
|
.Pa /boot/zfsloader
|
||||||
from it.
|
if found.
|
||||||
.Pp
|
.Pp
|
||||||
The VTOC8 scheme does not support embedding bootstrap code.
|
The VTOC8 scheme does not support embedding bootstrap code.
|
||||||
Instead, the 8 KBytes bootstrap code image
|
Instead, the 8 KBytes bootstrap code image
|
||||||
.Pa /boot/boot1
|
.Pa /boot/boot1
|
||||||
should be written with
|
should be written with the
|
||||||
.Cm gpart bootcode
|
.Cm gpart bootcode
|
||||||
command with
|
command with the
|
||||||
.Fl p Ar bootcode
|
.Fl p Ar bootcode
|
||||||
option to all sufficiently large VTOC8 partitions.
|
option to all sufficiently large VTOC8 partitions.
|
||||||
To do this the
|
To do this the
|
||||||
.Fl i Ar index
|
.Fl i Ar index
|
||||||
option could be ommited.
|
option could be omitted.
|
||||||
.Pp
|
.Pp
|
||||||
The APM scheme also does not support embedding bootstrap code.
|
The APM scheme also does not support embedding bootstrap code.
|
||||||
Instead, the 800 KBytes bootstrap code image
|
Instead, the 800 KBytes bootstrap code image
|
||||||
.Pa /boot/boot1.hfs
|
.Pa /boot/boot1.hfs
|
||||||
should be written with
|
should be written with the
|
||||||
.Cm gpart bootcode
|
.Cm gpart bootcode
|
||||||
command to a partition of type
|
command to a partition of type
|
||||||
.Cm freebsd-boot ,
|
.Cm freebsd-boot ,
|
||||||
@ -829,21 +854,22 @@ action or reverted with the
|
|||||||
action.
|
action.
|
||||||
.Sh RECOVERING
|
.Sh RECOVERING
|
||||||
The GEOM PART class supports recovering of partition tables only for GPT.
|
The GEOM PART class supports recovering of partition tables only for GPT.
|
||||||
The GUID partition table has a primary and secondary (backup) copy of
|
The GUID primary metadata is stored at the beginning of the device.
|
||||||
metadata for redundance, these are stored at the begining and the end
|
For redundancy, a secondary
|
||||||
of the device respectively.
|
.Pq backup
|
||||||
As a result of having two copies, it is acceptable to have some corruption
|
copy of the metadata is stored at the end of the device.
|
||||||
within the metadata that is not fatal to the working of GPT.
|
As a result of having two copies, some corruption of metadata is not
|
||||||
When the kernel detects corrupt metadata it marks this table as corrupt and
|
fatal to the working of GPT.
|
||||||
reports the corruption.
|
When the kernel detects corrupt metadata, it marks this table as corrupt
|
||||||
Any operations on corrupt tables are prohibited except for
|
and reports the problem.
|
||||||
.Cm destroy
|
.Cm destroy
|
||||||
and
|
and
|
||||||
.Cm recover .
|
.Cm recover
|
||||||
|
are the only operations allowed on corrupt tables.
|
||||||
.Pp
|
.Pp
|
||||||
If the first sector of a provider is corrupt, the kernel can not detect GPT
|
If the first sector of a provider is corrupt, the kernel can not detect GPT
|
||||||
even if partition table itself is not corrupt.
|
even if the partition table itself is not corrupt.
|
||||||
You can rewrite the protective MBR using the
|
The protective MBR can be rewritten using the
|
||||||
.Xr dd 1
|
.Xr dd 1
|
||||||
command, to restore the ability to detect the GPT.
|
command, to restore the ability to detect the GPT.
|
||||||
The copy of the protective MBR is usually located in the
|
The copy of the protective MBR is usually located in the
|
||||||
@ -874,7 +900,7 @@ will report about corrupt tables.
|
|||||||
If the size of the device has changed (e.g.\& volume expansion) the
|
If the size of the device has changed (e.g.\& volume expansion) the
|
||||||
secondary GPT header will no longer be located in the last sector.
|
secondary GPT header will no longer be located in the last sector.
|
||||||
This is not a metadata corruption, but it is dangerous because any
|
This is not a metadata corruption, but it is dangerous because any
|
||||||
corruption of the primary GPT will lead to loss of partition table.
|
corruption of the primary GPT will lead to loss of the partition table.
|
||||||
This problem is reported by the kernel with the message:
|
This problem is reported by the kernel with the message:
|
||||||
.Bd -literal -offset indent
|
.Bd -literal -offset indent
|
||||||
GEOM: provider: the secondary GPT header is not in the last LBA.
|
GEOM: provider: the secondary GPT header is not in the last LBA.
|
||||||
@ -913,13 +939,13 @@ rejected with a diagnostic message:
|
|||||||
.Sh EXIT STATUS
|
.Sh EXIT STATUS
|
||||||
Exit status is 0 on success, and 1 if the command fails.
|
Exit status is 0 on success, and 1 if the command fails.
|
||||||
.Sh EXAMPLES
|
.Sh EXAMPLES
|
||||||
Create GPT scheme on
|
Create a GPT scheme on
|
||||||
.Pa ad0 :
|
.Pa ad0 :
|
||||||
.Bd -literal -offset indent
|
.Bd -literal -offset indent
|
||||||
/sbin/gpart create -s GPT ad0
|
/sbin/gpart create -s GPT ad0
|
||||||
.Ed
|
.Ed
|
||||||
.Pp
|
.Pp
|
||||||
Embed GPT bootstrap code into protective MBR:
|
Embed GPT bootstrap code into a protective MBR:
|
||||||
.Bd -literal -offset indent
|
.Bd -literal -offset indent
|
||||||
/sbin/gpart bootcode -b /boot/pmbr ad0
|
/sbin/gpart bootcode -b /boot/pmbr ad0
|
||||||
.Ed
|
.Ed
|
||||||
@ -935,9 +961,11 @@ This partition must be larger than
|
|||||||
.Pa /boot/gptboot ,
|
.Pa /boot/gptboot ,
|
||||||
or the GPT boot you are planning to write, but smaller than 545 KB.
|
or the GPT boot you are planning to write, but smaller than 545 KB.
|
||||||
A size of 15 blocks (7680 bytes) would be sufficient for
|
A size of 15 blocks (7680 bytes) would be sufficient for
|
||||||
booting from UFS but let's use 128 blocks (64 KB) here in
|
booting from UFS but 128 blocks (64 KB) is used in
|
||||||
this example, in order to reserve some space for potential
|
this example to reserve some space for potential
|
||||||
future need (e.g.\& from a ZFS partition).
|
future need (e.g.\& a larger
|
||||||
|
.Pa /boot/gptzfsboot
|
||||||
|
for booting from a ZFS partition).
|
||||||
.Bd -literal -offset indent
|
.Bd -literal -offset indent
|
||||||
/sbin/gpart add -b 34 -s 128 -t freebsd-boot ad0
|
/sbin/gpart add -b 34 -s 128 -t freebsd-boot ad0
|
||||||
/sbin/gpart bootcode -p /boot/gptboot -i 1 ad0
|
/sbin/gpart bootcode -p /boot/gptboot -i 1 ad0
|
||||||
@ -945,17 +973,17 @@ future need (e.g.\& from a ZFS partition).
|
|||||||
.Pp
|
.Pp
|
||||||
Create a 512MB-sized
|
Create a 512MB-sized
|
||||||
.Cm freebsd-ufs
|
.Cm freebsd-ufs
|
||||||
partition that would contain UFS where the system boots from:
|
partition to contain a UFS filesystem from which the system can boot.
|
||||||
.Bd -literal -offset indent
|
.Bd -literal -offset indent
|
||||||
/sbin/gpart add -b 162 -s 1048576 -t freebsd-ufs ad0
|
/sbin/gpart add -b 162 -s 1048576 -t freebsd-ufs ad0
|
||||||
.Ed
|
.Ed
|
||||||
.Pp
|
.Pp
|
||||||
Create MBR scheme on
|
Create an MBR scheme on
|
||||||
.Pa ada0 ,
|
.Pa ada0 ,
|
||||||
then create 30GB-sized
|
then create a 30GB-sized
|
||||||
.Fx
|
.Fx
|
||||||
slice, mark it active and
|
slice, mark it active and
|
||||||
install
|
install the
|
||||||
.Nm boot0
|
.Nm boot0
|
||||||
boot manager:
|
boot manager:
|
||||||
.Bd -literal -offset indent
|
.Bd -literal -offset indent
|
||||||
@ -965,16 +993,16 @@ boot manager:
|
|||||||
/sbin/gpart bootcode -b /boot/boot0 ada0
|
/sbin/gpart bootcode -b /boot/boot0 ada0
|
||||||
.Ed
|
.Ed
|
||||||
.Pp
|
.Pp
|
||||||
Now create
|
Now create a
|
||||||
.Bx
|
.Bx
|
||||||
scheme
|
scheme
|
||||||
.Pf ( Bx
|
.Pf ( Bx
|
||||||
label) with ability to have up to 20 partitions:
|
label) with space for up to 20 partitions:
|
||||||
.Bd -literal -offset indent
|
.Bd -literal -offset indent
|
||||||
/sbin/gpart create -s BSD -n 20 ada0s1
|
/sbin/gpart create -s BSD -n 20 ada0s1
|
||||||
.Ed
|
.Ed
|
||||||
.Pp
|
.Pp
|
||||||
Create 1GB-sized UFS partition and 4GB-sized swap partition:
|
Create a 1GB-sized UFS partition and a 4GB-sized swap partition:
|
||||||
.Bd -literal -offset indent
|
.Bd -literal -offset indent
|
||||||
/sbin/gpart add -t freebsd-ufs -s 1G ada0s1
|
/sbin/gpart add -t freebsd-ufs -s 1G ada0s1
|
||||||
/sbin/gpart add -t freebsd-swap -s 4G ada0s1
|
/sbin/gpart add -t freebsd-swap -s 4G ada0s1
|
||||||
@ -987,7 +1015,7 @@ label:
|
|||||||
/sbin/gpart bootcode -b /boot/boot ada0s1
|
/sbin/gpart bootcode -b /boot/boot ada0s1
|
||||||
.Ed
|
.Ed
|
||||||
.Pp
|
.Pp
|
||||||
Create VTOC8 scheme on
|
Create a VTOC8 scheme on
|
||||||
.Pa da0 :
|
.Pa da0 :
|
||||||
.Bd -literal -offset indent
|
.Bd -literal -offset indent
|
||||||
/sbin/gpart create -s VTOC8 da0
|
/sbin/gpart create -s VTOC8 da0
|
||||||
@ -995,36 +1023,36 @@ Create VTOC8 scheme on
|
|||||||
.Pp
|
.Pp
|
||||||
Create a 512MB-sized
|
Create a 512MB-sized
|
||||||
.Cm freebsd-ufs
|
.Cm freebsd-ufs
|
||||||
partition that would contain UFS where the system boots from:
|
partition to contain a UFS filesystem from which the system can boot.
|
||||||
.Bd -literal -offset indent
|
.Bd -literal -offset indent
|
||||||
/sbin/gpart add -s 512M -t freebsd-ufs da0
|
/sbin/gpart add -s 512M -t freebsd-ufs da0
|
||||||
.Ed
|
.Ed
|
||||||
.Pp
|
.Pp
|
||||||
Create a 15GB-sized
|
Create a 15GB-sized
|
||||||
.Cm freebsd-ufs
|
.Cm freebsd-ufs
|
||||||
partition that would contain UFS and aligned on 4KB boundaries:
|
partition to contain a UFS filesystem and aligned on 4KB boundaries:
|
||||||
.Bd -literal -offset indent
|
.Bd -literal -offset indent
|
||||||
/sbin/gpart add -s 15G -t freebsd-ufs -a 4k da0
|
/sbin/gpart add -s 15G -t freebsd-ufs -a 4k da0
|
||||||
.Ed
|
.Ed
|
||||||
.Pp
|
.Pp
|
||||||
After having created all required partitions, embed bootstrap code into them:
|
After creating all required partitions, embed bootstrap code into them:
|
||||||
.Bd -literal -offset indent
|
.Bd -literal -offset indent
|
||||||
/sbin/gpart bootcode -p /boot/boot1 da0
|
/sbin/gpart bootcode -p /boot/boot1 da0
|
||||||
.Ed
|
.Ed
|
||||||
.Pp
|
.Pp
|
||||||
Create backup of partition table from
|
Create a backup of the partition table from
|
||||||
.Pa da0 :
|
.Pa da0 :
|
||||||
.Bd -literal -offset indent
|
.Bd -literal -offset indent
|
||||||
/sbin/gpart backup da0 > da0.backup
|
/sbin/gpart backup da0 > da0.backup
|
||||||
.Ed
|
.Ed
|
||||||
.Pp
|
.Pp
|
||||||
Restore partition table from backup to
|
Restore the partition table from the backup to
|
||||||
.Pa da0 :
|
.Pa da0 :
|
||||||
.Bd -literal -offset indent
|
.Bd -literal -offset indent
|
||||||
/sbin/gpart restore -l da0 < /mnt/da0.backup
|
/sbin/gpart restore -l da0 < /mnt/da0.backup
|
||||||
.Ed
|
.Ed
|
||||||
.Pp
|
.Pp
|
||||||
Clone partition table from
|
Clone the partition table from
|
||||||
.Pa ada0
|
.Pa ada0
|
||||||
to
|
to
|
||||||
.Pa ada1
|
.Pa ada1
|
||||||
|
Loading…
Reference in New Issue
Block a user