1 .\" Copyright (c) 2007, 2008 Marcel Moolenaar
2 .\" All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in the
11 .\" documentation and/or other materials provided with the distribution.
13 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
14 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
17 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 .Nd "control utility for the disk partitioning GEOM class"
49 .\" ==== BOOTCODE ====
53 .Op Fl p Ar partcode Fl i Ar index
100 .\" ==== RESTORE ====
143 utility is used to partition GEOM providers, normally disks.
144 The first argument is the action to be taken:
145 .Bl -tag -width ".Cm bootcode"
148 Add a new partition to the partitioning scheme given by
150 The partition begins on the logical block address given by the
153 Its size is given by the
156 SI unit suffixes are allowed.
161 options can be omitted.
162 If so they are automatically calculated.
163 The type of the partition is given by the
166 Partition types are discussed below in the section entitled
167 .Sx "PARTITION TYPES" .
169 Additional options include:
171 .It Fl a Ar alignment
174 utility tries to align
182 The index in the partition table at which the new partition is to be
184 The index determines the name of the device special file used
185 to represent the partition.
187 The label attached to the partition.
188 This option is only valid when used on partitioning schemes that support
191 Additional operational flags.
192 See the section entitled
193 .Sx "OPERATIONAL FLAGS"
194 below for a discussion
199 Dump a partition table to standard output in a special format used by the
202 .\" ==== BOOTCODE ====
204 Embed bootstrap code into the partitioning scheme's metadata on the
208 or write bootstrap code into a partition (using
212 Not all partitioning schemes have embedded bootstrap code, so the
214 option is scheme-specific in nature (see the section entitled
219 option specifies a file that contains the bootstrap code.
220 The contents and size of the file are determined by the partitioning
224 option specifies a file that contains the bootstrap code intended to be
225 written to a partition.
226 The partition is specified by the
229 The size of the file must be smaller than the size of the partition.
231 Additional options include:
234 Additional operational flags.
235 See the section entitled
236 .Sx "OPERATIONAL FLAGS"
237 below for a discussion
242 Commit any pending changes for geom
244 All actions are committed by default and will not result in
246 Actions can be modified with the
248 option so that they are not committed, but become pending.
249 Pending changes are reflected by the geom and the
251 utility, but they are not actually written to disk.
254 action will write all pending changes to disk.
257 Create a new partitioning scheme on a provider given by
261 option determines the scheme to use.
262 The kernel must have support for a particular scheme before
263 that scheme can be used to partition a disk.
265 Additional options include:
268 The number of entries in the partition table.
269 Every partitioning scheme has a minimum and maximum number of entries.
270 This option allows tables to be created with a number of entries
271 that is within the limits.
272 Some schemes have a maximum equal to the minimum and some schemes have
273 a maximum large enough to be considered unlimited.
274 By default, partition tables are created with the minimum number of
277 Additional operational flags.
278 See the section entitled
279 .Sx "OPERATIONAL FLAGS"
280 below for a discussion
285 Delete a partition from geom
287 and further identified by the
290 The partition cannot be actively used by the kernel.
292 Additional options include:
295 Additional operational flags.
296 See the section entitled
297 .Sx "OPERATIONAL FLAGS"
298 below for a discussion
301 .\" ==== DESTROY ====
303 Destroy the partitioning scheme as implemented by geom
306 Additional options include:
309 Forced destroying of the partition table even if it is not empty.
311 Additional operational flags.
312 See the section entitled
313 .Sx "OPERATIONAL FLAGS"
314 below for a discussion
319 Modify a partition from geom
321 and further identified by the
324 Only the type and/or label of the partition can be modified.
325 To change the type of a partition, specify the new type with the
328 To change the label of a partition, specify the new label with the
331 Not all partitioning schemes support labels and it is invalid to
332 try to change a partition label in such cases.
334 Additional options include:
337 Additional operational flags.
338 See the section entitled
339 .Sx "OPERATIONAL FLAGS"
340 below for a discussion
343 .\" ==== RECOVER ====
345 Recover a corrupt partition's scheme metadata on the geom
347 See the section entitled
349 below for the additional information.
351 Additional options include:
354 Additional operational flags.
355 See the section entitled
356 .Sx "OPERATIONAL FLAGS"
357 below for a discussion
362 Resize a partition from geom
364 and further identified by the
367 New partition size is expressed in logical block
368 numbers and can be given by the
373 option is omitted then new size is automatically calculated
374 to maximum available from given geom
377 Additional options include:
379 .It Fl a Ar alignment
382 utility tries to align partition
388 Additional operational flags.
389 See the section entitled
390 .Sx "OPERATIONAL FLAGS"
391 below for a discussion
394 .\" ==== RESTORE ====
396 Restore the partition table from a backup previously created by the
398 action and read from standard input.
399 Only the partition table is restored.
400 This action does not affect the content of partitions.
401 After restoring the partition table and writing bootcode if needed,
402 user data must be restored from backup.
404 Additional options include:
407 Destroy partition table on the given
409 before doing restore.
411 Restore partition labels for partitioning schemes that support them.
413 Additional operational flags.
414 See the section entitled
415 .Sx "OPERATIONAL FLAGS"
416 below for a discussion
421 Set the named attribute on the partition entry.
422 See the section entitled
424 below for a list of available attributes.
426 Additional options include:
429 Additional operational flags.
430 See the section entitled
431 .Sx "OPERATIONAL FLAGS"
432 below for a discussion
437 Show current partition information for the specified geoms, or all
438 geoms if none are specified.
439 The default output includes the logical starting block of each
440 partition, the partition size in blocks, the partition index number,
441 the partition type, and a human readable partition size.
442 Block sizes and locations are based on the device's Sectorsize
445 Additional options include:
448 For partitioning schemes that support partition labels, print them
449 instead of partition type.
451 Show provider names instead of partition indexes.
453 Show raw partition type instead of symbolic name.
457 Revert any pending changes for geom
459 This action is the opposite of the
461 action and can be used to undo any changes that have not been committed.
464 Clear the named attribute on the partition entry.
465 See the section entitled
467 below for a list of available attributes.
469 Additional options include:
472 Additional operational flags.
473 See the section entitled
474 .Sx "OPERATIONAL FLAGS"
475 below for a discussion
491 .Sh PARTITIONING SCHEMES
492 Several partitioning schemes are supported by the
495 .Bl -tag -width ".Cm VTOC8"
497 Apple Partition Map, used by PowerPC(R) Macintosh(R) computers.
502 Traditional BSD disklabel, usually used to subdivide MBR partitions.
504 This scheme can also be used as the sole partitioning method, without
506 Partition editing tools from other operating systems often do not
507 understand the bare disklabel partition layout, so this is sometimes
509 .Dq dangerously dedicated .
515 64-bit implementation of BSD disklabel used in DragonFlyBSD to subdivide MBR
521 The Logical Disk Manager is an implementation of volume manager for
522 Microsoft Windows NT.
527 GUID Partition Table is used on Intel-based Macintosh computers and
528 gradually replacing MBR on most PCs and other systems.
533 Master Boot Record is used on PCs and removable media.
539 option adds support for the Extended Boot Record (EBR),
540 which is used to define a logical partition.
542 .Cm GEOM_PART_EBR_COMPAT
543 option enables backward compatibility for partition names
545 It also prevents any type of actions on such partitions.
547 An MBR variant for NEC PC-98 and compatible computers.
552 Sun's SMI Volume Table Of Contents, used by
562 Partition types are identified on disk by particular strings or magic
566 utility uses symbolic names for common partition types so the user
567 does not need to know these values or other details of the partitioning
571 utility also allows the user to specify scheme-specific partition types
572 for partition types that do not have symbolic names.
573 Symbolic names currently understood and used by
576 .Bl -tag -width ".Cm dragonfly-disklabel64"
578 The system partition dedicated to storing boot loaders on some Apple
580 The scheme-specific types are
583 .Qq Li "!Apple_Bootstrap"
585 .Qq Li "!426f6f74-0000-11aa-aa11-00306543ecac"
588 The system partition dedicated to second stage of the boot loader program.
589 Usually it is used by the GRUB 2 loader for GPT partitioning schemes.
590 The scheme-specific type is
591 .Qq Li "!21686148-6449-6E6F-744E-656564454649" .
593 The system partition for computers that use the Extensible Firmware
595 In such cases, the GPT partitioning scheme is used and the
596 actual partition type for the system partition can also be specified as
597 .Qq Li "!c12a7328-f81f-11d2-ba4b-00a0c93ec93b" .
601 partition subdivided into filesystems with a
604 This is a legacy partition type and should not be used for the APM
606 The scheme-specific types are
611 .Qq Li "!516e7cb4-6ecf-11d6-8ff8-00022d09712b"
616 partition dedicated to bootstrap code.
617 The scheme-specific type is
618 .Qq Li "!83bd6b9d-7f41-11dc-be0b-001560b84f0f"
623 partition dedicated to swap space.
624 The scheme-specific types are
625 .Qq Li "!FreeBSD-swap"
627 .Qq Li "!516e7cb5-6ecf-11d6-8ff8-00022d09712b"
628 for GPT, and tag 0x0901 for VTOC8.
632 partition that contains a UFS or UFS2 filesystem.
633 The scheme-specific types are
634 .Qq Li "!FreeBSD-UFS"
636 .Qq Li "!516e7cb6-6ecf-11d6-8ff8-00022d09712b"
637 for GPT, and tag 0x0902 for VTOC8.
641 partition that contains a Vinum volume.
642 The scheme-specific types are
643 .Qq Li "!FreeBSD-Vinum"
645 .Qq Li "!516e7cb8-6ecf-11d6-8ff8-00022d09712b"
646 for GPT, and tag 0x0903 for VTOC8.
650 partition that contains a ZFS volume.
651 The scheme-specific types are
652 .Qq Li "!FreeBSD-ZFS"
654 .Qq Li "!516e7cba-6ecf-11d6-8ff8-00022d09712b"
655 for GPT, and 0x0904 for VTOC8.
658 Another symbolic names that can be used with
661 .Bl -tag -width ".Cm dragonfly-disklabel64"
663 An Apple Mac OS X partition dedicated to bootloader.
664 The scheme-specific types are
665 .Qq Li "!Apple_Bootstrap"
667 .Qq Li "!426f6f74-0000-11aa-aa11-00306543ecac"
670 An Apple Mac OS X partition that contains a HFS or HFS+ filesystem.
671 The scheme-specific types are
674 .Qq Li "!48465300-0000-11aa-aa11-00306543ecac"
677 An Apple Mac OS X partition dedicated to partition metadata that descibes
679 The scheme-specific type is
680 .Qq Li "!4c616265-6c00-11aa-aa11-00306543ecac"
683 An Apple Mac OS X partition used in a software RAID configuration.
684 The scheme-specific type is
685 .Qq Li "!52414944-0000-11aa-aa11-00306543ecac"
687 .It Cm apple-raid-offline
688 An Apple Mac OS X partition used in a software RAID configuration.
689 The scheme-specific type is
690 .Qq Li "!52414944-5f4f-11aa-aa11-00306543ecac"
692 .It Cm apple-tv-recovery
693 An Apple Mac OS X partition used by Apple TV.
694 The scheme-specific type is
695 .Qq Li "!5265636f-7665-11aa-aa11-00306543ecac"
698 An Apple Mac OS X partition that contains a UFS filesystem.
699 The scheme-specific types are
700 .Qq Li "!Apple_UNIX_SVR2"
702 .Qq Li "!55465300-0000-11aa-aa11-00306543ecac"
704 .It Cm dragonfly-label32
705 A DragonFlyBSD partition subdivided into filesystems with a
708 The scheme-specific type is
709 .Qq Li "!9d087404-1ca5-11dc-8817-01301bb8a9f5"
711 .It Cm dragonfly-label64
712 A DragonFlyBSD partition subdivided into filesystems with a
714 The scheme-specific type is
715 .Qq Li "!3d48ce54-1d16-11dc-8696-01301bb8a9f5"
717 .It Cm dragonfly-legacy
718 A legacy partition type used in DragonFlyBSD.
719 The scheme-specific type is
720 .Qq Li "!bd215ab2-1d16-11dc-8696-01301bb8a9f5"
723 A DragonFlyBSD partition used with Concatenated Disk driver.
724 The scheme-specific type is
725 .Qq Li "!dbd5211b-1ca5-11dc-8817-01301bb8a9f5"
727 .It Cm dragonfly-hammer
728 A DragonFlyBSD partition that contains a Hammer filesystem.
729 The scheme-specific type is
730 .Qq Li "!61dc63ac-6e38-11dc-8513-01301bb8a9f5"
732 .It Cm dragonfly-hammer2
733 A DragonFlyBSD partition that contains a Hammer2 filesystem.
734 The scheme-specific type is
735 .Qq Li "!5cbb9ad1-862d-11dc-a94d-01301bb8a9f5"
737 .It Cm dragonfly-swap
738 A DragonFlyBSD partition dedicated to swap space.
739 The scheme-specific type is
740 .Qq Li "!9d58fdbd-1ca5-11dc-8817-01301bb8a9f5"
743 A DragonFlyBSD partition that contains an UFS1 filesystem.
744 The scheme-specific type is
745 .Qq Li "!9d94ce7c-1ca5-11dc-8817-01301bb8a9f5"
747 .It Cm dragonfly-vinum
748 A DragonFlyBSD partition used with Logical Volume Manager.
749 The scheme-specific type is
750 .Qq Li "!9dd4478f-1ca5-11dc-8817-01301bb8a9f5"
753 A partition subdivided into filesystems with a EBR.
754 The scheme-specific type is
758 A partition that contains a FAT16 filesystem.
759 The scheme-specific type is
763 A partition that contains a FAT32 filesystem.
764 The scheme-specific type is
768 A Linux partition that contains some filesystem with data.
769 The scheme-specific types are
772 .Qq Li "!0fc63daf-8483-4772-8e79-3d69d8477de4"
775 A Linux partition dedicated to Logical Volume Manager.
776 The scheme-specific types are
779 .Qq Li "!e6d6d379-f507-44c2-a23c-238f2a3df928"
782 A Linux partition used in a software RAID configuration.
783 The scheme-specific types are
786 .Qq Li "!a19d880f-05fc-4d3b-a006-743f0f84911e"
789 A Linux partition dedicated to swap space.
790 The scheme-specific types are
793 .Qq Li "!0657fd6d-a4ab-43c4-84e5-0933c84b4f4f"
796 A partition that is sub-partitioned by a Master Boot Record (MBR).
797 This type is known as
798 .Qq Li "!024dee41-33e7-11d3-9d69-0008c781f39f"
801 A basic data partition (BDP) for Microsoft operating systems.
802 In the GPT this type is the equivalent to partition types
807 The scheme-specific type is
808 .Qq Li "!ebd0a0a2-b9e5-4433-87c0-68b6b72699c7"
811 A partition that contains Logical Disk Manager (LDM) volumes.
812 The scheme-specific types are
815 .Qq Li "!af9b60a0-1431-4f62-bc68-3311714a69ad"
817 .It Cm ms-ldm-metadata
818 A partition that contains Logical Disk Manager (LDM) database.
819 The scheme-specific type is
820 .Qq Li "!5808c8aa-7e8f-42e0-85d2-e1e90434cfb3"
823 A NetBSD partition used with Concatenated Disk driver.
824 The scheme-specific type is
825 .Qq Li "!2db519c4-b10f-11dc-b99b-0019d1879648"
828 An encrypted NetBSD partition.
829 The scheme-specific type is
830 .Qq Li "!2db519ec-b10f-11dc-b99b-0019d1879648"
833 A NetBSD partition that contains an UFS filesystem.
834 The scheme-specific type is
835 .Qq Li "!49f48d5a-b10e-11dc-b99b-0019d1879648"
838 A NetBSD partition that contains an LFS filesystem.
839 The scheme-specific type is
840 .Qq Li "!49f48d82-b10e-11dc-b99b-0019d1879648"
843 A NetBSD partition used in a software RAID configuration.
844 The scheme-specific type is
845 .Qq Li "!49f48daa-b10e-11dc-b99b-0019d1879648"
848 A NetBSD partition dedicated to swap space.
849 The scheme-specific type is
850 .Qq Li "!49f48d32-b10e-11dc-b99b-0019d1879648"
853 A partition that contains a NTFS or exFAT filesystem.
854 The scheme-specific type is
858 The system partition dedicated to storing boot loaders on some PowerPC systems,
859 notably those made by IBM.
860 The scheme-specific types are
863 .Qq Li "!0x9e1a2d38-c612-4316-aa26-8b49521e5a8b"
866 A partition that contains a VMware File System (VMFS).
867 The scheme-specific types are
870 .Qq Li "!aa31e02a-400f-11db-9590-000c2911d1b8"
872 .It Cm vmware-vmkdiag
873 A partition that contains a VMware diagostic filesystem.
874 The scheme-specific types are
877 .Qq Li "!9d275380-40ad-11db-bf97-000c2911d1b8"
879 .It Cm vmware-reserved
880 A VMware reserved partition.
881 The scheme-specific type is
882 .Qq Li "!9198effc-31c0-11db-8f-78-000c2911d1b8"
884 .It Cm vmware-vsanhdr
885 A partition claimed by VMware VSAN.
886 The scheme-specific type is
887 .Qq Li "!381cfccc-7288-11e0-92ee-000c2911d0b2"
891 The scheme-specific attributes for EBR:
892 .Bl -tag -width ".Cm active"
896 The scheme-specific attributes for GPT:
897 .Bl -tag -width ".Cm bootfailed"
901 stage 1 boot loader will try to boot the system from this partition.
902 Multiple partitions can be marked with the
909 Setting this attribute automatically sets the
914 stage 1 boot loader will try to boot the system from this partition only once.
915 Multiple partitions can be marked with the
924 This attribute should not be manually managed.
927 stage 1 boot loader and the
928 .Pa /etc/rc.d/gptboot
935 The scheme-specific attributes for MBR:
936 .Bl -tag -width ".Cm active"
940 The scheme-specific attributes for PC98:
941 .Bl -tag -width ".Cm bootable"
947 supports several partitioning schemes and each scheme uses different
949 The bootstrap code is located in a specific disk area for each partitioning
950 scheme, and may vary in size for different schemes.
952 Bootstrap code can be separated into two types.
953 The first type is embedded in the partitioning scheme's metadata, while the
954 second type is located on a specific partition.
955 Embedding bootstrap code should only be done with the
960 The GEOM PART class knows how to safely embed bootstrap code into
961 specific partitioning scheme metadata without causing any damage.
963 The Master Boot Record (MBR) uses a 512-byte bootstrap code image, embedded
964 into the partition table's metadata area.
965 There are two variants of this bootstrap code:
970 searches for a partition with the
974 section) in the partition table.
975 Then it runs next bootstrap stage.
978 image contains a boot manager with some additional interactive functions
979 for multi-booting from a user-selected partition.
981 A BSD disklabel is usually created inside an MBR partition (slice)
985 .Sx "PARTITION TYPES"
987 It uses 8 KB size bootstrap code image
989 embedded into the partition table's metadata area.
991 Both types of bootstrap code are used to boot from the GUID Partition Table.
992 First, a protective MBR is embedded into the first disk sector from the
995 It searches through the GPT for a
998 .Sx "PARTITION TYPES"
999 section) and runs the next bootstrap stage from it.
1002 partition should be smaller than 545 KB.
1003 It can be located either before or after other
1005 partitions on the disk.
1006 There are two variants of bootstrap code to write to this partition:
1009 .Pa /boot/gptzfsboot .
1012 is used to boot from UFS partitions.
1016 partitions in the GPT and selects one to boot based on the
1021 If neither attribute is found,
1023 boots from the first
1027 .Pq the third bootstrap stage
1028 is loaded from the first partition that matches these conditions.
1031 for more information.
1033 .Pa /boot/gptzfsboot
1034 is used to boot from ZFS.
1035 It searches through the GPT for
1037 partitions, trying to detect ZFS pools.
1038 After all pools are detected,
1040 is started from the first one found.
1042 The VTOC8 scheme does not support embedding bootstrap code.
1043 Instead, the 8 KBytes bootstrap code image
1045 should be written with the
1049 option to all sufficiently large VTOC8 partitions.
1052 option could be omitted.
1054 The APM scheme also does not support embedding bootstrap code.
1055 Instead, the 800 KBytes bootstrap code image
1057 should be written with the
1059 command to a partition of type
1061 which should also be 800 KB in size.
1062 .Sh OPERATIONAL FLAGS
1063 Actions other than the
1067 actions take an optional
1070 This option is used to specify action-specific operational flags.
1075 flag so that the action is immediately
1077 The user can specify
1079 to have the action result in a pending change that can later, with
1080 other pending changes, be committed as a single compound change with
1083 action or reverted with the
1087 The GEOM PART class supports recovering of partition tables only for GPT.
1088 The GPT primary metadata is stored at the beginning of the device.
1089 For redundancy, a secondary
1091 copy of the metadata is stored at the end of the device.
1092 As a result of having two copies, some corruption of metadata is not
1093 fatal to the working of GPT.
1094 When the kernel detects corrupt metadata, it marks this table as corrupt
1095 and reports the problem.
1099 are the only operations allowed on corrupt tables.
1101 If the first sector of a provider is corrupt, the kernel can not detect GPT
1102 even if the partition table itself is not corrupt.
1103 The protective MBR can be rewritten using the
1105 command, to restore the ability to detect the GPT.
1106 The copy of the protective MBR is usually located in the
1110 If one GPT header appears to be corrupt but the other copy remains intact,
1111 the kernel will log the following:
1112 .Bd -literal -offset indent
1113 GEOM: provider: the primary GPT table is corrupt or invalid.
1114 GEOM: provider: using the secondary instead -- recovery strongly advised.
1118 .Bd -literal -offset indent
1119 GEOM: provider: the secondary GPT table is corrupt or invalid.
1120 GEOM: provider: using the primary only -- recovery suggested.
1129 will report about corrupt tables.
1131 If the size of the device has changed (e.g.,\& volume expansion) the
1132 secondary GPT header will no longer be located in the last sector.
1133 This is not a metadata corruption, but it is dangerous because any
1134 corruption of the primary GPT will lead to loss of the partition table.
1135 This problem is reported by the kernel with the message:
1136 .Bd -literal -offset indent
1137 GEOM: provider: the secondary GPT header is not in the last LBA.
1140 This situation can be recovered with the
1143 This command reconstructs the corrupt metadata using known valid
1144 metadata and relocates the secondary GPT to the end of the device.
1147 The GEOM PART class can detect the same partition table visible through
1148 different GEOM providers, and some of them will be marked as corrupt.
1149 Be careful when choosing a provider for recovery.
1150 If you choose incorrectly you can destroy the metadata of another GEOM class,
1151 e.g.,\& GEOM MIRROR or GEOM LABEL.
1152 .Sh SYSCTL VARIABLES
1155 variables can be used to control the behavior of the
1158 The default value is shown next to each variable.
1159 .Bl -tag -width indent
1160 .It Va kern.geom.part.check_integrity : No 1
1161 This variable controls the behaviour of metadata integrity checks.
1162 When integrity checks are enabled, the
1164 GEOM class verifies all generic partition parameters obtained from the
1166 If some inconsistency is detected, the partition table will be
1167 rejected with a diagnostic message:
1168 .Sy "GEOM_PART: Integrity check failed (provider, scheme)" .
1169 .It Va kern.geom.part.ldm.debug : No 0
1170 Debug level of the Logical Disk Manager (LDM) module.
1171 This can be set to a number between 0 and 2 inclusive.
1172 If set to 0 minimal debug information is printed,
1173 and if set to 2 the maximum amount of debug information is printed.
1174 .It Va kern.geom.part.ldm.show_mirrors : No 0
1175 This variable controls how the Logical Disk Manager (LDM) module handles
1177 By default mirrored volumes are shown as partitions with type
1180 .Sx "PARTITION TYPES"
1182 If this variable set to 1 each component of the mirrored volume will be
1183 present as independent partition.
1185 This may break a mirrored volume and lead to data damage.
1186 .It Va kern.geom.part.mbr.enforce_chs : No 1
1187 Specify how the Master Boot Record (MBR) module does alignment.
1188 If this variable is set to a non-zero value, the module will automatically
1189 recalculate the user-specified offset and size for alignment with the CHS
1191 Otherwise the values will be left unchanged.
1194 Exit status is 0 on success, and 1 if the command fails.
1196 Create a GPT scheme on
1198 .Bd -literal -offset indent
1199 /sbin/gpart create -s GPT ada0
1202 Embed GPT bootstrap code into a protective MBR:
1203 .Bd -literal -offset indent
1204 /sbin/gpart bootcode -b /boot/pmbr ada0
1209 partition that can boot
1213 partition, and install bootstrap code into it.
1214 This partition must be larger than the bootstrap code
1219 .Pa /boot/gptzfsboot
1221 but smaller than 545 kB since the first-stage loader will load the
1222 entire partition into memory during boot, regardless of how much data
1223 it actually contains.
1224 This example uses 88 blocks (44 kB) so the next partition will be
1225 aligned on a 64 kB boundary without the need to specify an explicit
1226 offset or alignment.
1227 The boot partition itself is aligned on a 4 kB boundary.
1228 .Bd -literal -offset indent
1229 /sbin/gpart add -b 40 -s 88 -t freebsd-boot ada0
1230 /sbin/gpart bootcode -p /boot/gptboot -i 1 ada0
1233 Create a 512MB-sized
1235 partition to contain a UFS filesystem from which the system can boot.
1236 .Bd -literal -offset indent
1237 /sbin/gpart add -s 512M -t freebsd-ufs ada0
1240 Create an MBR scheme on
1242 then create a 30GB-sized
1244 slice, mark it active and
1248 .Bd -literal -offset indent
1249 /sbin/gpart create -s MBR ada0
1250 /sbin/gpart add -t freebsd -s 30G ada0
1251 /sbin/gpart set -a active -i 1 ada0
1252 /sbin/gpart bootcode -b /boot/boot0 ada0
1259 label) with space for up to 20 partitions:
1260 .Bd -literal -offset indent
1261 /sbin/gpart create -s BSD -n 20 ada0s1
1264 Create a 1GB-sized UFS partition and a 4GB-sized swap partition:
1265 .Bd -literal -offset indent
1266 /sbin/gpart add -t freebsd-ufs -s 1G ada0s1
1267 /sbin/gpart add -t freebsd-swap -s 4G ada0s1
1270 Install bootstrap code for the
1273 .Bd -literal -offset indent
1274 /sbin/gpart bootcode -b /boot/boot ada0s1
1277 Create a VTOC8 scheme on
1279 .Bd -literal -offset indent
1280 /sbin/gpart create -s VTOC8 da0
1283 Create a 512MB-sized
1285 partition to contain a UFS filesystem from which the system can boot.
1286 .Bd -literal -offset indent
1287 /sbin/gpart add -s 512M -t freebsd-ufs da0
1292 partition to contain a UFS filesystem and aligned on 4KB boundaries:
1293 .Bd -literal -offset indent
1294 /sbin/gpart add -s 15G -t freebsd-ufs -a 4k da0
1297 After creating all required partitions, embed bootstrap code into them:
1298 .Bd -literal -offset indent
1299 /sbin/gpart bootcode -p /boot/boot1 da0
1302 Create a backup of the partition table from
1304 .Bd -literal -offset indent
1305 /sbin/gpart backup da0 > da0.backup
1308 Restore the partition table from the backup to
1310 .Bd -literal -offset indent
1311 /sbin/gpart restore -l da0 < /mnt/da0.backup
1314 Clone the partition table from
1320 .Bd -literal -offset indent
1321 /sbin/gpart backup ada0 | /sbin/gpart restore -F ada1 ada2
1335 .An Marcel Moolenaar Aq marcel@FreeBSD.org