1 .\" $NetBSD: gpt.8,v 1.4 2009/03/09 19:24:27 joerg Exp $
3 .\" Copyright (c) 2002 Marcel Moolenaar
4 .\" All rights reserved.
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
10 .\" 1. Redistributions of source code must retain the above copyright
11 .\" notice, this list of conditions and the following disclaimer.
12 .\" 2. Redistributions in binary form must reproduce the above copyright
13 .\" notice, this list of conditions and the following disclaimer in the
14 .\" documentation and/or other materials provided with the distribution.
16 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18 .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19 .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20 .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 .\" $FreeBSD: src/sbin/gpt/gpt.8,v 1.17 2006/06/22 22:22:32 marcel Exp $
34 .Nd GUID partition table maintenance utility
37 .Op Ar general_options
39 .Op Ar command_options
44 utility provides the necessary functionality to manipulate GUID partition
45 tables (GPTs), but see
47 below for how and where functionality is missing.
48 The basic usage model of the
50 tool follows that of the
53 The general options are described in the following paragraph.
54 The remaining paragraphs describe the individual commands with their options.
55 Here we conclude by mentioning that a
57 is either a special file
58 corresponding to a disk-like device or a regular file.
59 The command is applied to each
61 listed on the command line.
63 The general options allow the user to change default settings or otherwise
64 change the behaviour that is applicable to all commands.
65 Not all commands use all default settings, so some general options may not
66 have an effect on all commands.
70 option allows the user to change the number of partitions the GPT can
72 This is used whenever a new GPT is created.
75 utility will create space for 128 partitions (or 32 sectors of 512 bytes).
81 utility to open the device for reading only.
82 Currently this option is primarily useful for the
84 command, but the intent
85 is to use it to implement dry-run behaviour.
89 option controls the verbosity level.
90 The level increases with every occurrence of this option.
91 There is no formalized definition of the different levels yet.
93 .Bl -tag -width indent
95 .It Nm Ic add Oo Fl b Ar number Oc Oo Fl i Ar index Oc Oo Fl s Ar count Oc \
96 Oo Fl t Ar type Oc Ar device ...
99 command allows the user to add a new partition to an existing table.
100 By default, it will create a UFS partition covering the first available block
101 of an unused disk space.
102 The command-specific options can be used to control this behaviour.
106 option allows the user to specify the starting (beginning) sector number of
108 The minimum sector number is 1, but has to fall inside an unused region of
109 disk space that is covered by the GPT.
113 option allows the user to specify which (free) entry in the GPT table is to
114 be used for the new partition.
115 By default, the first free entry is selected.
119 option allows the user to specify the size of the partition in sectors.
120 The minimum size is 1.
124 option allows the user to specify the partition type.
125 The type is given as an UUID, but
128 .Cm efi , swap , ufs , hfs , linux ,
131 as aliases for the most commonly used partition types.
133 .It Nm Ic create Oo Fl fp Oc Ar device ...
136 command allows the user to create a new (empty) GPT.
137 By default, one cannot create a GPT when the device contains a MBR,
138 however this can be overridden with the
143 option is specified, an existing MBR is destroyed and any partitions
144 described by the MBR are lost.
150 to create only the primary table and not the backup table.
151 This option is only useful for debugging and should not be used otherwise.
152 .\" ==== destroy ====
153 .It Nm Ic destroy Oo Fl r Oc Ar device ...
156 command allows the user to destroy an existing, possibly not empty GPT.
162 to destroy the table in a way that it can be recovered.
164 .It Nm Ic label Oo Fl a Oc Ao Fl f Ar file | Fl l Ar label Ac Ar device ...
165 .It Nm Ic label Oo Fl b Ar number Oc Oo Fl i Ar index Oc \
166 Oo Fl s Ar count Oc Oo Fl t Ar type Oc \
167 Ao Fl f Ar file | Fl l Ar label Ac Ar device ...
170 command allows the user to label any partitions that match the selection.
171 At least one of the following selection options must be specified.
175 option specifies that all partitions should be labeled.
176 It is mutually exclusive with all other selection options.
180 option selects the partition that starts at the given block number.
184 option selects the partition with the given partition number.
188 option selects all partitions that have the given size.
189 This can cause multiple partitions to be removed.
193 option selects all partitions that have the given type.
194 The type is given as an UUID or by the aliases that the
197 This can cause multiple partitions to be removed.
203 options specify the new label to be assigned to the selected partitions.
206 option is used to read the label from the specified file.
207 Only the first line is read from the file and the trailing newline
208 character is stripped.
209 If the file name is the dash or minus sign
211 the label is read from
215 option is used to specify the label in the command line.
216 The label is assumed to be encoded in UTF-8.
217 .\" ==== migrate ====
218 .It Nm Ic migrate Oo Fl fs Oc Ar device ...
221 command allows the user to migrate an MBR-based disk partitioning into a
222 GPT-based partitioning.
223 By default, the MBR is not migrated when it contains partitions of an unknown
225 This can be overridden with the
230 option will cause unknown partitions to be ignored and any data in it
235 option prevents migrating
237 disk labels into GPT partitions by creating
238 the GPT equivalent of a slice.
240 .It Nm Ic remove Oo Fl a Oc Ar device ...
241 .It Nm Ic remove Oo Fl b Ar number Oc Oo Fl i Ar index Oc \
242 Oo Fl s Ar count Oc Oo Fl t Ar type Oc Ar device ...
245 command allows the user to remove any and all partitions that match the
247 It uses the same selection options as the
250 See above for a description of these options.
251 Partitions are removed by clearing the partition type.
252 No other information is changed.
254 .It Nm Ic show Oo Fl lu Oc Ar device ...
257 command displays the current partitioning on the listed devices and gives
258 an overall view of the disk contents.
261 option the GPT partition label will be displayed instead of the GPT partition
263 The option has no effect on non-GPT partitions.
266 option the GPT partition type is displayed as an UUID instead of in a
270 option takes precedence over the
286 The development of the
288 utility is still work in progress.
289 Many necessary features are missing or partially implemented.
290 In practice this means that the manual page, supposed to describe these
291 features, is farther removed from being complete or useful.
292 As such, missing functionality is not even documented as missing.
293 However, it is believed that the currently present functionality is reliable
294 and stable enough that this tool can be used without bullet-proof footware if
295 one thinks one does not make mistakes.
297 It is expected that the basic usage model does not change, but it is
298 possible that future versions will not be compatible in the strictest sense
302 option may be changed to a command option rather than a generic option.
303 There are only two commands that use it so there is a chance that the natural
304 tendency for people is to use it as a command option.
305 Also, options primarily intended for diagnostic or debug purposes may be
306 removed in future versions.
308 Another possibility is that the current usage model is accompanied by
309 other interfaces to make the tool usable as a back-end.
310 This all depends on demand and thus feedback.