xref: /freebsd/lib/geom/part/gpart.8 (revision 783d3ff6d7fae619db8a7990b8a6387de0c677b5)
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 July 26, 2023
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-vinum
685A
686.Fx
687partition that contains a Vinum volume.
688The scheme-specific types are
689.Qq Li "!FreeBSD-Vinum"
690for APM, and
691.Qq Li "!516e7cb8-6ecf-11d6-8ff8-00022d09712b"
692for GPT.
693.It Cm freebsd-zfs
694A
695.Fx
696partition that contains a ZFS volume.
697The scheme-specific types are
698.Qq Li "!FreeBSD-ZFS"
699for APM, and
700.Qq Li "!516e7cba-6ecf-11d6-8ff8-00022d09712b"
701for GPT.
702.El
703.Pp
704Other symbolic names that can be used with the
705.Nm
706utility are:
707.Bl -tag -width ".Cm dragonfly-disklabel64"
708.It Cm apple-apfs
709An Apple macOS partition used for the Apple file system, APFS.
710.It Cm apple-core-storage
711An Apple Mac OS X partition used by logical volume manager known as
712Core Storage.
713The scheme-specific type is
714.Qq Li "!53746f72-6167-11aa-aa11-00306543ecac"
715for GPT.
716.It Cm apple-hfs
717An Apple Mac OS X partition that contains a HFS or HFS+ filesystem.
718The scheme-specific types are
719.Qq Li "!175"
720for MBR,
721.Qq Li "!Apple_HFS"
722for APM and
723.Qq Li "!48465300-0000-11aa-aa11-00306543ecac"
724for GPT.
725.It Cm apple-label
726An Apple Mac OS X partition dedicated to partition metadata that descibes
727disk device.
728The scheme-specific type is
729.Qq Li "!4c616265-6c00-11aa-aa11-00306543ecac"
730for GPT.
731.It Cm apple-raid
732An Apple Mac OS X partition used in a software RAID configuration.
733The scheme-specific type is
734.Qq Li "!52414944-0000-11aa-aa11-00306543ecac"
735for GPT.
736.It Cm apple-raid-offline
737An Apple Mac OS X partition used in a software RAID configuration.
738The scheme-specific type is
739.Qq Li "!52414944-5f4f-11aa-aa11-00306543ecac"
740for GPT.
741.It Cm apple-tv-recovery
742An Apple Mac OS X partition used by Apple TV.
743The scheme-specific type is
744.Qq Li "!5265636f-7665-11aa-aa11-00306543ecac"
745for GPT.
746.It Cm apple-ufs
747An Apple Mac OS X partition that contains a UFS filesystem.
748The scheme-specific types are
749.Qq Li "!168"
750for MBR,
751.Qq Li "!Apple_UNIX_SVR2"
752for APM and
753.Qq Li "!55465300-0000-11aa-aa11-00306543ecac"
754for GPT.
755.It Cm apple-zfs
756An Apple Mac OS X partition that contains a ZFS volume.
757The scheme-specific type is
758.Qq Li "!6a898cc3-1dd2-11b2-99a6-080020736631"
759for GPT.
760The same GUID is being used also for
761.Sy illumos/Solaris /usr partition .
762See
763.Sx CAVEATS
764section below.
765.It Cm dragonfly-label32
766A
767.Dx
768partition subdivided into filesystems with a
769.Bx
770disklabel.
771The scheme-specific type is
772.Qq Li "!9d087404-1ca5-11dc-8817-01301bb8a9f5"
773for GPT.
774.It Cm dragonfly-label64
775A
776.Dx
777partition subdivided into filesystems with a
778disklabel64.
779The scheme-specific type is
780.Qq Li "!3d48ce54-1d16-11dc-8696-01301bb8a9f5"
781for GPT.
782.It Cm dragonfly-legacy
783A legacy partition type used in
784.Dx .
785The scheme-specific type is
786.Qq Li "!bd215ab2-1d16-11dc-8696-01301bb8a9f5"
787for GPT.
788.It Cm dragonfly-ccd
789A
790.Dx
791partition used with Concatenated Disk driver.
792The scheme-specific type is
793.Qq Li "!dbd5211b-1ca5-11dc-8817-01301bb8a9f5"
794for GPT.
795.It Cm dragonfly-hammer
796A
797.Dx
798partition that contains a Hammer filesystem.
799The scheme-specific type is
800.Qq Li "!61dc63ac-6e38-11dc-8513-01301bb8a9f5"
801for GPT.
802.It Cm dragonfly-hammer2
803A
804.Dx
805partition that contains a Hammer2 filesystem.
806The scheme-specific type is
807.Qq Li "!5cbb9ad1-862d-11dc-a94d-01301bb8a9f5"
808for GPT.
809.It Cm dragonfly-swap
810A
811.Dx
812partition dedicated to swap space.
813The scheme-specific type is
814.Qq Li "!9d58fdbd-1ca5-11dc-8817-01301bb8a9f5"
815for GPT.
816.It Cm dragonfly-ufs
817A
818.Dx
819partition that contains an UFS1 filesystem.
820The scheme-specific type is
821.Qq Li "!9d94ce7c-1ca5-11dc-8817-01301bb8a9f5"
822for GPT.
823.It Cm dragonfly-vinum
824A
825.Dx
826partition used with Logical Volume Manager.
827The scheme-specific type is
828.Qq Li "!9dd4478f-1ca5-11dc-8817-01301bb8a9f5"
829for GPT.
830.It Cm ebr
831A partition subdivided into filesystems with a EBR.
832The scheme-specific type is
833.Qq Li "!5"
834for MBR.
835.It Cm fat16
836A partition that contains a FAT16 filesystem.
837The scheme-specific type is
838.Qq Li "!6"
839for MBR.
840.It Cm fat32
841A partition that contains a FAT32 filesystem.
842The scheme-specific type is
843.Qq Li "!11"
844for MBR.
845.It Cm fat32lba
846A partition that contains a FAT32 (LBA) filesystem.
847The scheme-specific type is
848.Qq Li "!12"
849for MBR.
850.It Cm hifive-fsbl
851A raw partition containing a HiFive first stage bootloader.
852The scheme-specific type is
853.Qq Li "!5b193300-fc78-40cd-8002-e86c45580b47"
854for GPT.
855.It Cm hifive-bbl
856A raw partition containing a HiFive second stage bootloader.
857The scheme-specific type is
858.Qq Li "!2e54b353-1271-4842-806f-e436d6af6985"
859for GPT.
860.It Cm linux-data
861A Linux partition that contains some filesystem with data.
862The scheme-specific types are
863.Qq Li "!131"
864for MBR and
865.Qq Li "!0fc63daf-8483-4772-8e79-3d69d8477de4"
866for GPT.
867.It Cm linux-lvm
868A Linux partition dedicated to Logical Volume Manager.
869The scheme-specific types are
870.Qq Li "!142"
871for MBR and
872.Qq Li "!e6d6d379-f507-44c2-a23c-238f2a3df928"
873for GPT.
874.It Cm linux-raid
875A Linux partition used in a software RAID configuration.
876The scheme-specific types are
877.Qq Li "!253"
878for MBR and
879.Qq Li "!a19d880f-05fc-4d3b-a006-743f0f84911e"
880for GPT.
881.It Cm linux-swap
882A Linux partition dedicated to swap space.
883The scheme-specific types are
884.Qq Li "!130"
885for MBR and
886.Qq Li "!0657fd6d-a4ab-43c4-84e5-0933c84b4f4f"
887for GPT.
888.It Cm mbr
889A partition that is sub-partitioned by a Master Boot Record (MBR).
890This type is known as
891.Qq Li "!024dee41-33e7-11d3-9d69-0008c781f39f"
892by GPT.
893.It Cm ms-basic-data
894A basic data partition (BDP) for Microsoft operating systems.
895In the GPT this type is the equivalent to partition types
896.Cm fat16 , fat32
897and
898.Cm ntfs
899in MBR.
900This type is used for GPT exFAT partitions.
901The scheme-specific type is
902.Qq Li "!ebd0a0a2-b9e5-4433-87c0-68b6b72699c7"
903for GPT.
904.It Cm ms-ldm-data
905A partition that contains Logical Disk Manager (LDM) volumes.
906The scheme-specific types are
907.Qq Li "!66"
908for MBR,
909.Qq Li "!af9b60a0-1431-4f62-bc68-3311714a69ad"
910for GPT.
911.It Cm ms-ldm-metadata
912A partition that contains Logical Disk Manager (LDM) database.
913The scheme-specific type is
914.Qq Li "!5808c8aa-7e8f-42e0-85d2-e1e90434cfb3"
915for GPT.
916.It Cm netbsd-ccd
917A
918.Nx
919partition used with Concatenated Disk driver.
920The scheme-specific type is
921.Qq Li "!2db519c4-b10f-11dc-b99b-0019d1879648"
922for GPT.
923.It Cm netbsd-cgd
924An encrypted
925.Nx
926partition.
927The scheme-specific type is
928.Qq Li "!2db519ec-b10f-11dc-b99b-0019d1879648"
929for GPT.
930.It Cm netbsd-ffs
931A
932.Nx
933partition that contains an UFS filesystem.
934The scheme-specific type is
935.Qq Li "!49f48d5a-b10e-11dc-b99b-0019d1879648"
936for GPT.
937.It Cm netbsd-lfs
938A
939.Nx
940partition that contains an LFS filesystem.
941The scheme-specific type is
942.Qq Li "!49f48d82-b10e-11dc-b99b-0019d1879648"
943for GPT.
944.It Cm netbsd-raid
945A
946.Nx
947partition used in a software RAID configuration.
948The scheme-specific type is
949.Qq Li "!49f48daa-b10e-11dc-b99b-0019d1879648"
950for GPT.
951.It Cm netbsd-swap
952A
953.Nx
954partition dedicated to swap space.
955The scheme-specific type is
956.Qq Li "!49f48d32-b10e-11dc-b99b-0019d1879648"
957for GPT.
958.It Cm ntfs
959A partition that contains a NTFS or exFAT filesystem.
960The scheme-specific type is
961.Qq Li "!7"
962for MBR.
963.It Cm prep-boot
964The system partition dedicated to storing boot loaders on some PowerPC systems,
965notably those made by IBM.
966The scheme-specific types are
967.Qq Li "!65"
968for MBR and
969.Qq Li "!9e1a2d38-c612-4316-aa26-8b49521e5a8b"
970for GPT.
971.It Cm solaris-boot
972A illumos/Solaris partition dedicated to boot loader.
973The scheme-specific type is
974.Qq Li "!6a82cb45-1dd2-11b2-99a6-080020736631"
975for GPT.
976.It Cm solaris-root
977A illumos/Solaris partition dedicated to root filesystem.
978The scheme-specific type is
979.Qq Li "!6a85cf4d-1dd2-11b2-99a6-080020736631"
980for GPT.
981.It Cm solaris-swap
982A illumos/Solaris partition dedicated to swap.
983The scheme-specific type is
984.Qq Li "!6a87c46f-1dd2-11b2-99a6-080020736631"
985for GPT.
986.It Cm solaris-backup
987A illumos/Solaris partition dedicated to backup.
988The scheme-specific type is
989.Qq Li "!6a8b642b-1dd2-11b2-99a6-080020736631"
990for GPT.
991.It Cm solaris-var
992A illumos/Solaris partition dedicated to /var filesystem.
993The scheme-specific type is
994.Qq Li "!6a8ef2e9-1dd2-11b2-99a6-080020736631"
995for GPT.
996.It Cm solaris-home
997A illumos/Solaris partition dedicated to /home filesystem.
998The scheme-specific type is
999.Qq Li "!6a90ba39-1dd2-11b2-99a6-080020736631"
1000for GPT.
1001.It Cm solaris-altsec
1002A illumos/Solaris partition dedicated to alternate sector.
1003The scheme-specific type is
1004.Qq Li "!6a9283a5-1dd2-11b2-99a6-080020736631"
1005for GPT.
1006.It Cm solaris-reserved
1007A illumos/Solaris partition dedicated to reserved space.
1008The scheme-specific type is
1009.Qq Li "!6a945a3b-1dd2-11b2-99a6-080020736631"
1010for GPT.
1011.It Cm vmware-vmfs
1012A partition that contains a VMware File System (VMFS).
1013The scheme-specific types are
1014.Qq Li "!251"
1015for MBR and
1016.Qq Li "!aa31e02a-400f-11db-9590-000c2911d1b8"
1017for GPT.
1018.It Cm vmware-vmkdiag
1019A partition that contains a VMware diagostic filesystem.
1020The scheme-specific types are
1021.Qq Li "!252"
1022for MBR and
1023.Qq Li "!9d275380-40ad-11db-bf97-000c2911d1b8"
1024for GPT.
1025.It Cm vmware-reserved
1026A VMware reserved partition.
1027The scheme-specific type is
1028.Qq Li "!9198effc-31c0-11db-8f-78-000c2911d1b8"
1029for GPT.
1030.It Cm vmware-vsanhdr
1031A partition claimed by VMware VSAN.
1032The scheme-specific type is
1033.Qq Li "!381cfccc-7288-11e0-92ee-000c2911d0b2"
1034for GPT.
1035.El
1036.Sh ATTRIBUTES
1037The scheme-specific attributes for EBR:
1038.Bl -tag -width ".Cm active"
1039.It Cm active
1040.El
1041.Pp
1042The scheme-specific attributes for GPT:
1043.Bl -tag -width ".Cm bootfailed"
1044.It Cm bootme
1045When set, the
1046.Nm gptboot
1047stage 1 boot loader will try to boot the system from this partition.
1048Multiple partitions can be marked with the
1049.Cm bootme
1050attribute.
1051See
1052.Xr gptboot 8
1053for more details.
1054.It Cm bootonce
1055Setting this attribute automatically sets the
1056.Cm bootme
1057attribute.
1058When set, the
1059.Nm gptboot
1060stage 1 boot loader will try to boot the system from this partition only once.
1061Multiple partitions can be marked with the
1062.Cm bootonce
1063and
1064.Cm bootme
1065attribute pairs.
1066See
1067.Xr gptboot 8
1068for more details.
1069.It Cm bootfailed
1070This attribute should not be manually managed.
1071It is managed by the
1072.Nm gptboot
1073stage 1 boot loader and the
1074.Pa /etc/rc.d/gptboot
1075start-up script.
1076See
1077.Xr gptboot 8
1078for more details.
1079.It Cm lenovofix
1080Setting this attribute overwrites the Protective MBR with a new one where
1081the 0xee partition is the second, rather than the first record.
1082This resolves a BIOS compatibility issue with some Lenovo models including the
1083X220, T420, and T520, allowing them to boot from GPT partitioned disks
1084without using EFI.
1085.El
1086.Pp
1087The scheme-specific attributes for MBR:
1088.Bl -tag -width ".Cm active"
1089.It Cm active
1090.El
1091.Sh BOOTSTRAPPING
1092.Fx
1093supports several partitioning schemes and each scheme uses different
1094bootstrap code.
1095The bootstrap code is located in a specific disk area for each partitioning
1096scheme, and may vary in size for different schemes.
1097.Pp
1098Bootstrap code can be separated into two types.
1099The first type is embedded in the partitioning scheme's metadata, while the
1100second type is located on a specific partition.
1101Embedding bootstrap code should only be done with the
1102.Cm gpart bootcode
1103command with the
1104.Fl b Ar bootcode
1105option.
1106The GEOM PART class knows how to safely embed bootstrap code into
1107specific partitioning scheme metadata without causing any damage.
1108.Pp
1109The Master Boot Record (MBR) uses a 512-byte bootstrap code image, embedded
1110into the partition table's metadata area.
1111There are two variants of this bootstrap code:
1112.Pa /boot/mbr
1113and
1114.Pa /boot/boot0 .
1115.Pa /boot/mbr
1116searches for a partition with the
1117.Cm active
1118attribute (see the
1119.Sx ATTRIBUTES
1120section) in the partition table.
1121Then it runs next bootstrap stage.
1122The
1123.Pa /boot/boot0
1124image contains a boot manager with some additional interactive functions
1125for multi-booting from a user-selected partition.
1126.Pp
1127A BSD disklabel is usually created inside an MBR partition (slice)
1128with type
1129.Cm freebsd
1130(see the
1131.Sx "PARTITION TYPES"
1132section).
1133It uses 8 KB size bootstrap code image
1134.Pa /boot/boot ,
1135embedded into the partition table's metadata area.
1136.Pp
1137Both types of bootstrap code are used to boot from the GUID Partition Table.
1138First, a protective MBR is embedded into the first disk sector from the
1139.Pa /boot/pmbr
1140image.
1141It searches through the GPT for a
1142.Cm freebsd-boot
1143partition (see the
1144.Sx "PARTITION TYPES"
1145section) and runs the next bootstrap stage from it.
1146The
1147.Cm freebsd-boot
1148partition should be smaller than 545 KB.
1149It can be located either before or after other
1150.Fx
1151partitions on the disk.
1152There are two variants of bootstrap code to write to this partition:
1153.Pa /boot/gptboot
1154and
1155.Pa /boot/gptzfsboot .
1156.Pp
1157.Pa /boot/gptboot
1158is used to boot from UFS partitions.
1159.Cm gptboot
1160searches through
1161.Cm freebsd-ufs
1162partitions in the GPT and selects one to boot based on the
1163.Cm bootonce
1164and
1165.Cm bootme
1166attributes.
1167If neither attribute is found,
1168.Pa /boot/gptboot
1169boots from the first
1170.Cm freebsd-ufs
1171partition.
1172.Pa /boot/loader
1173.Pq the third bootstrap stage
1174is loaded from the first partition that matches these conditions.
1175See
1176.Xr gptboot 8
1177for more information.
1178.Pp
1179.Pa /boot/gptzfsboot
1180is used to boot from ZFS.
1181It searches through the GPT for
1182.Cm freebsd-zfs
1183partitions, trying to detect ZFS pools.
1184After all pools are detected,
1185.Pa /boot/loader
1186is started from the first one found set as bootable.
1187.Pp
1188The APM scheme also does not support embedding bootstrap code.
1189Instead, the 800 KBytes bootstrap code image
1190.Pa /boot/boot1.hfs
1191should be written with the
1192.Cm gpart bootcode
1193command to a partition of type
1194.Cm apple-boot ,
1195which should also be 800 KB in size.
1196.Sh OPERATIONAL FLAGS
1197Actions other than the
1198.Cm commit
1199and
1200.Cm undo
1201actions take an optional
1202.Fl f Ar flags
1203option.
1204This option is used to specify action-specific operational flags.
1205By default, the
1206.Nm
1207utility defines the
1208.Ql C
1209flag so that the action is immediately
1210committed.
1211The user can specify
1212.Dq Fl f Cm x
1213to have the action result in a pending change that can later, with
1214other pending changes, be committed as a single compound change with
1215the
1216.Cm commit
1217action or reverted with the
1218.Cm undo
1219action.
1220.Sh RECOVERING
1221The GEOM PART class supports recovering of partition tables only for GPT.
1222The GPT primary metadata is stored at the beginning of the device.
1223For redundancy, a secondary
1224.Pq backup
1225copy of the metadata is stored at the end of the device.
1226As a result of having two copies, some corruption of metadata is not
1227fatal to the working of GPT.
1228When the kernel detects corrupt metadata, it marks this table as corrupt
1229and reports the problem.
1230.Cm destroy
1231and
1232.Cm recover
1233are the only operations allowed on corrupt tables.
1234.Pp
1235If one GPT header appears to be corrupt but the other copy remains intact,
1236the kernel will log the following:
1237.Bd -literal -offset indent
1238GEOM: provider: the primary GPT table is corrupt or invalid.
1239GEOM: provider: using the secondary instead -- recovery strongly advised.
1240.Ed
1241.Pp
1242or
1243.Bd -literal -offset indent
1244GEOM: provider: the secondary GPT table is corrupt or invalid.
1245GEOM: provider: using the primary only -- recovery suggested.
1246.Ed
1247.Pp
1248Also
1249.Nm
1250commands such as
1251.Cm show , status
1252and
1253.Cm list
1254will report about corrupt tables.
1255.Pp
1256If the size of the device has changed (e.g.,\& volume expansion) the
1257secondary GPT header will no longer be located in the last sector.
1258This is not a metadata corruption, but it is dangerous because any
1259corruption of the primary GPT will lead to loss of the partition table.
1260This problem is reported by the kernel with the message:
1261.Bd -literal -offset indent
1262GEOM: provider: the secondary GPT header is not in the last LBA.
1263.Ed
1264.Pp
1265This situation can be recovered with the
1266.Cm recover
1267command.
1268This command reconstructs the corrupt metadata using known valid
1269metadata and relocates the secondary GPT to the end of the device.
1270.Pp
1271.Em NOTE :
1272The GEOM PART class can detect the same partition table visible through
1273different GEOM providers, and some of them will be marked as corrupt.
1274Be careful when choosing a provider for recovery.
1275If you choose incorrectly you can destroy the metadata of another GEOM class,
1276e.g.,\& GEOM MIRROR or GEOM LABEL.
1277.Sh SYSCTL VARIABLES
1278The following
1279.Xr sysctl 8
1280variables can be used to control the behavior of the
1281.Nm PART
1282GEOM class.
1283The default value is shown next to each variable.
1284.Bl -tag -width indent
1285.It Va kern.geom.part.allow_nesting : No 0
1286By default, some schemes (currently BSD and BSD64) do not permit
1287further nested partitioning.
1288This variable overrides this restriction and allows arbitrary nesting (except
1289within partitions created at offset 0).
1290Some schemes have their own separate checks, for which see below.
1291.It Va kern.geom.part.auto_resize : No 1
1292This variable controls automatic resize behavior of the
1293.Nm PART
1294GEOM class.
1295When this variable is enable and new size of provider is detected, the schema
1296metadata is resized but all changes are not saved to disk, until
1297.Cm gpart commit
1298is run to confirm changes.
1299This behavior is also reported with diagnostic message:
1300.Sy "GEOM_PART: (provider) was automatically resized."
1301.Sy "Use `gpart commit (provider)` to save changes or `gpart undo (provider)`"
1302.Sy "to revert them."
1303.It Va kern.geom.part.check_integrity : No 1
1304This variable controls the behaviour of metadata integrity checks.
1305When integrity checks are enabled, the
1306.Nm PART
1307GEOM class verifies all generic partition parameters obtained from the
1308disk metadata.
1309If some inconsistency is detected, the partition table will be
1310rejected with a diagnostic message:
1311.Sy "GEOM_PART: Integrity check failed (provider, scheme)" .
1312.It Va kern.geom.part.gpt.allow_nesting : No 0
1313By default the GPT scheme is allowed only at the outermost nesting level.
1314This variable allows this restriction to be removed.
1315.It Va kern.geom.part.ldm.debug : No 0
1316Debug level of the Logical Disk Manager (LDM) module.
1317This can be set to a number between 0 and 2 inclusive.
1318If set to 0 minimal debug information is printed,
1319and if set to 2 the maximum amount of debug information is printed.
1320.It Va kern.geom.part.ldm.show_mirrors : No 0
1321This variable controls how the Logical Disk Manager (LDM) module handles
1322mirrored volumes.
1323By default mirrored volumes are shown as partitions with type
1324.Cm ms-ldm-data
1325(see the
1326.Sx "PARTITION TYPES"
1327section).
1328If this variable set to 1 each component of the mirrored volume will be
1329present as independent partition.
1330.Em NOTE :
1331This may break a mirrored volume and lead to data damage.
1332.It Va kern.geom.part.mbr.enforce_chs : No 0
1333Specify how the Master Boot Record (MBR) module does alignment.
1334If this variable is set to a non-zero value, the module will automatically
1335recalculate the user-specified offset and size for alignment with the CHS
1336geometry.
1337Otherwise the values will be left unchanged.
1338.It Va kern.geom.part.separator : No ""
1339Specify an optional separator that will be inserted between the GEOM name
1340and partition name.
1341This variable is a
1342.Xr loader 8
1343tunable.
1344Note that setting this variable may break software which assumes a particular
1345naming scheme.
1346.El
1347.Sh EXIT STATUS
1348Exit status is 0 on success, and 1 if the command fails.
1349.Sh EXAMPLES
1350The examples below assume that the disk's logical block size is 512
1351bytes, regardless of its physical block size.
1352.Ss GPT
1353In this example, we will format
1354.Pa ada0
1355with the GPT scheme and create boot, swap and root partitions.
1356First, we need to create the partition table:
1357.Bd -literal -offset indent
1358/sbin/gpart create -s GPT ada0
1359.Ed
1360.Pp
1361Next, we install a protective MBR with the first-stage bootstrap code.
1362The protective MBR lists a single, bootable partition spanning the
1363entire disk, thus allowing non-GPT-aware BIOSes to boot from the disk
1364and preventing tools which do not understand the GPT scheme from
1365considering the disk to be unformatted.
1366.Bd -literal -offset indent
1367/sbin/gpart bootcode -b /boot/pmbr ada0
1368.Ed
1369.Pp
1370We then create a dedicated
1371.Cm freebsd-boot
1372partition to hold the second-stage boot loader, which will load the
1373.Fx
1374kernel and modules from a UFS or ZFS filesystem.
1375This partition must be larger than the bootstrap code
1376.Po
1377either
1378.Pa /boot/gptboot
1379for UFS or
1380.Pa /boot/gptzfsboot
1381for ZFS
1382.Pc ,
1383but smaller than 545 kB since the first-stage loader will load the
1384entire partition into memory during boot, regardless of how much data
1385it actually contains.
1386We create a 472-block (236 kB) boot partition at offset 40, which is
1387the size of the partition table (34 blocks or 17 kB) rounded up to the
1388nearest 4 kB boundary.
1389.Bd -literal -offset indent
1390/sbin/gpart add -b 40 -s 472 -t freebsd-boot ada0
1391/sbin/gpart bootcode -p /boot/gptboot -i 1 ada0
1392.Ed
1393.Pp
1394We now create a 4 GB swap partition at the first available offset,
1395which is 40 + 472 = 512 blocks (256 kB).
1396.Bd -literal -offset indent
1397/sbin/gpart add -s 4G -t freebsd-swap ada0
1398.Ed
1399.Pp
1400Aligning the swap partition and all subsequent partitions on a 256 kB
1401boundary ensures optimal performance on a wide range of media, from
1402plain old disks with 512-byte blocks, through modern
1403.Dq advanced format
1404disks with 4096-byte physical blocks, to RAID volumes with stripe
1405sizes of up to 256 kB.
1406.Pp
1407Finally, we create and format an 8 GB
1408.Cm freebsd-ufs
1409partition for the root filesystem, leaving the rest of the device free
1410for additional filesystems:
1411.Bd -literal -offset indent
1412/sbin/gpart add -s 8G -t freebsd-ufs ada0
1413/sbin/newfs -Uj /dev/ada0p3
1414.Ed
1415.Ss MBR
1416In this example, we will format
1417.Pa ada0
1418with the MBR scheme and create a single partition which we subdivide
1419using a traditional
1420.Bx
1421disklabel.
1422.Pp
1423First, we create the partition table as well as a single partition 64 GB in
1424size and an alignment of 4 kB, then we mark that partition active (bootable)
1425and install the first-stage boot loader:
1426.Bd -literal -offset indent
1427/sbin/gpart create -s MBR ada0
1428/sbin/gpart add -t freebsd -s 64G -a 4k ada0
1429/sbin/gpart set -a active -i 1 ada0
1430/sbin/gpart bootcode -b /boot/boot0 ada0
1431.Ed
1432.Pp
1433Next, we create a disklabel in that partition
1434.Po
1435.Dq slice
1436in disklabel terminology
1437.Pc
1438with room for up to 20 partitions:
1439.Bd -literal -offset indent
1440/sbin/gpart create -s BSD -n 20 ada0s1
1441.Ed
1442.Pp
1443We then create an 8 GB root partition and a 4 GB swap partition:
1444.Bd -literal -offset indent
1445/sbin/gpart add -t freebsd-ufs -s 8G ada0s1
1446/sbin/gpart add -t freebsd-swap -s 4G ada0s1
1447.Ed
1448.Pp
1449Finally, we install the appropriate boot loader for the
1450.Bx
1451label:
1452.Bd -literal -offset indent
1453/sbin/gpart bootcode -b /boot/boot ada0s1
1454.Ed
1455.Ss Deleting Partitions and Destroying the Partitioning Scheme
1456If a
1457.Em "Device busy"
1458error is shown when trying to destroy a partition table, remember that
1459all of the partitions must be deleted first with the
1460.Cm delete
1461action.
1462In this example,
1463.Pa da0
1464has three partitions:
1465.Bd -literal -offset indent
1466/sbin/gpart delete -i 3 da0
1467/sbin/gpart delete -i 2 da0
1468/sbin/gpart delete -i 1 da0
1469/sbin/gpart destroy da0
1470.Ed
1471.Pp
1472Rather than deleting each partition and then destroying the partitioning
1473scheme, the
1474.Fl F
1475option can be given with
1476.Cm destroy
1477to delete all of the partitions before destroying the partitioning scheme.
1478This is equivalent to the previous example:
1479.Bd -literal -offset indent
1480/sbin/gpart destroy -F da0
1481.Ed
1482.Ss Backup and Restore
1483Create a backup of the partition table from
1484.Pa da0 :
1485.Bd -literal -offset indent
1486/sbin/gpart backup da0 > da0.backup
1487.Ed
1488.Pp
1489Restore the partition table from the backup to
1490.Pa da0 :
1491.Bd -literal -offset indent
1492/sbin/gpart restore -l da0 < /mnt/da0.backup
1493.Ed
1494.Pp
1495Clone the partition table from
1496.Pa ada0
1497to
1498.Pa ada1
1499and
1500.Pa ada2 :
1501.Bd -literal -offset indent
1502/sbin/gpart backup ada0 | /sbin/gpart restore -F ada1 ada2
1503.Ed
1504.Sh SEE ALSO
1505.Xr geom 4 ,
1506.Xr boot0cfg 8 ,
1507.Xr geom 8 ,
1508.Xr glabel 8 ,
1509.Xr gptboot 8
1510.Sh HISTORY
1511The
1512.Nm
1513utility appeared in
1514.Fx 7.0 .
1515.Sh AUTHORS
1516.An Marcel Moolenaar Aq Mt marcel@FreeBSD.org
1517.Sh CAVEATS
1518Partition type
1519.Em apple-zfs
1520(6a898cc3-1dd2-11b2-99a6-080020736631) is also being used
1521on illumos/Solaris platforms for ZFS volumes.
1522