2014-09-29 09:56:43 +04:00
|
|
|
.\" $NetBSD: gpt.8,v 1.32 2014/09/29 05:56:43 jnemeth Exp $
|
2006-10-17 13:32:34 +04:00
|
|
|
.\"
|
2006-10-16 02:34:15 +04:00
|
|
|
.\" Copyright (c) 2002 Marcel Moolenaar
|
|
|
|
.\" All rights reserved.
|
|
|
|
.\"
|
|
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
|
|
.\" modification, are permitted provided that the following conditions
|
|
|
|
.\" are met:
|
|
|
|
.\"
|
|
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
|
|
.\"
|
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
|
|
|
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
|
|
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
|
|
.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
|
|
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
|
|
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
|
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
|
|
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
.\"
|
|
|
|
.\" $FreeBSD: src/sbin/gpt/gpt.8,v 1.17 2006/06/22 22:22:32 marcel Exp $
|
|
|
|
.\"
|
2014-09-29 09:56:43 +04:00
|
|
|
.Dd September 29, 2014
|
2006-10-16 02:34:15 +04:00
|
|
|
.Dt GPT 8
|
2009-03-09 22:24:26 +03:00
|
|
|
.Os
|
2006-10-16 02:34:15 +04:00
|
|
|
.Sh NAME
|
|
|
|
.Nm gpt
|
2006-10-17 13:32:34 +04:00
|
|
|
.Nd GUID partition table maintenance utility
|
2006-10-16 02:34:15 +04:00
|
|
|
.Sh SYNOPSIS
|
|
|
|
.Nm
|
|
|
|
.Op Ar general_options
|
|
|
|
.Ar command
|
|
|
|
.Op Ar command_options
|
|
|
|
.Ar device ...
|
|
|
|
.Sh DESCRIPTION
|
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
utility provides the necessary functionality to manipulate GUID partition
|
2013-10-24 10:59:03 +04:00
|
|
|
tables
|
|
|
|
.Pq GPTs ,
|
|
|
|
but see
|
2006-10-16 02:34:15 +04:00
|
|
|
.Sx BUGS
|
|
|
|
below for how and where functionality is missing.
|
|
|
|
The basic usage model of the
|
|
|
|
.Nm
|
|
|
|
tool follows that of the
|
|
|
|
.Xr cvs 1
|
|
|
|
tool.
|
|
|
|
The general options are described in the following paragraph.
|
|
|
|
The remaining paragraphs describe the individual commands with their options.
|
|
|
|
Here we conclude by mentioning that a
|
|
|
|
.Ar device
|
|
|
|
is either a special file
|
|
|
|
corresponding to a disk-like device or a regular file.
|
|
|
|
The command is applied to each
|
|
|
|
.Ar device
|
|
|
|
listed on the command line.
|
|
|
|
.Ss General Options
|
|
|
|
The general options allow the user to change default settings or otherwise
|
|
|
|
change the behaviour that is applicable to all commands.
|
|
|
|
Not all commands use all default settings, so some general options may not
|
|
|
|
have an effect on all commands.
|
|
|
|
.Pp
|
|
|
|
The
|
2013-11-22 07:50:05 +04:00
|
|
|
.Fl p Ar partitions
|
2006-10-16 02:34:15 +04:00
|
|
|
option allows the user to change the number of partitions the GPT can
|
2013-10-21 01:13:23 +04:00
|
|
|
accommodate.
|
2006-10-16 02:34:15 +04:00
|
|
|
This is used whenever a new GPT is created.
|
|
|
|
By default, the
|
|
|
|
.Nm
|
|
|
|
utility will create space for 128 partitions (or 32 sectors of 512 bytes).
|
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Fl r
|
|
|
|
option causes the
|
|
|
|
.Nm
|
|
|
|
utility to open the device for reading only.
|
|
|
|
Currently this option is primarily useful for the
|
|
|
|
.Ic show
|
|
|
|
command, but the intent
|
|
|
|
is to use it to implement dry-run behaviour.
|
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Fl v
|
|
|
|
option controls the verbosity level.
|
|
|
|
The level increases with every occurrence of this option.
|
|
|
|
There is no formalized definition of the different levels yet.
|
|
|
|
.Ss Commands
|
|
|
|
.Bl -tag -width indent
|
|
|
|
.\" ==== add ====
|
2013-11-22 07:50:05 +04:00
|
|
|
.It Nm Ic add Oo Fl a Ar alignment Oc Oo Fl b Ar blocknr Oc \
|
2013-12-08 13:32:51 +04:00
|
|
|
Oo Fl i Ar index Oc Oo Fl l Ar label Oc Oo Fl s Ar size Oc \
|
2009-03-11 21:02:00 +03:00
|
|
|
Oo Fl t Ar type Oc Ar device ...
|
2006-10-16 02:34:15 +04:00
|
|
|
The
|
|
|
|
.Ic add
|
|
|
|
command allows the user to add a new partition to an existing table.
|
|
|
|
By default, it will create a UFS partition covering the first available block
|
|
|
|
of an unused disk space.
|
|
|
|
The command-specific options can be used to control this behaviour.
|
|
|
|
.Pp
|
|
|
|
The
|
2013-11-19 09:03:41 +04:00
|
|
|
.Fl a Ar alignment
|
|
|
|
option allows the user to specify an alignment for the start and size.
|
|
|
|
The alignment may have a suffix to indicate its magnitude.
|
|
|
|
.Nm
|
|
|
|
will attempt to align the partition.
|
|
|
|
.Pp
|
|
|
|
The
|
2013-11-22 07:50:05 +04:00
|
|
|
.Fl b Ar blocknr
|
2006-10-16 02:34:15 +04:00
|
|
|
option allows the user to specify the starting (beginning) sector number of
|
|
|
|
the partition.
|
|
|
|
The minimum sector number is 1, but has to fall inside an unused region of
|
|
|
|
disk space that is covered by the GPT.
|
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Fl i Ar index
|
|
|
|
option allows the user to specify which (free) entry in the GPT table is to
|
|
|
|
be used for the new partition.
|
|
|
|
By default, the first free entry is selected.
|
|
|
|
.Pp
|
|
|
|
The
|
2013-11-19 09:03:41 +04:00
|
|
|
.Fl l Ar label
|
|
|
|
option allows the user to specify a label for the partition.
|
|
|
|
.Pp
|
|
|
|
The
|
2013-12-08 13:32:51 +04:00
|
|
|
.Fl s Ar size
|
|
|
|
option allows the user to specify the size of the partition.
|
|
|
|
If there is no suffix, or the suffix is
|
|
|
|
.Sq s
|
|
|
|
or
|
|
|
|
.Sq S
|
|
|
|
then size is in sectors, otherwise size is in bytes which must be
|
|
|
|
a multiple of the device's sector size.
|
|
|
|
The minimum size is 1 sector.
|
2006-10-16 02:34:15 +04:00
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Fl t Ar type
|
|
|
|
option allows the user to specify the partition type.
|
|
|
|
The type is given as an UUID, but
|
|
|
|
.Nm
|
|
|
|
accepts
|
2006-10-17 13:32:34 +04:00
|
|
|
.Cm efi , swap , ufs , hfs , linux ,
|
2011-02-09 08:11:15 +03:00
|
|
|
.Cm raid , lfs , ccd , cgd , bios ,
|
|
|
|
.Cm ffs ,
|
2006-10-16 02:34:15 +04:00
|
|
|
and
|
|
|
|
.Cm windows
|
|
|
|
as aliases for the most commonly used partition types.
|
2013-12-19 10:46:51 +04:00
|
|
|
.\" ==== backup ====
|
|
|
|
.It Nm Ic backup Ar device ...
|
|
|
|
The
|
|
|
|
.Ic backup
|
|
|
|
command dumps the MBR or (PMBR) and GPT partition tables to standard
|
|
|
|
output in a format to be used by the
|
|
|
|
.Ic restore
|
|
|
|
command.
|
|
|
|
The format is a plist.
|
|
|
|
It should not be modified.
|
2011-03-27 05:01:07 +04:00
|
|
|
.\" ==== biosboot ====
|
2014-09-29 09:56:43 +04:00
|
|
|
.It Nm Ic biosboot Oo Fl c Ar bootcode Oc Oo Fl i Ar index Oc \
|
|
|
|
Oo Fl L Ar label Oc Ar device ...
|
2011-03-27 05:01:07 +04:00
|
|
|
The
|
|
|
|
.Ic biosboot
|
|
|
|
command allows the user to configure the partition that contains the
|
|
|
|
primary bootstrap program, used during
|
|
|
|
.Xr boot 8 .
|
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Fl c
|
|
|
|
option allows the user to specify the filename that
|
|
|
|
.Nm
|
|
|
|
should read the bootcode from.
|
|
|
|
The default is to read from
|
2012-03-09 16:30:28 +04:00
|
|
|
.Pa /usr/mdec/gptmbr.bin .
|
2011-03-27 05:01:07 +04:00
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Fl i
|
|
|
|
option selects the partition that should contain the primary
|
|
|
|
bootstrap code, as installed via
|
|
|
|
.Xr installboot 8 .
|
2014-09-29 09:56:43 +04:00
|
|
|
The
|
|
|
|
.Fl L
|
|
|
|
option selects the partition by label.
|
|
|
|
If there are multiple partitions with the same label, it will use the
|
|
|
|
first one found.
|
2006-10-16 02:34:15 +04:00
|
|
|
.\" ==== create ====
|
|
|
|
.It Nm Ic create Oo Fl fp Oc Ar device ...
|
|
|
|
The
|
|
|
|
.Ic create
|
|
|
|
command allows the user to create a new (empty) GPT.
|
|
|
|
By default, one cannot create a GPT when the device contains a MBR,
|
|
|
|
however this can be overridden with the
|
|
|
|
.Fl f
|
|
|
|
option.
|
|
|
|
If the
|
|
|
|
.Fl f
|
|
|
|
option is specified, an existing MBR is destroyed and any partitions
|
|
|
|
described by the MBR are lost.
|
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Fl p
|
|
|
|
option tells
|
|
|
|
.Nm
|
|
|
|
to create only the primary table and not the backup table.
|
|
|
|
This option is only useful for debugging and should not be used otherwise.
|
|
|
|
.\" ==== destroy ====
|
|
|
|
.It Nm Ic destroy Oo Fl r Oc Ar device ...
|
|
|
|
The
|
|
|
|
.Ic destroy
|
|
|
|
command allows the user to destroy an existing, possibly not empty GPT.
|
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Fl r
|
|
|
|
option instructs
|
|
|
|
.Nm
|
|
|
|
to destroy the table in a way that it can be recovered.
|
|
|
|
.\" ==== label ====
|
2009-03-11 21:02:00 +03:00
|
|
|
.It Nm Ic label Oo Fl a Oc Ao Fl f Ar file | Fl l Ar label Ac Ar device ...
|
2013-11-22 07:50:05 +04:00
|
|
|
.It Nm Ic label Oo Fl b Ar blocknr Oc Oo Fl i Ar index Oc \
|
2014-09-29 09:56:43 +04:00
|
|
|
Oo Fl L Ar label Oc Oo Fl s Ar sectors Oc Oo Fl t Ar type Oc \
|
2009-03-11 21:02:00 +03:00
|
|
|
Ao Fl f Ar file | Fl l Ar label Ac Ar device ...
|
2006-10-16 02:34:15 +04:00
|
|
|
The
|
|
|
|
.Ic label
|
|
|
|
command allows the user to label any partitions that match the selection.
|
|
|
|
At least one of the following selection options must be specified.
|
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Fl a
|
|
|
|
option specifies that all partitions should be labeled.
|
|
|
|
It is mutually exclusive with all other selection options.
|
|
|
|
.Pp
|
|
|
|
The
|
2013-11-22 07:50:05 +04:00
|
|
|
.Fl b Ar blocknr
|
2006-10-16 02:34:15 +04:00
|
|
|
option selects the partition that starts at the given block number.
|
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Fl i Ar index
|
|
|
|
option selects the partition with the given partition number.
|
|
|
|
.Pp
|
|
|
|
The
|
2014-09-29 09:56:43 +04:00
|
|
|
.Fl L Ar label
|
|
|
|
option selects all partitions that have the given label.
|
|
|
|
This can cause multiple partitions to be relabeled.
|
|
|
|
.Pp
|
|
|
|
The
|
2013-11-22 07:50:05 +04:00
|
|
|
.Fl s Ar sectors
|
2006-10-16 02:34:15 +04:00
|
|
|
option selects all partitions that have the given size.
|
2013-10-24 10:59:03 +04:00
|
|
|
This can cause multiple partitions to be labeled.
|
2006-10-16 02:34:15 +04:00
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Fl t Ar type
|
|
|
|
option selects all partitions that have the given type.
|
|
|
|
The type is given as an UUID or by the aliases that the
|
|
|
|
.Ic add
|
|
|
|
command accepts.
|
2013-10-24 10:59:03 +04:00
|
|
|
This can cause multiple partitions to be labeled.
|
2006-10-16 02:34:15 +04:00
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Fl f Ar file
|
|
|
|
or
|
|
|
|
.Fl l Ar label
|
|
|
|
options specify the new label to be assigned to the selected partitions.
|
|
|
|
The
|
|
|
|
.Fl f Ar file
|
|
|
|
option is used to read the label from the specified file.
|
|
|
|
Only the first line is read from the file and the trailing newline
|
|
|
|
character is stripped.
|
|
|
|
If the file name is the dash or minus sign
|
|
|
|
.Pq Fl ,
|
|
|
|
the label is read from
|
|
|
|
the standard input.
|
|
|
|
The
|
|
|
|
.Fl l Ar label
|
|
|
|
option is used to specify the label in the command line.
|
|
|
|
The label is assumed to be encoded in UTF-8.
|
|
|
|
.\" ==== migrate ====
|
|
|
|
.It Nm Ic migrate Oo Fl fs Oc Ar device ...
|
|
|
|
The
|
|
|
|
.Ic migrate
|
|
|
|
command allows the user to migrate an MBR-based disk partitioning into a
|
|
|
|
GPT-based partitioning.
|
|
|
|
By default, the MBR is not migrated when it contains partitions of an unknown
|
|
|
|
type.
|
|
|
|
This can be overridden with the
|
|
|
|
.Fl f
|
|
|
|
option.
|
|
|
|
Specifying the
|
|
|
|
.Fl f
|
|
|
|
option will cause unknown partitions to be ignored and any data in it
|
|
|
|
to be lost.
|
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Fl s
|
|
|
|
option prevents migrating
|
|
|
|
.Bx
|
|
|
|
disk labels into GPT partitions by creating
|
|
|
|
the GPT equivalent of a slice.
|
2013-10-24 10:59:03 +04:00
|
|
|
Note that the
|
|
|
|
.Fl s
|
|
|
|
option isn't applicable to
|
|
|
|
.Nx
|
|
|
|
partitions.
|
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Ic migrate
|
|
|
|
command requires space at the beginning and the end of the device outside
|
|
|
|
any partitions to store the GPTs.
|
|
|
|
Space is required for the GPT header
|
|
|
|
.Pq which takes one sector
|
|
|
|
and the GPT partition table.
|
|
|
|
See the
|
|
|
|
.Fl p
|
|
|
|
option
|
|
|
|
for the size of the GPT partition table.
|
|
|
|
By default, just about all devices have a minimum of 62 sectors free at the
|
|
|
|
beginning of the device, but don't have any free space at the end.
|
|
|
|
For the default GPT partition table size on a 512 byte sector size device,
|
|
|
|
33 sectors at the end of the device would need to be freed.
|
2011-09-19 14:40:35 +04:00
|
|
|
.\" ==== recover ====
|
|
|
|
.It Nm Ic recover Ar device ...
|
|
|
|
The
|
|
|
|
.Ic recover
|
|
|
|
command tries to restore the GPT partition label from the backup
|
|
|
|
near the end of the disk.
|
|
|
|
It is very useful in case the primary label was deleted.
|
2006-10-16 02:34:15 +04:00
|
|
|
.\" ==== remove ====
|
|
|
|
.It Nm Ic remove Oo Fl a Oc Ar device ...
|
2013-11-22 07:50:05 +04:00
|
|
|
.It Nm Ic remove Oo Fl b Ar blocknr Oc Oo Fl i Ar index Oc \
|
2014-09-29 09:56:43 +04:00
|
|
|
Oo Fl L Ar label Oc Oo Fl s Ar sectors Oc Oo Fl t Ar type Oc Ar device ...
|
2006-10-16 02:34:15 +04:00
|
|
|
The
|
|
|
|
.Ic remove
|
|
|
|
command allows the user to remove any and all partitions that match the
|
|
|
|
selection.
|
|
|
|
It uses the same selection options as the
|
|
|
|
.Ic label
|
|
|
|
command.
|
|
|
|
See above for a description of these options.
|
|
|
|
Partitions are removed by clearing the partition type.
|
|
|
|
No other information is changed.
|
2013-11-20 12:08:47 +04:00
|
|
|
.\" ==== resize ====
|
|
|
|
.It Nm Ic resize Fl i Ar index Oo Fl a Ar alignment Oc \
|
2013-12-08 13:32:51 +04:00
|
|
|
Oo Fl s Ar size Oc Ar device ...
|
2013-11-20 12:08:47 +04:00
|
|
|
The
|
|
|
|
.Ic resize
|
|
|
|
command allows the user to resize a partition.
|
2013-11-20 12:11:36 +04:00
|
|
|
The partition may be shrunk and if there is sufficient free space
|
2013-11-20 12:08:47 +04:00
|
|
|
immediately after it then it may be expanded.
|
|
|
|
The
|
|
|
|
.Fl s
|
|
|
|
option allows the new size to be specified, otherwise the partition will
|
|
|
|
be increased to the maximum available size.
|
2013-12-08 13:32:51 +04:00
|
|
|
If there is no suffix, or the suffix is
|
|
|
|
.Sq s
|
|
|
|
or
|
|
|
|
.Sq S
|
|
|
|
then size is in sectors, otherwise size is in bytes which must be
|
|
|
|
a multiple of the device's sector size.
|
|
|
|
The minimum size is 1 sector.
|
2013-11-20 12:08:47 +04:00
|
|
|
If the
|
|
|
|
.Fl a
|
|
|
|
option is specified then the size will be adjusted to be a multiple of
|
|
|
|
alignment if possible.
|
2014-09-23 11:47:54 +04:00
|
|
|
.\" ==== resizedisk ====
|
|
|
|
.It Nm Ic resizedisk Oo Fl s Ar size Oc Ar device ...
|
|
|
|
The
|
|
|
|
.Ic resizedisk
|
|
|
|
command allows the user to resize a disk.
|
|
|
|
With GPTs, a backup copy is stored at the end of the disk.
|
|
|
|
If the underlying medium changes size
|
|
|
|
.Pq or is going to change size ,
|
|
|
|
then the backup copy needs to be moved to the new end of the disk,
|
|
|
|
and the last sector available for data storage needs to be adjusted.
|
|
|
|
This command does that.
|
|
|
|
If the backup copy no longer exists due to the medium shrinking, then
|
|
|
|
a new backup copy will be created using the primary copy.
|
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Fl s
|
|
|
|
option allows the new size to be specified, otherwise the backup copy
|
|
|
|
will automatically be placed at the current end of the disk.
|
|
|
|
If there is no suffix, or the suffix is
|
|
|
|
.Sq s
|
|
|
|
or
|
|
|
|
.Sq S
|
|
|
|
then size is in sectors, otherwise size is in bytes which must be
|
|
|
|
a multiple of the device's sector size.
|
|
|
|
Using the
|
|
|
|
.Fl s
|
|
|
|
option allows you to move the backup copy prior to resizing the medium.
|
|
|
|
This is primarily useful when shrinking the medium.
|
2014-09-21 02:36:09 +04:00
|
|
|
.\" ==== restore ====
|
|
|
|
.It Nm Ic restore Oo Fl F Oc Ar device ...
|
|
|
|
The
|
|
|
|
.Ic restore
|
|
|
|
command restores a partition table that was previously saved using the
|
|
|
|
.Ic backup
|
|
|
|
command.
|
|
|
|
The partition table is read from standard input and is expected to be in
|
|
|
|
the format of a plist.
|
|
|
|
It assumes an empty disk.
|
|
|
|
The
|
|
|
|
.Fl F
|
|
|
|
option can be used to blank the disk.
|
|
|
|
The new disk does not have to be the same size as the old disk as long as all
|
|
|
|
the partitions fit, as
|
|
|
|
.Ic restore
|
|
|
|
will automatically adjust.
|
|
|
|
However, the new disk must use the same sector size as the old disk.
|
2013-12-09 12:03:17 +04:00
|
|
|
.\" ==== set ====
|
|
|
|
.It Nm Ic set Fl a Ar attribute Fl i Ar index Ar device ...
|
|
|
|
The
|
|
|
|
.Ic set
|
|
|
|
command sets various partition attributes.
|
|
|
|
The
|
|
|
|
.Fl a
|
2013-12-09 13:22:44 +04:00
|
|
|
option specifies which attributes to set and may be specified more than once.
|
2013-12-09 12:03:17 +04:00
|
|
|
The
|
|
|
|
.Fl i
|
|
|
|
option specifies which entry to update.
|
|
|
|
The possible attributes are
|
|
|
|
.Do biosboot Dc ,
|
|
|
|
.Do bootme Dc ,
|
|
|
|
.Do bootonce Dc , and
|
|
|
|
.Do bootfailed Dc .
|
|
|
|
The biosboot flag is used to indicate which partition should be booted
|
|
|
|
by legacy BIOS boot code.
|
|
|
|
See the
|
|
|
|
.Ic biosboot
|
|
|
|
command for more information.
|
|
|
|
The other three attributes are for compatibility with
|
|
|
|
.Fx
|
|
|
|
and are not currently used by any
|
|
|
|
.Nx
|
|
|
|
code.
|
|
|
|
They may be used by
|
|
|
|
.Nx
|
|
|
|
code in the future.
|
2006-10-16 02:34:15 +04:00
|
|
|
.\" ==== show ====
|
2013-11-30 23:43:53 +04:00
|
|
|
.It Nm Ic show Oo Fl glu Oc Oo Fl i Ar index Oc Ar device ...
|
2006-10-16 02:34:15 +04:00
|
|
|
The
|
|
|
|
.Ic show
|
|
|
|
command displays the current partitioning on the listed devices and gives
|
|
|
|
an overall view of the disk contents.
|
|
|
|
With the
|
2013-11-30 23:43:53 +04:00
|
|
|
.Fl g
|
|
|
|
option the GPT partition GUID will be displayed instead of the GPT partition
|
|
|
|
type.
|
|
|
|
With the
|
2006-10-16 02:34:15 +04:00
|
|
|
.Fl l
|
|
|
|
option the GPT partition label will be displayed instead of the GPT partition
|
|
|
|
type.
|
|
|
|
With the
|
|
|
|
.Fl u
|
|
|
|
option the GPT partition type is displayed as an UUID instead of in a
|
|
|
|
user friendly form.
|
2013-11-30 23:43:53 +04:00
|
|
|
With the
|
|
|
|
.Fl i
|
|
|
|
option, all the details of a particular GPT partition will be displayed.
|
2013-12-09 05:35:02 +04:00
|
|
|
The format of this display is subject to change.
|
2013-11-30 23:43:53 +04:00
|
|
|
None of the options have any effect on non-GPT partitions.
|
|
|
|
The order of precedence for the options are:
|
|
|
|
.Fl i ,
|
|
|
|
.Fl l ,
|
|
|
|
.Fl g ,
|
|
|
|
.Fl u .
|
2014-09-28 12:14:51 +04:00
|
|
|
.\" ==== type ====
|
|
|
|
.It Nm Ic type Oo Fl a Oc Fl T Ar newtype Ar device ...
|
|
|
|
.It Nm Ic type Oo Fl b Ar blocknr Oc Oo Fl i Ar index Oc \
|
2014-09-29 09:56:43 +04:00
|
|
|
Oo Fl L Ar label Oc Oo Fl s Ar sectors Oc Oo Fl t Ar type Oc \
|
|
|
|
Fl T Ar newtype Ar device ...
|
2014-09-28 12:14:51 +04:00
|
|
|
The
|
|
|
|
.Ic type
|
|
|
|
command allows the user to change the type of any and all partitions
|
|
|
|
that match the selection.
|
|
|
|
It uses the same selection options as the
|
|
|
|
.Ic label
|
|
|
|
command.
|
|
|
|
See above for a description of these options.
|
2013-12-09 12:03:17 +04:00
|
|
|
.\" ==== unset ====
|
|
|
|
.It Nm Ic unset Fl a Ar attribute Fl i Ar index Ar device ...
|
|
|
|
The
|
|
|
|
.Ic unset
|
|
|
|
command unsets various partition attributes.
|
|
|
|
The
|
|
|
|
.Fl a
|
2013-12-09 13:22:44 +04:00
|
|
|
option specifies which attributes to unset and may be specified more than once.
|
2013-12-09 12:03:17 +04:00
|
|
|
The
|
|
|
|
.Fl i
|
|
|
|
option specifies which entry to update.
|
|
|
|
The possible attributes are
|
|
|
|
.Do biosboot Dc ,
|
|
|
|
.Do bootme Dc ,
|
|
|
|
.Do bootonce Dc , and
|
|
|
|
.Do bootfailed Dc .
|
|
|
|
The biosboot flag is used to indicate which partition should be booted
|
|
|
|
by legacy BIOS boot code.
|
|
|
|
See the
|
|
|
|
.Ic biosboot
|
|
|
|
command for more information.
|
|
|
|
The other three attributes are for compatibility with
|
|
|
|
.Fx
|
|
|
|
and are not currently used by any
|
|
|
|
.Nx
|
|
|
|
code.
|
|
|
|
They may be used by
|
|
|
|
.Nx
|
|
|
|
code in the future.
|
2006-10-16 02:34:15 +04:00
|
|
|
.El
|
2011-11-11 17:26:45 +04:00
|
|
|
.Sh EXAMPLES
|
|
|
|
.Bd -literal
|
|
|
|
nas# gpt show wd3
|
|
|
|
start size index contents
|
|
|
|
0 1 PMBR
|
|
|
|
1 3907029167
|
|
|
|
nas# gpt create wd3
|
|
|
|
nas# gpt show wd3
|
|
|
|
start size index contents
|
|
|
|
0 1 PMBR
|
|
|
|
1 1 Pri GPT header
|
|
|
|
2 32 Pri GPT table
|
|
|
|
34 3907029101
|
|
|
|
3907029135 32 Sec GPT table
|
|
|
|
3907029167 1 Sec GPT header
|
|
|
|
nas# gpt add -s 10486224 -t swap -i 1 wd3
|
|
|
|
Partition added, use:
|
|
|
|
dkctl rwd3d addwedge dk<N> 34 10486224 <type>
|
|
|
|
to create a wedge for it
|
|
|
|
nas# gpt label -i 1 -l swap_1 wd3
|
|
|
|
parition 1 on rwd3d labeled swap_1
|
|
|
|
nas# gpt show wd3
|
|
|
|
start size index contents
|
|
|
|
0 1 PMBR
|
|
|
|
1 1 Pri GPT header
|
|
|
|
2 32 Pri GPT table
|
|
|
|
34 10486224 1 GPT part - NetBSD swap
|
|
|
|
10486258 3896542877
|
|
|
|
3907029135 32 Sec GPT table
|
|
|
|
3907029167 1 Sec GPT header
|
2013-10-24 10:59:03 +04:00
|
|
|
nas# gpt show -l wd3
|
|
|
|
start size index contents
|
|
|
|
0 1 PMBR
|
|
|
|
1 1 Pri GPT header
|
|
|
|
2 32 Pri GPT table
|
|
|
|
34 10486224 1 GPT part - "swap_1"
|
|
|
|
10486258 3896542877
|
|
|
|
3907029135 32 Sec GPT table
|
|
|
|
3907029167 1 Sec GPT header
|
2011-11-11 17:26:45 +04:00
|
|
|
nas#
|
|
|
|
.Ed
|
2006-10-16 02:34:15 +04:00
|
|
|
.Sh SEE ALSO
|
2011-03-27 05:01:07 +04:00
|
|
|
.Xr boot 8 ,
|
2006-10-16 02:34:15 +04:00
|
|
|
.Xr fdisk 8 ,
|
2011-03-27 05:01:07 +04:00
|
|
|
.Xr installboot 8 ,
|
2006-10-16 02:34:15 +04:00
|
|
|
.Xr mount 8 ,
|
|
|
|
.Xr newfs 8 ,
|
|
|
|
.Xr swapon 8
|
|
|
|
.Sh HISTORY
|
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
utility appeared in
|
|
|
|
.Fx 5.0
|
|
|
|
for ia64.
|
|
|
|
.Sh BUGS
|
|
|
|
The development of the
|
|
|
|
.Nm
|
|
|
|
utility is still work in progress.
|
|
|
|
Many necessary features are missing or partially implemented.
|
|
|
|
In practice this means that the manual page, supposed to describe these
|
|
|
|
features, is farther removed from being complete or useful.
|
|
|
|
As such, missing functionality is not even documented as missing.
|
|
|
|
However, it is believed that the currently present functionality is reliable
|
|
|
|
and stable enough that this tool can be used without bullet-proof footware if
|
|
|
|
one thinks one does not make mistakes.
|
|
|
|
.Pp
|
|
|
|
It is expected that the basic usage model does not change, but it is
|
|
|
|
possible that future versions will not be compatible in the strictest sense
|
|
|
|
of the word.
|
|
|
|
For example, the
|
2013-11-22 07:50:05 +04:00
|
|
|
.Fl p Ar partitions
|
2006-10-16 02:34:15 +04:00
|
|
|
option may be changed to a command option rather than a generic option.
|
|
|
|
There are only two commands that use it so there is a chance that the natural
|
|
|
|
tendency for people is to use it as a command option.
|
|
|
|
Also, options primarily intended for diagnostic or debug purposes may be
|
|
|
|
removed in future versions.
|
|
|
|
.Pp
|
|
|
|
Another possibility is that the current usage model is accompanied by
|
|
|
|
other interfaces to make the tool usable as a back-end.
|
|
|
|
This all depends on demand and thus feedback.
|