xref: /freebsd/lib/geom/part/gpart.8 (revision d35b039af944f68fe99bb3ad2f0c6d5ec7917096)
1.\" Copyright (c) 2007, 2008 Marcel Moolenaar
2.\" All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
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.
12.\"
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
23.\" SUCH DAMAGE.
24.\"
25.Dd February 11, 2025
26.Dt GPART 8
27.Os
28.Sh NAME
29.Nm gpart
30.Nd "control utility for the disk partitioning GEOM class"
31.Sh SYNOPSIS
32.\" ==== ADD ====
33.Nm
34.Cm add
35.Fl t Ar type
36.Op Fl a Ar alignment
37.Op Fl b Ar start
38.Op Fl s Ar size
39.Op Fl i Ar index
40.Op Fl l Ar label
41.Op Fl f Ar flags
42.Ar geom
43.\" ==== BACKUP ====
44.Nm
45.Cm backup
46.Ar geom
47.\" ==== BOOTCODE ====
48.Nm
49.Cm bootcode
50.Op Fl N
51.Op Fl b Ar bootcode
52.Op Fl p Ar partcode Fl i Ar index
53.Op Fl f Ar flags
54.Ar geom
55.\" ==== COMMIT ====
56.Nm
57.Cm commit
58.Ar geom
59.\" ==== CREATE ====
60.Nm
61.Cm create
62.Fl s Ar scheme
63.Op Fl n Ar entries
64.Op Fl f Ar flags
65.Ar provider
66.\" ==== DELETE ====
67.Nm
68.Cm delete
69.Fl i Ar index
70.Op Fl f Ar flags
71.Ar geom
72.\" ==== DESTROY ====
73.Nm
74.Cm destroy
75.Op Fl F
76.Op Fl f Ar flags
77.Ar geom
78.\" ==== MODIFY ====
79.Nm
80.Cm modify
81.Fl i Ar index
82.Op Fl l Ar label
83.Op Fl t Ar type
84.Op Fl f Ar flags
85.Ar geom
86.\" ==== RECOVER ====
87.Nm
88.Cm recover
89.Op Fl f Ar flags
90.Ar geom
91.\" ==== RESIZE ====
92.Nm
93.Cm resize
94.Fl i Ar index
95.Op Fl a Ar alignment
96.Op Fl s Ar size
97.Op Fl f Ar flags
98.Ar geom
99.\" ==== RESTORE ====
100.Nm
101.Cm restore
102.Op Fl lF
103.Op Fl f Ar flags
104.Ar provider
105.Op Ar ...
106.\" ==== SET ====
107.Nm
108.Cm set
109.Fl a Ar attrib
110.Fl i Ar index
111.Op Fl f Ar flags
112.Ar geom
113.\" ==== SHOW ====
114.Nm
115.Cm show
116.Op Fl l | r
117.Op Fl p
118.Op Ar geom ...
119.\" ==== UNDO ====
120.Nm
121.Cm undo
122.Ar geom
123.\" ==== UNSET ====
124.Nm
125.Cm unset
126.Fl a Ar attrib
127.Fl i Ar index
128.Op Fl f Ar flags
129.Ar geom
130.\"
131.Nm
132.Cm list
133.Nm
134.Cm status
135.Nm
136.Cm load
137.Nm
138.Cm unload
139.Sh DESCRIPTION
140The
141.Nm
142utility is used to partition GEOM providers, normally disks.
143The first argument is the action to be taken:
144.Bl -tag -width ".Cm bootcode"
145.\" ==== ADD ====
146.It Cm add
147Add a new partition to the partitioning scheme given by
148.Ar geom .
149The partition type must be specified with
150.Fl t Ar type .
151The partition's location, size, and other attributes will be calculated
152automatically if the corresponding options are not specified.
153.Pp
154The
155.Cm add
156command accepts these options:
157.Bl -tag -width 12n
158.It Fl a Ar alignment
159If specified, then the
160.Nm
161utility tries to align
162.Ar start
163offset and partition
164.Ar size
165to be multiple of
166.Ar alignment
167value.
168.It Fl b Ar start
169The logical block address where the partition will begin.
170An SI unit suffix is allowed.
171.It Fl f Ar flags
172Additional operational flags.
173See the section entitled
174.Sx "OPERATIONAL FLAGS"
175below for a discussion
176about its use.
177.It Fl i Ar index
178The index in the partition table at which the new partition is to be
179placed.
180The index determines the name of the device special file used
181to represent the partition.
182.It Fl l Ar label
183The label attached to the partition.
184This option is only valid when used on partitioning schemes that support
185partition labels.
186.It Fl s Ar size
187Create a partition of size
188.Ar size .
189An SI unit suffix is allowed.
190.It Fl t Ar type
191Create a partition of type
192.Ar type .
193Partition types are discussed below in the section entitled
194.Sx "PARTITION TYPES" .
195.El
196.\" ==== BACKUP ====
197.It Cm backup
198Dump a partition table to standard output in a special format used by the
199.Cm restore
200action.
201.\" ==== BOOTCODE ====
202.It Cm bootcode
203Embed bootstrap code into the partitioning scheme's metadata on the
204.Ar geom
205(using
206.Fl b Ar bootcode )
207or write bootstrap code into a partition (using
208.Fl p Ar partcode
209and
210.Fl i Ar index ) .
211.Pp
212The
213.Cm bootcode
214command accepts these options:
215.Bl -tag -width 10n
216.It Fl N
217Do not preserve the Volume Serial Number for MBR.
218MBR bootcode contains Volume Serial Number by default, and
219.Nm
220tries to preserve it when installing new bootstrap code.
221This option skips preservation to help with some versions of
222.Xr boot0cfg 8
223that do not support Volume Serial Number.
224.It Fl b Ar bootcode
225Embed bootstrap code from the file
226.Ar bootcode
227into the partitioning scheme's metadata for
228.Ar geom .
229Not all partitioning schemes have embedded bootstrap code, so the
230.Fl b Ar bootcode
231option is scheme-specific in nature (see the section entitled
232.Sx BOOTSTRAPPING
233below).
234The
235.Ar bootcode
236file must match the partitioning scheme's requirements for file content
237and size.
238.It Fl f Ar flags
239Additional operational flags.
240See the section entitled
241.Sx "OPERATIONAL FLAGS"
242below for a discussion
243about its use.
244.It Fl i Ar index
245Specify the target partition for
246.Fl p Ar partcode .
247.It Fl p Ar partcode
248Write the bootstrap code from the file
249.Ar partcode
250into the
251.Ar geom
252partition specified by
253.Fl i Ar index .
254The size of the file must be smaller than the size of the partition.
255.El
256.\" ==== COMMIT ====
257.It Cm commit
258Commit any pending changes for geom
259.Ar geom .
260All actions are committed by default and will not result in
261pending changes.
262Actions can be modified with the
263.Fl f Ar flags
264option so that they are not committed, but become pending.
265Pending changes are reflected by the geom and the
266.Nm
267utility, but they are not actually written to disk.
268The
269.Cm commit
270action will write all pending changes to disk.
271.\" ==== CREATE ====
272.It Cm create
273Create a new partitioning scheme on a provider given by
274.Ar provider .
275The scheme to use must be specified with the
276.Fl s Ar scheme
277option.
278.Pp
279The
280.Cm create
281command accepts these options:
282.Bl -tag -width 10n
283.It Fl f Ar flags
284Additional operational flags.
285See the section entitled
286.Sx "OPERATIONAL FLAGS"
287below for a discussion
288about its use.
289.It Fl n Ar entries
290The number of entries in the partition table.
291Every partitioning scheme has a minimum and maximum number of entries.
292This option allows tables to be created with a number of entries
293that is within the limits.
294Some schemes have a maximum equal to the minimum and some schemes have
295a maximum large enough to be considered unlimited.
296By default, partition tables are created with the minimum number of
297entries.
298.It Fl s Ar scheme
299Specify the partitioning scheme to use.
300The kernel must have support for a particular scheme before
301that scheme can be used to partition a disk.
302.El
303.\" ==== DELETE ====
304.It Cm delete
305Delete a partition from geom
306.Ar geom
307and further identified by the
308.Fl i Ar index
309option.
310The partition cannot be actively used by the kernel.
311.Pp
312The
313.Cm delete
314command accepts these options:
315.Bl -tag -width 10n
316.It Fl f Ar flags
317Additional operational flags.
318See the section entitled
319.Sx "OPERATIONAL FLAGS"
320below for a discussion
321about its use.
322.It Fl i Ar index
323Specifies the index of the partition to be deleted.
324.El
325.\" ==== DESTROY ====
326.It Cm destroy
327Destroy the partitioning scheme as implemented by geom
328.Ar geom .
329.Pp
330The
331.Cm destroy
332command accepts these options:
333.Bl -tag -width 10n
334.It Fl F
335Forced destroying of the partition table even if it is not empty.
336.It Fl f Ar flags
337Additional operational flags.
338See the section entitled
339.Sx "OPERATIONAL FLAGS"
340below for a discussion
341about its use.
342.El
343.\" ==== MODIFY ====
344.It Cm modify
345Modify a partition from geom
346.Ar geom
347and further identified by the
348.Fl i Ar index
349option.
350Only the type and/or label of the partition can be modified.
351Not all partitioning schemes support labels and it is invalid to
352try to change a partition label in such cases.
353.Pp
354The
355.Cm modify
356command accepts these options:
357.Bl -tag -width 10n
358.It Fl f Ar flags
359Additional operational flags.
360See the section entitled
361.Sx "OPERATIONAL FLAGS"
362below for a discussion
363about its use.
364.It Fl i Ar index
365Specifies the index of the partition to be modified.
366.It Fl l Ar label
367Change the partition label to
368.Ar label .
369.It Fl t Ar type
370Change the partition type to
371.Ar type .
372.El
373.\" ==== RECOVER ====
374.It Cm recover
375Recover a corrupt partition's scheme metadata on the geom
376.Ar geom .
377See the section entitled
378.Sx RECOVERING
379below for the additional information.
380.Pp
381The
382.Cm recover
383command accepts these options:
384.Bl -tag -width 10n
385.It Fl f Ar flags
386Additional operational flags.
387See the section entitled
388.Sx "OPERATIONAL FLAGS"
389below for a discussion
390about its use.
391.El
392.\" ==== RESIZE ====
393.It Cm resize
394Resize a partition from geom
395.Ar geom
396and further identified by the
397.Fl i Ar index
398option.
399If the new size is not specified it is automatically calculated
400to be the maximum available from
401.Ar geom .
402.Pp
403The
404.Cm resize
405command accepts these options:
406.Bl -tag -width 12n
407.It Fl a Ar alignment
408If specified, then the
409.Nm
410utility tries to align partition
411.Ar size
412to be a multiple of the
413.Ar alignment
414value.
415.It Fl f Ar flags
416Additional operational flags.
417See the section entitled
418.Sx "OPERATIONAL FLAGS"
419below for a discussion
420about its use.
421.It Fl i Ar index
422Specifies the index of the partition to be resized.
423.It Fl s Ar size
424Specifies the new size of the partition, in logical blocks.
425An SI unit suffix is allowed.
426.El
427.\" ==== RESTORE ====
428.It Cm restore
429Restore the partition table from a backup previously created by the
430.Cm backup
431action and read from standard input.
432Only the partition table is restored.
433This action does not affect the content of partitions.
434After restoring the partition table and writing bootcode if needed,
435user data must be restored from backup.
436.Pp
437The
438.Cm restore
439command accepts these options:
440.Bl -tag -width 10n
441.It Fl F
442Destroy partition table on the given
443.Ar provider
444before doing restore.
445.It Fl f Ar flags
446Additional operational flags.
447See the section entitled
448.Sx "OPERATIONAL FLAGS"
449below for a discussion
450about its use.
451.It Fl l
452Restore partition labels for partitioning schemes that support them.
453.El
454.\" ==== SET ====
455.It Cm set
456Set the named attribute on the partition entry.
457See the section entitled
458.Sx ATTRIBUTES
459below for a list of available attributes.
460.Pp
461The
462.Cm set
463command accepts these options:
464.Bl -tag -width 10n
465.It Fl a Ar attrib
466Specifies the attribute to set.
467.It Fl f Ar flags
468Additional operational flags.
469See the section entitled
470.Sx "OPERATIONAL FLAGS"
471below for a discussion
472about its use.
473.It Fl i Ar index
474Specifies the index of the partition on which the attribute will be set.
475.El
476.\" ==== SHOW ====
477.It Cm show
478Show current partition information for the specified geoms, or all
479geoms if none are specified.
480The default output includes the logical starting block of each
481partition, the partition size in blocks, the partition index number,
482the partition type, and a human readable partition size.
483Block sizes and locations are based on the device's Sectorsize
484as shown by
485.Cm gpart list .
486.Pp
487The
488.Cm show
489command accepts these options:
490.Bl -tag -width 10n
491.It Fl l
492For partitioning schemes that support partition labels, print them
493instead of partition type.
494.It Fl p
495Show provider names instead of partition indexes.
496.It Fl r
497Show raw partition type instead of symbolic name.
498.El
499.\" ==== UNDO ====
500.It Cm undo
501Revert any pending changes for geom
502.Ar geom .
503This action is the opposite of the
504.Cm commit
505action and can be used to undo any changes that have not been committed.
506.\" ==== UNSET ====
507.It Cm unset
508Clear the named attribute on the partition entry.
509See the section entitled
510.Sx ATTRIBUTES
511below for a list of available attributes.
512.Pp
513The
514.Cm unset
515command accepts these options:
516.Bl -tag -width 10n
517.It Fl a Ar attrib
518Specifies the attribute to clear.
519.It Fl f Ar flags
520Additional operational flags.
521See the section entitled
522.Sx "OPERATIONAL FLAGS"
523below for a discussion
524about its use.
525.It Fl i Ar index
526Specifies the index of the partition on which the attribute will be cleared.
527.El
528.It Cm list
529See
530.Xr geom 8 .
531.It Cm status
532See
533.Xr geom 8 .
534.It Cm load
535See
536.Xr geom 8 .
537.It Cm unload
538See
539.Xr geom 8 .
540.El
541.Sh PARTITIONING SCHEMES
542Several partitioning schemes are supported by the
543.Nm
544utility:
545.Bl -tag -width ".Cm BSD64"
546.It Cm APM
547Apple Partition Map, used by PowerPC(R) Macintosh(R) computers.
548Requires the
549.Cd GEOM_PART_APM
550kernel option.
551.It Cm BSD
552Traditional BSD
553.Xr disklabel 8 ,
554usually used to subdivide MBR partitions.
555.Po
556This scheme can also be used as the sole partitioning method, without
557an MBR.
558Partition editing tools from other operating systems often do not
559understand the bare disklabel partition layout, so this is sometimes
560called
561.Dq dangerously dedicated .
562.Pc
563Requires the
564.Cm GEOM_PART_BSD
565kernel option.
566.It Cm BSD64
56764-bit implementation of BSD disklabel used in
568.Dx
569to subdivide MBR
570or GPT partitions.
571Requires the
572.Cm GEOM_PART_BSD64
573kernel option.
574.It Cm LDM
575The Logical Disk Manager is an implementation of volume manager for
576Microsoft Windows NT.
577Requires the
578.Cd GEOM_PART_LDM
579kernel option.
580.It Cm GPT
581GUID Partition Table is used on Intel-based Macintosh computers and
582gradually replacing MBR on most PCs and other systems.
583Requires the
584.Cm GEOM_PART_GPT
585kernel option.
586.It Cm MBR
587Master Boot Record is used on PCs and removable media.
588Requires the
589.Cm GEOM_PART_MBR
590kernel option.
591The
592.Cm GEOM_PART_EBR
593option adds support for the Extended Boot Record (EBR),
594which is used to define a logical partition.
595The
596.Cm GEOM_PART_EBR_COMPAT
597option enables backward compatibility for partition names
598in the EBR scheme.
599It also prevents any type of actions on such partitions.
600.El
601.Pp
602See
603.Xr glabel 8
604for additional information on labelization of devices and partitions.
605.Sh PARTITION TYPES
606Partition types are identified on disk by particular strings or magic
607values.
608The
609.Nm
610utility uses symbolic names for common partition types so the user
611does not need to know these values or other details of the partitioning
612scheme in question.
613The
614.Nm
615utility also allows the user to specify scheme-specific partition types
616for partition types that do not have symbolic names.
617Symbolic names currently understood and used by
618.Fx
619are:
620.Bl -tag -width ".Cm dragonfly-disklabel64"
621.It Cm apple-boot
622The system partition dedicated to storing boot loaders on some Apple
623systems.
624The scheme-specific types are
625.Qq Li "!171"
626for MBR,
627.Qq Li "!Apple_Bootstrap"
628for APM, and
629.Qq Li "!426f6f74-0000-11aa-aa11-00306543ecac"
630for GPT.
631.It Cm bios-boot
632The system partition dedicated to second stage of the boot loader program.
633Usually it is used by the GRUB 2 loader for GPT partitioning schemes.
634The scheme-specific type is
635.Qq Li "!21686148-6449-6E6F-744E-656564454649" .
636.It Cm efi
637The system partition for computers that use the Extensible Firmware
638Interface (EFI).
639The scheme-specific types are
640.Qq Li "!239"
641for MBR, and
642.Qq Li "!c12a7328-f81f-11d2-ba4b-00a0c93ec93b"
643for GPT.
644.It Cm freebsd
645A
646.Fx
647partition subdivided into filesystems with a
648.Bx
649disklabel.
650This is a legacy partition type and should not be used for the APM
651or GPT schemes.
652The scheme-specific types are
653.Qq Li "!165"
654for MBR,
655.Qq Li "!FreeBSD"
656for APM, and
657.Qq Li "!516e7cb4-6ecf-11d6-8ff8-00022d09712b"
658for GPT.
659.It Cm freebsd-boot
660A
661.Fx
662partition dedicated to bootstrap code.
663The scheme-specific type is
664.Qq Li "!83bd6b9d-7f41-11dc-be0b-001560b84f0f"
665for GPT.
666.It Cm freebsd-swap
667A
668.Fx
669partition dedicated to swap space.
670The scheme-specific types are
671.Qq Li "!FreeBSD-swap"
672for APM, and
673.Qq Li "!516e7cb5-6ecf-11d6-8ff8-00022d09712b"
674for GPT.
675.It Cm freebsd-ufs
676A
677.Fx
678partition that contains a UFS or UFS2 filesystem.
679The scheme-specific types are
680.Qq Li "!FreeBSD-UFS"
681for APM, and
682.Qq Li "!516e7cb6-6ecf-11d6-8ff8-00022d09712b"
683for GPT.
684.It Cm freebsd-zfs
685A
686.Fx
687partition that contains a ZFS volume.
688The scheme-specific types are
689.Qq Li "!FreeBSD-ZFS"
690for APM, and
691.Qq Li "!516e7cba-6ecf-11d6-8ff8-00022d09712b"
692for GPT.
693.El
694.Pp
695Other symbolic names that can be used with the
696.Nm
697utility are:
698.Bl -tag -width ".Cm dragonfly-disklabel64"
699.It Cm apple-apfs
700An Apple macOS partition used for the Apple file system, APFS.
701.It Cm apple-core-storage
702An Apple Mac OS X partition used by logical volume manager known as
703Core Storage.
704The scheme-specific type is
705.Qq Li "!53746f72-6167-11aa-aa11-00306543ecac"
706for GPT.
707.It Cm apple-hfs
708An Apple Mac OS X partition that contains a HFS or HFS+ filesystem.
709The scheme-specific types are
710.Qq Li "!175"
711for MBR,
712.Qq Li "!Apple_HFS"
713for APM and
714.Qq Li "!48465300-0000-11aa-aa11-00306543ecac"
715for GPT.
716.It Cm apple-label
717An Apple Mac OS X partition dedicated to partition metadata that descibes
718disk device.
719The scheme-specific type is
720.Qq Li "!4c616265-6c00-11aa-aa11-00306543ecac"
721for GPT.
722.It Cm apple-raid
723An Apple Mac OS X partition used in a software RAID configuration.
724The scheme-specific type is
725.Qq Li "!52414944-0000-11aa-aa11-00306543ecac"
726for GPT.
727.It Cm apple-raid-offline
728An Apple Mac OS X partition used in a software RAID configuration.
729The scheme-specific type is
730.Qq Li "!52414944-5f4f-11aa-aa11-00306543ecac"
731for GPT.
732.It Cm apple-tv-recovery
733An Apple Mac OS X partition used by Apple TV.
734The scheme-specific type is
735.Qq Li "!5265636f-7665-11aa-aa11-00306543ecac"
736for GPT.
737.It Cm apple-ufs
738An Apple Mac OS X partition that contains a UFS filesystem.
739The scheme-specific types are
740.Qq Li "!168"
741for MBR,
742.Qq Li "!Apple_UNIX_SVR2"
743for APM and
744.Qq Li "!55465300-0000-11aa-aa11-00306543ecac"
745for GPT.
746.It Cm apple-zfs
747An Apple Mac OS X partition that contains a ZFS volume.
748The scheme-specific type is
749.Qq Li "!6a898cc3-1dd2-11b2-99a6-080020736631"
750for GPT.
751The same GUID is being used also for
752.Sy illumos/Solaris /usr partition .
753See
754.Sx CAVEATS
755section below.
756.It Cm dragonfly-label32
757A
758.Dx
759partition subdivided into filesystems with a
760.Bx
761disklabel.
762The scheme-specific type is
763.Qq Li "!9d087404-1ca5-11dc-8817-01301bb8a9f5"
764for GPT.
765.It Cm dragonfly-label64
766A
767.Dx
768partition subdivided into filesystems with a
769disklabel64.
770The scheme-specific type is
771.Qq Li "!3d48ce54-1d16-11dc-8696-01301bb8a9f5"
772for GPT.
773.It Cm dragonfly-legacy
774A legacy partition type used in
775.Dx .
776The scheme-specific type is
777.Qq Li "!bd215ab2-1d16-11dc-8696-01301bb8a9f5"
778for GPT.
779.It Cm dragonfly-ccd
780A
781.Dx
782partition used with Concatenated Disk driver.
783The scheme-specific type is
784.Qq Li "!dbd5211b-1ca5-11dc-8817-01301bb8a9f5"
785for GPT.
786.It Cm dragonfly-hammer
787A
788.Dx
789partition that contains a Hammer filesystem.
790The scheme-specific type is
791.Qq Li "!61dc63ac-6e38-11dc-8513-01301bb8a9f5"
792for GPT.
793.It Cm dragonfly-hammer2
794A
795.Dx
796partition that contains a Hammer2 filesystem.
797The scheme-specific type is
798.Qq Li "!5cbb9ad1-862d-11dc-a94d-01301bb8a9f5"
799for GPT.
800.It Cm dragonfly-swap
801A
802.Dx
803partition dedicated to swap space.
804The scheme-specific type is
805.Qq Li "!9d58fdbd-1ca5-11dc-8817-01301bb8a9f5"
806for GPT.
807.It Cm dragonfly-ufs
808A
809.Dx
810partition that contains an UFS1 filesystem.
811The scheme-specific type is
812.Qq Li "!9d94ce7c-1ca5-11dc-8817-01301bb8a9f5"
813for GPT.
814.It Cm dragonfly-vinum
815A
816.Dx
817partition used with Logical Volume Manager.
818The scheme-specific type is
819.Qq Li "!9dd4478f-1ca5-11dc-8817-01301bb8a9f5"
820for GPT.
821.It Cm ebr
822A partition subdivided into filesystems with a EBR.
823The scheme-specific type is
824.Qq Li "!5"
825for MBR.
826.It Cm fat16
827A partition that contains a FAT16 filesystem.
828The scheme-specific type is
829.Qq Li "!6"
830for MBR.
831.It Cm fat32
832A partition that contains a FAT32 filesystem.
833The scheme-specific type is
834.Qq Li "!11"
835for MBR.
836.It Cm fat32lba
837A partition that contains a FAT32 (LBA) filesystem.
838The scheme-specific type is
839.Qq Li "!12"
840for MBR.
841.It Cm hifive-fsbl
842A raw partition containing a HiFive first stage bootloader.
843The scheme-specific type is
844.Qq Li "!5b193300-fc78-40cd-8002-e86c45580b47"
845for GPT.
846.It Cm hifive-bbl
847A raw partition containing a HiFive second stage bootloader.
848The scheme-specific type is
849.Qq Li "!2e54b353-1271-4842-806f-e436d6af6985"
850for GPT.
851.It Cm linux-data
852A Linux partition that contains some filesystem with data.
853The scheme-specific types are
854.Qq Li "!131"
855for MBR and
856.Qq Li "!0fc63daf-8483-4772-8e79-3d69d8477de4"
857for GPT.
858.It Cm linux-lvm
859A Linux partition dedicated to Logical Volume Manager.
860The scheme-specific types are
861.Qq Li "!142"
862for MBR and
863.Qq Li "!e6d6d379-f507-44c2-a23c-238f2a3df928"
864for GPT.
865.It Cm linux-raid
866A Linux partition used in a software RAID configuration.
867The scheme-specific types are
868.Qq Li "!253"
869for MBR and
870.Qq Li "!a19d880f-05fc-4d3b-a006-743f0f84911e"
871for GPT.
872.It Cm linux-swap
873A Linux partition dedicated to swap space.
874The scheme-specific types are
875.Qq Li "!130"
876for MBR and
877.Qq Li "!0657fd6d-a4ab-43c4-84e5-0933c84b4f4f"
878for GPT.
879.It Cm mbr
880A partition that is sub-partitioned by a Master Boot Record (MBR).
881This type is known as
882.Qq Li "!024dee41-33e7-11d3-9d69-0008c781f39f"
883by GPT.
884.It Cm ms-basic-data
885A basic data partition (BDP) for Microsoft operating systems.
886In the GPT this type is the equivalent to partition types
887.Cm fat16 , fat32
888and
889.Cm ntfs
890in MBR.
891This type is used for GPT exFAT partitions.
892The scheme-specific type is
893.Qq Li "!ebd0a0a2-b9e5-4433-87c0-68b6b72699c7"
894for GPT.
895.It Cm ms-ldm-data
896A partition that contains Logical Disk Manager (LDM) volumes.
897The scheme-specific types are
898.Qq Li "!66"
899for MBR,
900.Qq Li "!af9b60a0-1431-4f62-bc68-3311714a69ad"
901for GPT.
902.It Cm ms-ldm-metadata
903A partition that contains Logical Disk Manager (LDM) database.
904The scheme-specific type is
905.Qq Li "!5808c8aa-7e8f-42e0-85d2-e1e90434cfb3"
906for GPT.
907.It Cm netbsd-ccd
908A
909.Nx
910partition used with Concatenated Disk driver.
911The scheme-specific type is
912.Qq Li "!2db519c4-b10f-11dc-b99b-0019d1879648"
913for GPT.
914.It Cm netbsd-cgd
915An encrypted
916.Nx
917partition.
918The scheme-specific type is
919.Qq Li "!2db519ec-b10f-11dc-b99b-0019d1879648"
920for GPT.
921.It Cm netbsd-ffs
922A
923.Nx
924partition that contains an UFS filesystem.
925The scheme-specific type is
926.Qq Li "!49f48d5a-b10e-11dc-b99b-0019d1879648"
927for GPT.
928.It Cm netbsd-lfs
929A
930.Nx
931partition that contains an LFS filesystem.
932The scheme-specific type is
933.Qq Li "!49f48d82-b10e-11dc-b99b-0019d1879648"
934for GPT.
935.It Cm netbsd-raid
936A
937.Nx
938partition used in a software RAID configuration.
939The scheme-specific type is
940.Qq Li "!49f48daa-b10e-11dc-b99b-0019d1879648"
941for GPT.
942.It Cm netbsd-swap
943A
944.Nx
945partition dedicated to swap space.
946The scheme-specific type is
947.Qq Li "!49f48d32-b10e-11dc-b99b-0019d1879648"
948for GPT.
949.It Cm ntfs
950A partition that contains a NTFS or exFAT filesystem.
951The scheme-specific type is
952.Qq Li "!7"
953for MBR.
954.It Cm prep-boot
955The system partition dedicated to storing boot loaders on some PowerPC systems,
956notably those made by IBM.
957The scheme-specific types are
958.Qq Li "!65"
959for MBR and
960.Qq Li "!9e1a2d38-c612-4316-aa26-8b49521e5a8b"
961for GPT.
962.It Cm solaris-boot
963A illumos/Solaris partition dedicated to boot loader.
964The scheme-specific type is
965.Qq Li "!6a82cb45-1dd2-11b2-99a6-080020736631"
966for GPT.
967.It Cm solaris-root
968A illumos/Solaris partition dedicated to root filesystem.
969The scheme-specific type is
970.Qq Li "!6a85cf4d-1dd2-11b2-99a6-080020736631"
971for GPT.
972.It Cm solaris-swap
973A illumos/Solaris partition dedicated to swap.
974The scheme-specific type is
975.Qq Li "!6a87c46f-1dd2-11b2-99a6-080020736631"
976for GPT.
977.It Cm solaris-backup
978A illumos/Solaris partition dedicated to backup.
979The scheme-specific type is
980.Qq Li "!6a8b642b-1dd2-11b2-99a6-080020736631"
981for GPT.
982.It Cm solaris-var
983A illumos/Solaris partition dedicated to /var filesystem.
984The scheme-specific type is
985.Qq Li "!6a8ef2e9-1dd2-11b2-99a6-080020736631"
986for GPT.
987.It Cm solaris-home
988A illumos/Solaris partition dedicated to /home filesystem.
989The scheme-specific type is
990.Qq Li "!6a90ba39-1dd2-11b2-99a6-080020736631"
991for GPT.
992.It Cm solaris-altsec
993A illumos/Solaris partition dedicated to alternate sector.
994The scheme-specific type is
995.Qq Li "!6a9283a5-1dd2-11b2-99a6-080020736631"
996for GPT.
997.It Cm solaris-reserved
998A illumos/Solaris partition dedicated to reserved space.
999The scheme-specific type is
1000.Qq Li "!6a945a3b-1dd2-11b2-99a6-080020736631"
1001for GPT.
1002.It Cm u-boot-env
1003A raw partition dedicated to U-Boot for storing its environment.
1004The scheme-specific type is
1005.Qq Li "!3de21764-95bd-54bd-a5c3-4abe786f38a8"
1006for GPT.
1007.It Cm vmware-vmfs
1008A partition that contains a VMware File System (VMFS).
1009The scheme-specific types are
1010.Qq Li "!251"
1011for MBR and
1012.Qq Li "!aa31e02a-400f-11db-9590-000c2911d1b8"
1013for GPT.
1014.It Cm vmware-vmkdiag
1015A partition that contains a VMware diagostic filesystem.
1016The scheme-specific types are
1017.Qq Li "!252"
1018for MBR and
1019.Qq Li "!9d275380-40ad-11db-bf97-000c2911d1b8"
1020for GPT.
1021.It Cm vmware-reserved
1022A VMware reserved partition.
1023The scheme-specific type is
1024.Qq Li "!9198effc-31c0-11db-8f-78-000c2911d1b8"
1025for GPT.
1026.It Cm vmware-vsanhdr
1027A partition claimed by VMware VSAN.
1028The scheme-specific type is
1029.Qq Li "!381cfccc-7288-11e0-92ee-000c2911d0b2"
1030for GPT.
1031.El
1032.Sh ATTRIBUTES
1033The scheme-specific attributes for EBR:
1034.Bl -tag -width ".Cm active"
1035.It Cm active
1036.El
1037.Pp
1038The scheme-specific attributes for GPT:
1039.Bl -tag -width ".Cm bootfailed"
1040.It Cm bootme
1041When set, the
1042.Nm gptboot
1043stage 1 boot loader will try to boot the system from this partition.
1044Multiple partitions can be marked with the
1045.Cm bootme
1046attribute.
1047See
1048.Xr gptboot 8
1049for more details.
1050.It Cm bootonce
1051Setting this attribute automatically sets the
1052.Cm bootme
1053attribute.
1054When set, the
1055.Nm gptboot
1056stage 1 boot loader will try to boot the system from this partition only once.
1057Multiple partitions can be marked with the
1058.Cm bootonce
1059and
1060.Cm bootme
1061attribute pairs.
1062See
1063.Xr gptboot 8
1064for more details.
1065.It Cm bootfailed
1066This attribute should not be manually managed.
1067It is managed by the
1068.Nm gptboot
1069stage 1 boot loader and the
1070.Pa /etc/rc.d/gptboot
1071start-up script.
1072See
1073.Xr gptboot 8
1074for more details.
1075.It Cm lenovofix
1076Setting this attribute overwrites the Protective MBR with a new one where
1077the 0xee partition is the second, rather than the first record.
1078This resolves a BIOS compatibility issue with some Lenovo models including the
1079X220, T420, and T520, allowing them to boot from GPT partitioned disks
1080without using EFI.
1081.El
1082.Pp
1083The scheme-specific attributes for MBR:
1084.Bl -tag -width ".Cm active"
1085.It Cm active
1086.El
1087.Sh BOOTSTRAPPING
1088.Fx
1089supports several partitioning schemes and each scheme uses different
1090bootstrap code.
1091The bootstrap code is located in a specific disk area for each partitioning
1092scheme, and may vary in size for different schemes.
1093.Pp
1094Bootstrap code can be separated into two types.
1095The first type is embedded in the partitioning scheme's metadata, while the
1096second type is located on a specific partition.
1097Embedding bootstrap code should only be done with the
1098.Cm gpart bootcode
1099command with the
1100.Fl b Ar bootcode
1101option.
1102The GEOM PART class knows how to safely embed bootstrap code into
1103specific partitioning scheme metadata without causing any damage.
1104.Pp
1105The Master Boot Record (MBR) uses a 512-byte bootstrap code image, embedded
1106into the partition table's metadata area.
1107There are two variants of this bootstrap code:
1108.Pa /boot/mbr
1109and
1110.Pa /boot/boot0 .
1111.Pa /boot/mbr
1112searches for a partition with the
1113.Cm active
1114attribute (see the
1115.Sx ATTRIBUTES
1116section) in the partition table.
1117Then it runs next bootstrap stage.
1118The
1119.Pa /boot/boot0
1120image contains a boot manager with some additional interactive functions
1121for multi-booting from a user-selected partition.
1122.Pp
1123A BSD disklabel is usually created inside an MBR partition (slice)
1124with type
1125.Cm freebsd
1126(see the
1127.Sx "PARTITION TYPES"
1128section).
1129It uses 8 KB size bootstrap code image
1130.Pa /boot/boot ,
1131embedded into the partition table's metadata area.
1132.Pp
1133Both types of bootstrap code are used to boot from the GUID Partition Table.
1134First, a protective MBR is embedded into the first disk sector from the
1135.Pa /boot/pmbr
1136image.
1137It searches through the GPT for a
1138.Cm freebsd-boot
1139partition (see the
1140.Sx "PARTITION TYPES"
1141section) and runs the next bootstrap stage from it.
1142The
1143.Cm freebsd-boot
1144partition should be smaller than 545 KB.
1145It can be located either before or after other
1146.Fx
1147partitions on the disk.
1148There are two variants of bootstrap code to write to this partition:
1149.Pa /boot/gptboot
1150and
1151.Pa /boot/gptzfsboot .
1152.Pp
1153.Pa /boot/gptboot
1154is used to boot from UFS partitions.
1155.Cm gptboot
1156searches through
1157.Cm freebsd-ufs
1158partitions in the GPT and selects one to boot based on the
1159.Cm bootonce
1160and
1161.Cm bootme
1162attributes.
1163If neither attribute is found,
1164.Pa /boot/gptboot
1165boots from the first
1166.Cm freebsd-ufs
1167partition.
1168.Pa /boot/loader
1169.Pq the third bootstrap stage
1170is loaded from the first partition that matches these conditions.
1171See
1172.Xr gptboot 8
1173for more information.
1174.Pp
1175.Pa /boot/gptzfsboot
1176is used to boot from ZFS.
1177It searches through the GPT for
1178.Cm freebsd-zfs
1179partitions, trying to detect ZFS pools.
1180After all pools are detected,
1181.Pa /boot/loader
1182is started from the first one found set as bootable.
1183.Pp
1184The APM scheme also does not support embedding bootstrap code.
1185Instead, the 800 KBytes bootstrap code image
1186.Pa /boot/boot1.hfs
1187should be written with the
1188.Cm gpart bootcode
1189command to a partition of type
1190.Cm apple-boot ,
1191which should also be 800 KB in size.
1192.Sh OPERATIONAL FLAGS
1193Actions other than the
1194.Cm commit
1195and
1196.Cm undo
1197actions take an optional
1198.Fl f Ar flags
1199option.
1200This option is used to specify action-specific operational flags.
1201By default, the
1202.Nm
1203utility defines the
1204.Ql C
1205flag so that the action is immediately
1206committed.
1207The user can specify
1208.Dq Fl f Cm x
1209to have the action result in a pending change that can later, with
1210other pending changes, be committed as a single compound change with
1211the
1212.Cm commit
1213action or reverted with the
1214.Cm undo
1215action.
1216.Sh RECOVERING
1217The GEOM PART class supports recovering of partition tables only for GPT.
1218The GPT primary metadata is stored at the beginning of the device.
1219For redundancy, a secondary
1220.Pq backup
1221copy of the metadata is stored at the end of the device.
1222As a result of having two copies, some corruption of metadata is not
1223fatal to the working of GPT.
1224When the kernel detects corrupt metadata, it marks this table as corrupt
1225and reports the problem.
1226.Cm destroy
1227and
1228.Cm recover
1229are the only operations allowed on corrupt tables.
1230.Pp
1231If one GPT header appears to be corrupt but the other copy remains intact,
1232the kernel will log the following:
1233.Bd -literal -offset indent
1234GEOM: provider: the primary GPT table is corrupt or invalid.
1235GEOM: provider: using the secondary instead -- recovery strongly advised.
1236.Ed
1237.Pp
1238or
1239.Bd -literal -offset indent
1240GEOM: provider: the secondary GPT table is corrupt or invalid.
1241GEOM: provider: using the primary only -- recovery suggested.
1242.Ed
1243.Pp
1244Also
1245.Nm
1246commands such as
1247.Cm show , status
1248and
1249.Cm list
1250will report about corrupt tables.
1251.Pp
1252If the size of the device has changed (e.g.,\& volume expansion) the
1253secondary GPT header will no longer be located in the last sector.
1254This is not a metadata corruption, but it is dangerous because any
1255corruption of the primary GPT will lead to loss of the partition table.
1256This problem is reported by the kernel with the message:
1257.Bd -literal -offset indent
1258GEOM: provider: the secondary GPT header is not in the last LBA.
1259.Ed
1260.Pp
1261This situation can be recovered with the
1262.Cm recover
1263command.
1264This command reconstructs the corrupt metadata using known valid
1265metadata and relocates the secondary GPT to the end of the device.
1266.Pp
1267.Em NOTE :
1268The GEOM PART class can detect the same partition table visible through
1269different GEOM providers, and some of them will be marked as corrupt.
1270Be careful when choosing a provider for recovery.
1271If you choose incorrectly you can destroy the metadata of another GEOM class,
1272e.g.,\& GEOM MIRROR or GEOM LABEL.
1273.Sh SYSCTL VARIABLES
1274The following
1275.Xr sysctl 8
1276variables can be used to control the behavior of the
1277.Nm PART
1278GEOM class.
1279The default value is shown next to each variable.
1280.Bl -tag -width indent
1281.It Va kern.geom.part.allow_nesting : No 0
1282By default, some schemes (currently BSD and BSD64) do not permit
1283further nested partitioning.
1284This variable overrides this restriction and allows arbitrary nesting (except
1285within partitions created at offset 0).
1286Some schemes have their own separate checks, for which see below.
1287.It Va kern.geom.part.auto_resize : No 1
1288This variable controls automatic resize behavior of the
1289.Nm PART
1290GEOM class.
1291When this variable is enable and new size of provider is detected, the schema
1292metadata is resized but all changes are not saved to disk, until
1293.Cm gpart commit
1294is run to confirm changes.
1295This behavior is also reported with diagnostic message:
1296.Sy "GEOM_PART: (provider) was automatically resized."
1297.Sy "Use `gpart commit (provider)` to save changes or `gpart undo (provider)`"
1298.Sy "to revert them."
1299.It Va kern.geom.part.check_integrity : No 1
1300This variable controls the behaviour of metadata integrity checks.
1301When integrity checks are enabled, the
1302.Nm PART
1303GEOM class verifies all generic partition parameters obtained from the
1304disk metadata.
1305If some inconsistency is detected, the partition table will be
1306rejected with a diagnostic message:
1307.Sy "GEOM_PART: Integrity check failed (provider, scheme)" .
1308.It Va kern.geom.part.gpt.allow_nesting : No 0
1309By default the GPT scheme is allowed only at the outermost nesting level.
1310This variable allows this restriction to be removed.
1311.It Va kern.geom.part.ldm.debug : No 0
1312Debug level of the Logical Disk Manager (LDM) module.
1313This can be set to a number between 0 and 2 inclusive.
1314If set to 0 minimal debug information is printed,
1315and if set to 2 the maximum amount of debug information is printed.
1316.It Va kern.geom.part.ldm.show_mirrors : No 0
1317This variable controls how the Logical Disk Manager (LDM) module handles
1318mirrored volumes.
1319By default mirrored volumes are shown as partitions with type
1320.Cm ms-ldm-data
1321(see the
1322.Sx "PARTITION TYPES"
1323section).
1324If this variable set to 1 each component of the mirrored volume will be
1325present as independent partition.
1326.Em NOTE :
1327This may break a mirrored volume and lead to data damage.
1328.It Va kern.geom.part.mbr.enforce_chs : No 0
1329Specify how the Master Boot Record (MBR) module does alignment.
1330If this variable is set to a non-zero value, the module will automatically
1331recalculate the user-specified offset and size for alignment with the CHS
1332geometry.
1333Otherwise the values will be left unchanged.
1334.It Va kern.geom.part.separator : No ""
1335Specify an optional separator that will be inserted between the GEOM name
1336and partition name.
1337This variable is a
1338.Xr loader 8
1339tunable.
1340Note that setting this variable may break software which assumes a particular
1341naming scheme.
1342.El
1343.Sh EXIT STATUS
1344Exit status is 0 on success, and 1 if the command fails.
1345.Sh EXAMPLES
1346The examples below assume that the disk's logical block size is 512
1347bytes, regardless of its physical block size.
1348.Ss GPT
1349In this example, we will format
1350.Pa ada0
1351with the GPT scheme and create boot, swap and root partitions.
1352First, we need to create the partition table:
1353.Bd -literal -offset indent
1354/sbin/gpart create -s GPT ada0
1355.Ed
1356.Pp
1357Next, we install a protective MBR with the first-stage bootstrap code.
1358The protective MBR lists a single, bootable partition spanning the
1359entire disk, thus allowing non-GPT-aware BIOSes to boot from the disk
1360and preventing tools which do not understand the GPT scheme from
1361considering the disk to be unformatted.
1362.Bd -literal -offset indent
1363/sbin/gpart bootcode -b /boot/pmbr ada0
1364.Ed
1365.Pp
1366We then create a dedicated
1367.Cm freebsd-boot
1368partition to hold the second-stage boot loader, which will load the
1369.Fx
1370kernel and modules from a UFS or ZFS filesystem.
1371This partition must be larger than the bootstrap code
1372.Po
1373either
1374.Pa /boot/gptboot
1375for UFS or
1376.Pa /boot/gptzfsboot
1377for ZFS
1378.Pc ,
1379but smaller than 545 kB since the first-stage loader will load the
1380entire partition into memory during boot, regardless of how much data
1381it actually contains.
1382We create a 472-block (236 kB) boot partition at offset 40, which is
1383the size of the partition table (34 blocks or 17 kB) rounded up to the
1384nearest 4 kB boundary.
1385.Bd -literal -offset indent
1386/sbin/gpart add -b 40 -s 472 -t freebsd-boot ada0
1387/sbin/gpart bootcode -p /boot/gptboot -i 1 ada0
1388.Ed
1389.Pp
1390We now create a 4 GB swap partition at the first available offset,
1391which is 40 + 472 = 512 blocks (256 kB).
1392.Bd -literal -offset indent
1393/sbin/gpart add -s 4G -t freebsd-swap ada0
1394.Ed
1395.Pp
1396Aligning the swap partition and all subsequent partitions on a 256 kB
1397boundary ensures optimal performance on a wide range of media, from
1398plain old disks with 512-byte blocks, through modern
1399.Dq advanced format
1400disks with 4096-byte physical blocks, to RAID volumes with stripe
1401sizes of up to 256 kB.
1402.Pp
1403Finally, we create and format an 8 GB
1404.Cm freebsd-ufs
1405partition for the root filesystem, leaving the rest of the device free
1406for additional filesystems:
1407.Bd -literal -offset indent
1408/sbin/gpart add -s 8G -t freebsd-ufs ada0
1409/sbin/newfs -Uj /dev/ada0p3
1410.Ed
1411.Ss MBR
1412In this example, we will format
1413.Pa ada0
1414with the MBR scheme and create a single partition which we subdivide
1415using a traditional
1416.Bx
1417disklabel.
1418.Pp
1419First, we create the partition table as well as a single partition 64 GB in
1420size and an alignment of 4 kB, then we mark that partition active (bootable)
1421and install the first-stage boot loader:
1422.Bd -literal -offset indent
1423/sbin/gpart create -s MBR ada0
1424/sbin/gpart add -t freebsd -s 64G -a 4k ada0
1425/sbin/gpart set -a active -i 1 ada0
1426/sbin/gpart bootcode -b /boot/boot0 ada0
1427.Ed
1428.Pp
1429Next, we create a disklabel in that partition
1430.Po
1431.Dq slice
1432in disklabel terminology
1433.Pc
1434with room for up to 20 partitions:
1435.Bd -literal -offset indent
1436/sbin/gpart create -s BSD -n 20 ada0s1
1437.Ed
1438.Pp
1439We then create an 8 GB root partition and a 4 GB swap partition:
1440.Bd -literal -offset indent
1441/sbin/gpart add -t freebsd-ufs -s 8G ada0s1
1442/sbin/gpart add -t freebsd-swap -s 4G ada0s1
1443.Ed
1444.Pp
1445Finally, we install the appropriate boot loader for the
1446.Bx
1447label:
1448.Bd -literal -offset indent
1449/sbin/gpart bootcode -b /boot/boot ada0s1
1450.Ed
1451.Ss Deleting Partitions and Destroying the Partitioning Scheme
1452If a
1453.Em "Device busy"
1454error is shown when trying to destroy a partition table, remember that
1455all of the partitions must be deleted first with the
1456.Cm delete
1457action.
1458In this example,
1459.Pa da0
1460has three partitions:
1461.Bd -literal -offset indent
1462/sbin/gpart delete -i 3 da0
1463/sbin/gpart delete -i 2 da0
1464/sbin/gpart delete -i 1 da0
1465/sbin/gpart destroy da0
1466.Ed
1467.Pp
1468Rather than deleting each partition and then destroying the partitioning
1469scheme, the
1470.Fl F
1471option can be given with
1472.Cm destroy
1473to delete all of the partitions before destroying the partitioning scheme.
1474This is equivalent to the previous example:
1475.Bd -literal -offset indent
1476/sbin/gpart destroy -F da0
1477.Ed
1478.Ss Backup and Restore
1479Create a backup of the partition table from
1480.Pa da0 :
1481.Bd -literal -offset indent
1482/sbin/gpart backup da0 > da0.backup
1483.Ed
1484.Pp
1485Restore the partition table from the backup to
1486.Pa da0 :
1487.Bd -literal -offset indent
1488/sbin/gpart restore -l da0 < /mnt/da0.backup
1489.Ed
1490.Pp
1491Clone the partition table from
1492.Pa ada0
1493to
1494.Pa ada1
1495and
1496.Pa ada2 :
1497.Bd -literal -offset indent
1498/sbin/gpart backup ada0 | /sbin/gpart restore -F ada1 ada2
1499.Ed
1500.Sh SEE ALSO
1501.Xr geom 4 ,
1502.Xr boot0cfg 8 ,
1503.Xr geom 8 ,
1504.Xr glabel 8 ,
1505.Xr gptboot 8
1506.Sh HISTORY
1507The
1508.Nm
1509utility appeared in
1510.Fx 7.0 .
1511.Sh AUTHORS
1512.An Marcel Moolenaar Aq Mt marcel@FreeBSD.org
1513.Sh CAVEATS
1514Partition type
1515.Em apple-zfs
1516(6a898cc3-1dd2-11b2-99a6-080020736631) is also being used
1517on illumos/Solaris platforms for ZFS volumes.
1518