1 .\" Copyright (c) 2002 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
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\" notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\" notice, this list of conditions and the following disclaimer in the
12 .\" documentation and/or other materials provided with the distribution.
14 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
15 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
16 .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
17 .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
18 .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
19 .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20 .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
21 .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 .Nd "GUID partition table maintenance utility"
35 .Op Ar general_options
37 .Op Ar command_options
42 utility provides the necessary functionality to manipulate GUID partition
43 tables (GPTs), but see
45 below for how and where functionality is missing.
46 The basic usage model of the
48 tool follows that of the
51 The general options are described in the following paragraph.
52 The remaining paragraphs describe the individual commands with their options.
53 Here we conclude by mentioning that a
55 is either a special file
56 corresponding to a disk-like device or a regular file.
57 The command is applied to each
59 listed on the command line.
61 The general options allow the user to change default settings or otherwise
62 change the behaviour that is applicable to all commands.
63 Not all commands use all default settings, so some general options may not
64 have an effect on all commands.
68 option allows the user to change the number of partitions the GPT can
70 This is used whenever a new GPT is created.
73 utility will create space for 128 partitions (or 32 sectors of 512 bytes).
79 utility to open the device for reading only.
80 Currently this option is primarily useful for the
82 command, but the intent
83 is to use it to implement dry-run behaviour.
87 option controls the verbosity level.
88 The level increases with every occurrence of this option.
89 There is no formalized definition of the different levels yet.
91 .Bl -tag -width indent
104 command allows the user to add a new partition to an existing table.
105 By default, it will create a UFS partition covering the first available block
106 of an unused disk space.
107 The command-specific options can be used to control this behaviour.
111 option allows the user to specify the starting (beginning) sector number of
113 The minimum sector number is 1, but has to fall inside an unused region of
114 disk space that is covered by the GPT.
118 option allows the user to specify which (free) entry in the GPT table is to
119 be used for the new partition.
120 By default, the first free entry is selected.
124 option allows the user to specify the size of the partition in sectors.
125 The minimum size is 1.
129 option allows the user to specify the partition type.
130 The type is given as an UUID, but
133 .Cm boot , efi , swap , ufs , zfs , hfs , linux
136 as aliases for the most commonly used partition types.
148 command allows the user to make a GPT labeled disk bootable via the BIOS
149 bootstrap on i386 and amd64 machines.
153 boot loader is installed into the PMBR and the
155 boot loader is installed into the first boot partition.
156 If no boot partition exists and there is available space,
157 a boot partition will be created.
161 option allows the user to specify an alternate path for the PMBR boot loader.
165 option allows the user to specify an alternate path for the GPT boot loader
166 that is installed into the boot partition.
170 option allows the user to specify the size in sectors of the boot partition
171 if one does not already exist.
172 A boot partition must be at least 16 kilobytes.
174 a size of 64 kilobytes is used.
175 Note that the PMBR boot loader will load the entire boot partition into
177 As a result, the boot partition may not exceed 545 kilobytes.
179 .It Nm Ic create Oo Fl fp Oc Ar device ...
182 command allows the user to create a new (empty) GPT.
183 By default, one cannot create a GPT when the device contains a MBR,
184 however this can be overridden with the
189 option is specified, an existing MBR is destroyed and any partitions
190 described by the MBR are lost.
196 to create only the primary table and not the backup table.
197 This option is only useful for debugging and should not be used otherwise.
198 .\" ==== destroy ====
199 .It Nm Ic destroy Oo Fl r Oc Ar device ...
202 command allows the user to destroy an existing, possibly not empty GPT.
208 to destroy the table in a way that it can be recovered.
214 .Aq Fl f Ar file | Fl l Ar label
224 .Aq Fl f Ar file | Fl l Ar label
229 command allows the user to label any partitions that match the selection.
230 At least one of the following selection options must be specified.
234 option specifies that all partitions should be labeled.
235 It is mutually exclusive with all other selection options.
239 option selects the partition that starts at the given block number.
243 option selects the partition with the given partition number.
247 option selects all partitions that have the given size.
248 This can cause multiple partitions to be removed.
252 option selects all partitions that have the given type.
253 The type is given as an UUID or by the aliases that the
256 This can cause multiple partitions to be removed.
262 options specify the new label to be assigned to the selected partitions.
265 option is used to read the label from the specified file.
266 Only the first line is read from the file and the trailing newline
267 character is stripped.
268 If the file name is the dash or minus sign
270 the label is read from
274 option is used to specify the label in the command line.
275 The label is assumed to be encoded in UTF-8.
276 .\" ==== migrate ====
277 .It Nm Ic migrate Oo Fl fs Oc Ar device ...
280 command allows the user to migrate an MBR-based disk partitioning into a
281 GPT-based partitioning.
282 By default, the MBR is not migrated when it contains partitions of an unknown
284 This can be overridden with the
289 option will cause unknown partitions to be ignored and any data in it
294 option prevents migrating
296 disk labels into GPT partitions by creating
297 the GPT equivalent of a slice.
299 .It Nm Ic remove Oo Fl a Oc Ar device ...
311 command allows the user to remove any and all partitions that match the
313 It uses the same selection options as the
316 See above for a description of these options.
317 Partitions are removed by clearing the partition type.
318 No other information is changed.
320 .It Nm Ic show Oo Fl lu Oc Ar device ...
323 command displays the current partitioning on the listed devices and gives
324 an overall view of the disk contents.
327 option the GPT partition label will be displayed instead of the GPT partition
329 The option has no effect on non-GPT partitions.
332 option the GPT partition type is displayed as an UUID instead of in a
336 option takes precedence over the
352 The development of the
354 utility is still work in progress.
355 Many necessary features are missing or partially implemented.
356 In practice this means that the manual page, supposed to describe these
357 features, is farther removed from being complete or useful.
358 As such, missing functionality is not even documented as missing.
359 However, it is believed that the currently present functionality is reliable
360 and stable enough that this tool can be used without bullet-proof footware if
361 one thinks one does not make mistakes.
363 It is expected that the basic usage model does not change, but it is
364 possible that future versions will not be compatible in the strictest sense
368 option may be changed to a command option rather than a generic option.
369 There are only two commands that use it so there is a chance that the natural
370 tendency for people is to use it as a command option.
371 Also, options primarily intended for diagnostic or debug purposes may be
372 removed in future versions.
374 Another possibility is that the current usage model is accompanied by
375 other interfaces to make the tool usable as a back-end.
376 This all depends on demand and thus feedback.