History log of /netbsd-current/sbin/gpt/gpt.8
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.80 07-Nov-2023 gutteridge

gpt.8: fix grammar in a sentence


# 1.79 31-Oct-2023 martin

Apply patch from Thierry Laronde: add missing suffixes for size values
and clarify that they are case independant.


# 1.78 15-Jul-2023 gutteridge

gpt.8: fix some grammar

(The BUGS section seems perhaps a little outdated in its warnings of
potential incompatible changes.)


# 1.77 15-Jul-2023 gutteridge

gpt.8: drop cross-reference to cvs(1)

It's no more useful to reference cvs(1) than, say, openssl(1), and
should be self-evident, anyway.


Revision tags: netbsd-10-base
# 1.76 07-Apr-2022 kre

branches: 1.76.2;

Note that biosboot without -A clears the PMBR "active" flag.
While here, fix some grammar and make the selection options
for biosboot a little clearer.

Ride nia@'s Dd bump.


# 1.75 07-Apr-2022 nia

gpt.8: Clarify that "windows" partition types are also used for FAT32
("msdos" in NetBSD terms), and UDF partitions. Use the same name as
Wikipedia, "Microsoft basic data".


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base
# 1.74 27-Jul-2020 christos

catch up with source rename of fbsd-zfs -> zfs


# 1.73 24-May-2020 wiz

Fix typo in macro. Sort option descriptions.


# 1.72 24-May-2020 jmcneill

Add -H flag to ignore existing MBR (Hybrid MBR/GPT mode).


# 1.71 24-May-2020 jmcneill

Exit gracefully when auto-expanding a partition and it is already the
correct size. Add a -q flag to "resize" and "resizedisk" commands to skip
printing warnings in the already resize paths.


Revision tags: netbsd-9-3-RELEASE netbsd-9-2-RELEASE netbsd-9-1-RELEASE phil-wifi-20200421 phil-wifi-20200411 is-mlppp-base phil-wifi-20200406 netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base
# 1.70 26-Jul-2019 martin

Remove outdated note about sysinst restrictions


# 1.69 25-Jun-2019 jnemeth

Add an "uuid" command to generate a new UUID for a portion. The
primary intention is for use for after cloning disks to prevent
collisions.


Revision tags: phil-wifi-20190609
# 1.68 04-Apr-2019 martin

Allow specifying the partition via -b startsec for the biosboot cmd.


# 1.67 26-Mar-2019 martin

Allow -b to specify a partition for "gpt unset" as well.


# 1.66 25-Mar-2019 martin

Allow -b startsec to specify the partition to change for the set subcommand
as well.
Add another option, -N, as a quick way to remove all attributes.


# 1.65 24-Mar-2019 martin

Make the "show" subcommand accept -b startsec to identify a partition
(very usefull for scripts and other robotic callers).


# 1.64 24-Mar-2019 martin

Add support for specifying the partition to resize via -b startsec
(similar to label and other subcommands). Do not fully add gpt_find
functionality here, as resizing multiple partitions in one go does not
make sense.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502
# 1.63 01-May-2018 kre

branches: 1.63.2;

Spello. (it is "existence").

ispell also says that we should s/parseable/parsable/ but I'm
not sure about that one, so I left it.

I also left a correct spelling that no-one has bothered to mangle!


# 1.62 01-May-2018 wiz

Bump date for new EXIT STATUS section.


# 1.61 01-May-2018 wiz

Sort sections.


# 1.60 01-May-2018 martin

Make the "gpt header" command return EXIT_FAILURE when no GPT is present.
This helps sysinst to tell a GPT labeled disk from others.
Very lazy version of a change proposed by kre.


Revision tags: pgoyette-compat-0422 pgoyette-compat-0415
# 1.59 11-Apr-2018 mrg

add information about how to boot from gpt. mostly taken from the wiki.


Revision tags: pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322
# 1.58 19-Mar-2018 mlelstv

Check device parameter to avoid segfaults. Agument synopsis for -l option.


Revision tags: pgoyette-compat-0315 pgoyette-compat-base
# 1.57 15-Jan-2018 sborrill

branches: 1.57.2;
Explain what suffixes are accepted when specifying a size.


# 1.56 03-Oct-2017 mlelstv

clarify that alignment is the number of bytes to align to.


# 1.55 05-Aug-2017 wiz

Use Fx/Nx.


# 1.54 04-Aug-2017 kre

Fix a typo, and make a couple of minor wording improvements.
I resisted the (very weak) impulse to Americanise some spellings ...


# 1.53 03-Aug-2017 msaitoh

Add note about bootme flag:

The bootme flag is used to indicate which partiotion should be booted
by UEFI boot code.


Revision tags: matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320
# 1.52 16-Feb-2017 christos

branches: 1.52.4;
Add -T timestamp for reproducible builds.


# 1.51 27-Jan-2017 abhinav

Fix spelling of partition.


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104
# 1.50 01-Nov-2016 jdolecek

branches: 1.50.2;
remove dup line


Revision tags: localcount-20160914
# 1.49 11-Sep-2016 sevan

Document the version gpt first appeared.
Replace contractions.
Bump date.


Revision tags: pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.48 09-Jun-2016 christos

branches: 1.48.2;
Rename 'a' to set the active PMBR flag to 'A'


# 1.47 09-Jun-2016 kre

Fix rendering of biosboot command synopsis.


# 1.46 09-Jun-2016 christos

PR/51230: Add the ability to set the active flag in the PMBR.


# 1.45 25-Dec-2015 wiz

Simplify usage for gpt show.


# 1.44 25-Dec-2015 martin

Add a -a flag to the show command, so we can display the full GPT with
all information in one go.


# 1.43 06-Dec-2015 wiz

Bump date for previous.
Remove trailing whitespace.


# 1.42 06-Dec-2015 christos

Add listing commands for type, set and unset.
Add help and formatting for set and unset.
Change show to print all the attribute info in one line.


# 1.41 02-Dec-2015 christos

Allow backup and restore to operate on files.


# 1.40 01-Dec-2015 christos

Reflect reality better; we don't handle multiple devices anymore, and
the partitions option is only for the commands that support it.


# 1.39 01-Dec-2015 christos

Firs step of refactoring, remove all globals, factor out some common code,
handle alternate usage but not advertise it.


# 1.38 30-Nov-2015 christos

- automatically sync the wedge information unless -n is specified.
- document the general options in the traditional way.
- split the main program into a separate file.


# 1.37 03-Nov-2015 jnemeth

Add a "header" subcommand that displays information about the size of
the disk along with information from the GPT header if it exists.


# 1.36 06-Dec-2014 wiz

Bump date for previous.


# 1.35 06-Dec-2014 mlelstv

Add some more common partition types.


# 1.34 04-Oct-2014 wiz

Remove trailing whitespace.


# 1.33 04-Oct-2014 christos

Allow specifying sector and media size on the command line.


# 1.32 29-Sep-2014 jnemeth

PR/47990 - Dr. Wolfgang Stukenbrock -- add "-L <label>" as selector option


# 1.31 28-Sep-2014 jnemeth

PR/44218 - David Young -- add "type" subcommand to change a partition type


# 1.30 23-Sep-2014 jnemeth

- make gpt_gpt() available for use directly by subcommands
- create new resizedisk disk subcommand for relocating backup GPT


# 1.29 20-Sep-2014 jnemeth

document the new restore subcommand


Revision tags: netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 tls-maxphys-base
# 1.28 19-Dec-2013 wiz

branches: 1.28.4;
Bump date for previous.


# 1.27 19-Dec-2013 jnemeth

Add the backup subcommand. It dumps the contents of the partition
tables as a plist, which is readable by the restore subcommand.

XXX restore subcommand forthcoming


# 1.26 09-Dec-2013 wiz

Fix typo.


# 1.25 09-Dec-2013 jnemeth

Add two new subcommands, "set" and "unset". These were inspired by
FreeBSD's gpart(8), but the code is all mine. The purpose of these
is to set and unset partition attributes.


# 1.24 09-Dec-2013 jnemeth

For the "show -i <entry>" subcommand, print Start and Size both in
terms of number of sectors and bytes.


# 1.23 08-Dec-2013 jnemeth

For the add and resize subcommands, change the -s option. If there is
no suffix, or the suffix is 's' or 'S', size is in sectors (as before)
otherwise size is in bytes.


# 1.22 06-Dec-2013 jnemeth

Don't attempt to create/resize an unaligned partition if the attempt
to create/resize an aligned one failed. This simplifies the code
and prevents surprises. If the user wants an unaligned partition
in the case where an aligned one fails, they can simply retry the
command without the "-a" option. This change was requested by
wiz@, and after some thought I agree with it.


# 1.21 30-Nov-2013 jnemeth

Add two new options:

-g which shows the GUID for a partition
-i which shows all the gory details for a particular option

XXX the output format of -i is subject to change


# 1.20 22-Nov-2013 jnemeth

bump date


# 1.19 22-Nov-2013 jnemeth

In the manpage:
- s/-b number/-b blocknr/
- s/-s count/-s sectors/
- s/-p count/-p partitions/

In the program:
- s/-b lba/-b blocknr/
- s/-s lba/-s sectors/

This makes the documentation in the manpage and the program consistent
and makes it more clear what the parameters are. Also, "-s lba" was
just plain wrong since LBA stands for Logical Block Address[ing], and
the -s option didn't represent any kind of address, but rather a size.


# 1.18 20-Nov-2013 wiz

shrunk.


# 1.17 20-Nov-2013 jnemeth

Add a resize command. This command was inspired by FreeBSD's gpart(8),
but the code was written by myself.


# 1.16 19-Nov-2013 jnemeth

update synopsis for add subcommand


# 1.15 19-Nov-2013 jnemeth

Add two new options to the "add" subcommand:

-a alignment -- attempt to align the start and size of the partition
-l label -- supply a label for the partition

These options were inspired by FreeBSD's gpart(8) command, but the
code was written by me.


# 1.14 24-Oct-2013 jnemeth

- markup
- typo; the label command labels partitions, not remove them
- migrate -s isn't applicable to NetBSD
- add information about the space required for migration
- add a "gpt show -l" example


# 1.13 20-Oct-2013 jnemeth

revert typo fix; teach me to blindly take changes from upstream


# 1.12 19-Oct-2013 jnemeth

type fix: accommodate. -> accomodate.


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6 yamt-pagecache-base5
# 1.11 02-May-2012 jakllsch

branches: 1.11.2;
Bump date to date of previous change.


Revision tags: yamt-pagecache-base4
# 1.10 09-Mar-2012 drochner

fix a path


Revision tags: netbsd-6-base
# 1.9 11-Nov-2011 wiz

branches: 1.9.2;
Add an EXAMPLE section showing how to add a swap file system using gpt. Bump date.


Revision tags: yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.8 19-Sep-2011 wiz

branches: 1.8.2;
Minimally document gpt recover. Bump date.


Revision tags: cherry-xenmp-base
# 1.7 27-Mar-2011 jym

Document biosboot. Xref boot(8) and installboot(8).


Revision tags: bouyer-quota2-nbase bouyer-quota2-base
# 1.6 09-Feb-2011 schnoebe

List all the aliases supported for GPT partition types.


Revision tags: matt-mips64-premerge-20101231 matt-premerge-20091211 jym-xensuspend-nbase jym-xensuspend-base
# 1.5 11-Mar-2009 joerg

branches: 1.5.2;
Don't workaround ancient macro argument limit with .Xo/.Xc.


# 1.4 09-Mar-2009 joerg

Fix preamble to match order set out by mdoc(7). Discussed with wiz.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 netbsd-5-0-RC2 netbsd-5-0-RC1 netbsd-5-base matt-mips64-base2 netbsd-4-0-1-RELEASE wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 wrstuden-fixsa-newbase wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 wrstuden-revivesa-base yamt-pf42-base mjf-devfs2-base keiichi-mipv6-base matt-armv6-nbase matt-armv6-prevmlocking wrstuden-fixsa-base-1 netbsd-4-0-RELEASE cube-autoconf-base mjf-devfs-base netbsd-4-0-RC5 netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 matt-armv6-base matt-mips64-base hpcarm-cleanup-base wrstuden-fixsa-base netbsd-4-base
# 1.3 24-Nov-2006 christos

branches: 1.3.28;
fix spelling of accommodate; from Zapher.


# 1.2 17-Oct-2006 wiz

Serial comma. Add RCS Id. Remove superfluous quotes.


# 1.1 15-Oct-2006 christos

branches: 1.1.1;
Initial revision


# 1.79 31-Oct-2023 martin

Apply patch from Thierry Laronde: add missing suffixes for size values
and clarify that they are case independant.


# 1.78 15-Jul-2023 gutteridge

gpt.8: fix some grammar

(The BUGS section seems perhaps a little outdated in its warnings of
potential incompatible changes.)


# 1.77 15-Jul-2023 gutteridge

gpt.8: drop cross-reference to cvs(1)

It's no more useful to reference cvs(1) than, say, openssl(1), and
should be self-evident, anyway.


Revision tags: netbsd-10-base
# 1.76 07-Apr-2022 kre

Note that biosboot without -A clears the PMBR "active" flag.
While here, fix some grammar and make the selection options
for biosboot a little clearer.

Ride nia@'s Dd bump.


# 1.75 07-Apr-2022 nia

gpt.8: Clarify that "windows" partition types are also used for FAT32
("msdos" in NetBSD terms), and UDF partitions. Use the same name as
Wikipedia, "Microsoft basic data".


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base
# 1.74 27-Jul-2020 christos

catch up with source rename of fbsd-zfs -> zfs


# 1.73 24-May-2020 wiz

Fix typo in macro. Sort option descriptions.


# 1.72 24-May-2020 jmcneill

Add -H flag to ignore existing MBR (Hybrid MBR/GPT mode).


# 1.71 24-May-2020 jmcneill

Exit gracefully when auto-expanding a partition and it is already the
correct size. Add a -q flag to "resize" and "resizedisk" commands to skip
printing warnings in the already resize paths.


Revision tags: netbsd-9-3-RELEASE netbsd-9-2-RELEASE netbsd-9-1-RELEASE phil-wifi-20200421 phil-wifi-20200411 is-mlppp-base phil-wifi-20200406 netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base
# 1.70 26-Jul-2019 martin

Remove outdated note about sysinst restrictions


# 1.69 25-Jun-2019 jnemeth

Add an "uuid" command to generate a new UUID for a portion. The
primary intention is for use for after cloning disks to prevent
collisions.


Revision tags: phil-wifi-20190609
# 1.68 04-Apr-2019 martin

Allow specifying the partition via -b startsec for the biosboot cmd.


# 1.67 26-Mar-2019 martin

Allow -b to specify a partition for "gpt unset" as well.


# 1.66 25-Mar-2019 martin

Allow -b startsec to specify the partition to change for the set subcommand
as well.
Add another option, -N, as a quick way to remove all attributes.


# 1.65 24-Mar-2019 martin

Make the "show" subcommand accept -b startsec to identify a partition
(very usefull for scripts and other robotic callers).


# 1.64 24-Mar-2019 martin

Add support for specifying the partition to resize via -b startsec
(similar to label and other subcommands). Do not fully add gpt_find
functionality here, as resizing multiple partitions in one go does not
make sense.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502
# 1.63 01-May-2018 kre

branches: 1.63.2;

Spello. (it is "existence").

ispell also says that we should s/parseable/parsable/ but I'm
not sure about that one, so I left it.

I also left a correct spelling that no-one has bothered to mangle!


# 1.62 01-May-2018 wiz

Bump date for new EXIT STATUS section.


# 1.61 01-May-2018 wiz

Sort sections.


# 1.60 01-May-2018 martin

Make the "gpt header" command return EXIT_FAILURE when no GPT is present.
This helps sysinst to tell a GPT labeled disk from others.
Very lazy version of a change proposed by kre.


Revision tags: pgoyette-compat-0422 pgoyette-compat-0415
# 1.59 11-Apr-2018 mrg

add information about how to boot from gpt. mostly taken from the wiki.


Revision tags: pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322
# 1.58 19-Mar-2018 mlelstv

Check device parameter to avoid segfaults. Agument synopsis for -l option.


Revision tags: pgoyette-compat-0315 pgoyette-compat-base
# 1.57 15-Jan-2018 sborrill

branches: 1.57.2;
Explain what suffixes are accepted when specifying a size.


# 1.56 03-Oct-2017 mlelstv

clarify that alignment is the number of bytes to align to.


# 1.55 05-Aug-2017 wiz

Use Fx/Nx.


# 1.54 04-Aug-2017 kre

Fix a typo, and make a couple of minor wording improvements.
I resisted the (very weak) impulse to Americanise some spellings ...


# 1.53 03-Aug-2017 msaitoh

Add note about bootme flag:

The bootme flag is used to indicate which partiotion should be booted
by UEFI boot code.


Revision tags: matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320
# 1.52 16-Feb-2017 christos

branches: 1.52.4;
Add -T timestamp for reproducible builds.


# 1.51 27-Jan-2017 abhinav

Fix spelling of partition.


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104
# 1.50 01-Nov-2016 jdolecek

branches: 1.50.2;
remove dup line


Revision tags: localcount-20160914
# 1.49 11-Sep-2016 sevan

Document the version gpt first appeared.
Replace contractions.
Bump date.


Revision tags: pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.48 09-Jun-2016 christos

branches: 1.48.2;
Rename 'a' to set the active PMBR flag to 'A'


# 1.47 09-Jun-2016 kre

Fix rendering of biosboot command synopsis.


# 1.46 09-Jun-2016 christos

PR/51230: Add the ability to set the active flag in the PMBR.


# 1.45 25-Dec-2015 wiz

Simplify usage for gpt show.


# 1.44 25-Dec-2015 martin

Add a -a flag to the show command, so we can display the full GPT with
all information in one go.


# 1.43 06-Dec-2015 wiz

Bump date for previous.
Remove trailing whitespace.


# 1.42 06-Dec-2015 christos

Add listing commands for type, set and unset.
Add help and formatting for set and unset.
Change show to print all the attribute info in one line.


# 1.41 02-Dec-2015 christos

Allow backup and restore to operate on files.


# 1.40 01-Dec-2015 christos

Reflect reality better; we don't handle multiple devices anymore, and
the partitions option is only for the commands that support it.


# 1.39 01-Dec-2015 christos

Firs step of refactoring, remove all globals, factor out some common code,
handle alternate usage but not advertise it.


# 1.38 30-Nov-2015 christos

- automatically sync the wedge information unless -n is specified.
- document the general options in the traditional way.
- split the main program into a separate file.


# 1.37 03-Nov-2015 jnemeth

Add a "header" subcommand that displays information about the size of
the disk along with information from the GPT header if it exists.


# 1.36 06-Dec-2014 wiz

Bump date for previous.


# 1.35 06-Dec-2014 mlelstv

Add some more common partition types.


# 1.34 04-Oct-2014 wiz

Remove trailing whitespace.


# 1.33 04-Oct-2014 christos

Allow specifying sector and media size on the command line.


# 1.32 29-Sep-2014 jnemeth

PR/47990 - Dr. Wolfgang Stukenbrock -- add "-L <label>" as selector option


# 1.31 28-Sep-2014 jnemeth

PR/44218 - David Young -- add "type" subcommand to change a partition type


# 1.30 23-Sep-2014 jnemeth

- make gpt_gpt() available for use directly by subcommands
- create new resizedisk disk subcommand for relocating backup GPT


# 1.29 20-Sep-2014 jnemeth

document the new restore subcommand


Revision tags: netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 tls-maxphys-base
# 1.28 19-Dec-2013 wiz

branches: 1.28.4;
Bump date for previous.


# 1.27 19-Dec-2013 jnemeth

Add the backup subcommand. It dumps the contents of the partition
tables as a plist, which is readable by the restore subcommand.

XXX restore subcommand forthcoming


# 1.26 09-Dec-2013 wiz

Fix typo.


# 1.25 09-Dec-2013 jnemeth

Add two new subcommands, "set" and "unset". These were inspired by
FreeBSD's gpart(8), but the code is all mine. The purpose of these
is to set and unset partition attributes.


# 1.24 09-Dec-2013 jnemeth

For the "show -i <entry>" subcommand, print Start and Size both in
terms of number of sectors and bytes.


# 1.23 08-Dec-2013 jnemeth

For the add and resize subcommands, change the -s option. If there is
no suffix, or the suffix is 's' or 'S', size is in sectors (as before)
otherwise size is in bytes.


# 1.22 06-Dec-2013 jnemeth

Don't attempt to create/resize an unaligned partition if the attempt
to create/resize an aligned one failed. This simplifies the code
and prevents surprises. If the user wants an unaligned partition
in the case where an aligned one fails, they can simply retry the
command without the "-a" option. This change was requested by
wiz@, and after some thought I agree with it.


# 1.21 30-Nov-2013 jnemeth

Add two new options:

-g which shows the GUID for a partition
-i which shows all the gory details for a particular option

XXX the output format of -i is subject to change


# 1.20 22-Nov-2013 jnemeth

bump date


# 1.19 22-Nov-2013 jnemeth

In the manpage:
- s/-b number/-b blocknr/
- s/-s count/-s sectors/
- s/-p count/-p partitions/

In the program:
- s/-b lba/-b blocknr/
- s/-s lba/-s sectors/

This makes the documentation in the manpage and the program consistent
and makes it more clear what the parameters are. Also, "-s lba" was
just plain wrong since LBA stands for Logical Block Address[ing], and
the -s option didn't represent any kind of address, but rather a size.


# 1.18 20-Nov-2013 wiz

shrunk.


# 1.17 20-Nov-2013 jnemeth

Add a resize command. This command was inspired by FreeBSD's gpart(8),
but the code was written by myself.


# 1.16 19-Nov-2013 jnemeth

update synopsis for add subcommand


# 1.15 19-Nov-2013 jnemeth

Add two new options to the "add" subcommand:

-a alignment -- attempt to align the start and size of the partition
-l label -- supply a label for the partition

These options were inspired by FreeBSD's gpart(8) command, but the
code was written by me.


# 1.14 24-Oct-2013 jnemeth

- markup
- typo; the label command labels partitions, not remove them
- migrate -s isn't applicable to NetBSD
- add information about the space required for migration
- add a "gpt show -l" example


# 1.13 20-Oct-2013 jnemeth

revert typo fix; teach me to blindly take changes from upstream


# 1.12 19-Oct-2013 jnemeth

type fix: accommodate. -> accomodate.


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6 yamt-pagecache-base5
# 1.11 02-May-2012 jakllsch

branches: 1.11.2;
Bump date to date of previous change.


Revision tags: yamt-pagecache-base4
# 1.10 09-Mar-2012 drochner

fix a path


Revision tags: netbsd-6-base
# 1.9 11-Nov-2011 wiz

branches: 1.9.2;
Add an EXAMPLE section showing how to add a swap file system using gpt. Bump date.


Revision tags: yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.8 19-Sep-2011 wiz

branches: 1.8.2;
Minimally document gpt recover. Bump date.


Revision tags: cherry-xenmp-base
# 1.7 27-Mar-2011 jym

Document biosboot. Xref boot(8) and installboot(8).


Revision tags: bouyer-quota2-nbase bouyer-quota2-base
# 1.6 09-Feb-2011 schnoebe

List all the aliases supported for GPT partition types.


Revision tags: matt-mips64-premerge-20101231 matt-premerge-20091211 jym-xensuspend-nbase jym-xensuspend-base
# 1.5 11-Mar-2009 joerg

branches: 1.5.2;
Don't workaround ancient macro argument limit with .Xo/.Xc.


# 1.4 09-Mar-2009 joerg

Fix preamble to match order set out by mdoc(7). Discussed with wiz.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 netbsd-5-0-RC2 netbsd-5-0-RC1 netbsd-5-base matt-mips64-base2 netbsd-4-0-1-RELEASE wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 wrstuden-fixsa-newbase wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 wrstuden-revivesa-base yamt-pf42-base mjf-devfs2-base keiichi-mipv6-base matt-armv6-nbase matt-armv6-prevmlocking wrstuden-fixsa-base-1 netbsd-4-0-RELEASE cube-autoconf-base mjf-devfs-base netbsd-4-0-RC5 netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 matt-armv6-base matt-mips64-base hpcarm-cleanup-base wrstuden-fixsa-base netbsd-4-base
# 1.3 24-Nov-2006 christos

branches: 1.3.28;
fix spelling of accommodate; from Zapher.


# 1.2 17-Oct-2006 wiz

Serial comma. Add RCS Id. Remove superfluous quotes.


# 1.1 15-Oct-2006 christos

branches: 1.1.1;
Initial revision


# 1.78 15-Jul-2023 gutteridge

gpt.8: fix some grammar

(The BUGS section seems perhaps a little outdated in its warnings of
potential incompatible changes.)


# 1.77 15-Jul-2023 gutteridge

gpt.8: drop cross-reference to cvs(1)

It's no more useful to reference cvs(1) than, say, openssl(1), and
should be self-evident, anyway.


Revision tags: netbsd-10-base
# 1.76 07-Apr-2022 kre

Note that biosboot without -A clears the PMBR "active" flag.
While here, fix some grammar and make the selection options
for biosboot a little clearer.

Ride nia@'s Dd bump.


# 1.75 07-Apr-2022 nia

gpt.8: Clarify that "windows" partition types are also used for FAT32
("msdos" in NetBSD terms), and UDF partitions. Use the same name as
Wikipedia, "Microsoft basic data".


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base
# 1.74 27-Jul-2020 christos

catch up with source rename of fbsd-zfs -> zfs


# 1.73 24-May-2020 wiz

Fix typo in macro. Sort option descriptions.


# 1.72 24-May-2020 jmcneill

Add -H flag to ignore existing MBR (Hybrid MBR/GPT mode).


# 1.71 24-May-2020 jmcneill

Exit gracefully when auto-expanding a partition and it is already the
correct size. Add a -q flag to "resize" and "resizedisk" commands to skip
printing warnings in the already resize paths.


Revision tags: netbsd-9-3-RELEASE netbsd-9-2-RELEASE netbsd-9-1-RELEASE phil-wifi-20200421 phil-wifi-20200411 is-mlppp-base phil-wifi-20200406 netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base
# 1.70 26-Jul-2019 martin

Remove outdated note about sysinst restrictions


# 1.69 25-Jun-2019 jnemeth

Add an "uuid" command to generate a new UUID for a portion. The
primary intention is for use for after cloning disks to prevent
collisions.


Revision tags: phil-wifi-20190609
# 1.68 04-Apr-2019 martin

Allow specifying the partition via -b startsec for the biosboot cmd.


# 1.67 26-Mar-2019 martin

Allow -b to specify a partition for "gpt unset" as well.


# 1.66 25-Mar-2019 martin

Allow -b startsec to specify the partition to change for the set subcommand
as well.
Add another option, -N, as a quick way to remove all attributes.


# 1.65 24-Mar-2019 martin

Make the "show" subcommand accept -b startsec to identify a partition
(very usefull for scripts and other robotic callers).


# 1.64 24-Mar-2019 martin

Add support for specifying the partition to resize via -b startsec
(similar to label and other subcommands). Do not fully add gpt_find
functionality here, as resizing multiple partitions in one go does not
make sense.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502
# 1.63 01-May-2018 kre

branches: 1.63.2;

Spello. (it is "existence").

ispell also says that we should s/parseable/parsable/ but I'm
not sure about that one, so I left it.

I also left a correct spelling that no-one has bothered to mangle!


# 1.62 01-May-2018 wiz

Bump date for new EXIT STATUS section.


# 1.61 01-May-2018 wiz

Sort sections.


# 1.60 01-May-2018 martin

Make the "gpt header" command return EXIT_FAILURE when no GPT is present.
This helps sysinst to tell a GPT labeled disk from others.
Very lazy version of a change proposed by kre.


Revision tags: pgoyette-compat-0422 pgoyette-compat-0415
# 1.59 11-Apr-2018 mrg

add information about how to boot from gpt. mostly taken from the wiki.


Revision tags: pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322
# 1.58 19-Mar-2018 mlelstv

Check device parameter to avoid segfaults. Agument synopsis for -l option.


Revision tags: pgoyette-compat-0315 pgoyette-compat-base
# 1.57 15-Jan-2018 sborrill

branches: 1.57.2;
Explain what suffixes are accepted when specifying a size.


# 1.56 03-Oct-2017 mlelstv

clarify that alignment is the number of bytes to align to.


# 1.55 05-Aug-2017 wiz

Use Fx/Nx.


# 1.54 04-Aug-2017 kre

Fix a typo, and make a couple of minor wording improvements.
I resisted the (very weak) impulse to Americanise some spellings ...


# 1.53 03-Aug-2017 msaitoh

Add note about bootme flag:

The bootme flag is used to indicate which partiotion should be booted
by UEFI boot code.


Revision tags: matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320
# 1.52 16-Feb-2017 christos

branches: 1.52.4;
Add -T timestamp for reproducible builds.


# 1.51 27-Jan-2017 abhinav

Fix spelling of partition.


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104
# 1.50 01-Nov-2016 jdolecek

branches: 1.50.2;
remove dup line


Revision tags: localcount-20160914
# 1.49 11-Sep-2016 sevan

Document the version gpt first appeared.
Replace contractions.
Bump date.


Revision tags: pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.48 09-Jun-2016 christos

branches: 1.48.2;
Rename 'a' to set the active PMBR flag to 'A'


# 1.47 09-Jun-2016 kre

Fix rendering of biosboot command synopsis.


# 1.46 09-Jun-2016 christos

PR/51230: Add the ability to set the active flag in the PMBR.


# 1.45 25-Dec-2015 wiz

Simplify usage for gpt show.


# 1.44 25-Dec-2015 martin

Add a -a flag to the show command, so we can display the full GPT with
all information in one go.


# 1.43 06-Dec-2015 wiz

Bump date for previous.
Remove trailing whitespace.


# 1.42 06-Dec-2015 christos

Add listing commands for type, set and unset.
Add help and formatting for set and unset.
Change show to print all the attribute info in one line.


# 1.41 02-Dec-2015 christos

Allow backup and restore to operate on files.


# 1.40 01-Dec-2015 christos

Reflect reality better; we don't handle multiple devices anymore, and
the partitions option is only for the commands that support it.


# 1.39 01-Dec-2015 christos

Firs step of refactoring, remove all globals, factor out some common code,
handle alternate usage but not advertise it.


# 1.38 30-Nov-2015 christos

- automatically sync the wedge information unless -n is specified.
- document the general options in the traditional way.
- split the main program into a separate file.


# 1.37 03-Nov-2015 jnemeth

Add a "header" subcommand that displays information about the size of
the disk along with information from the GPT header if it exists.


# 1.36 06-Dec-2014 wiz

Bump date for previous.


# 1.35 06-Dec-2014 mlelstv

Add some more common partition types.


# 1.34 04-Oct-2014 wiz

Remove trailing whitespace.


# 1.33 04-Oct-2014 christos

Allow specifying sector and media size on the command line.


# 1.32 29-Sep-2014 jnemeth

PR/47990 - Dr. Wolfgang Stukenbrock -- add "-L <label>" as selector option


# 1.31 28-Sep-2014 jnemeth

PR/44218 - David Young -- add "type" subcommand to change a partition type


# 1.30 23-Sep-2014 jnemeth

- make gpt_gpt() available for use directly by subcommands
- create new resizedisk disk subcommand for relocating backup GPT


# 1.29 20-Sep-2014 jnemeth

document the new restore subcommand


Revision tags: netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 tls-maxphys-base
# 1.28 19-Dec-2013 wiz

branches: 1.28.4;
Bump date for previous.


# 1.27 19-Dec-2013 jnemeth

Add the backup subcommand. It dumps the contents of the partition
tables as a plist, which is readable by the restore subcommand.

XXX restore subcommand forthcoming


# 1.26 09-Dec-2013 wiz

Fix typo.


# 1.25 09-Dec-2013 jnemeth

Add two new subcommands, "set" and "unset". These were inspired by
FreeBSD's gpart(8), but the code is all mine. The purpose of these
is to set and unset partition attributes.


# 1.24 09-Dec-2013 jnemeth

For the "show -i <entry>" subcommand, print Start and Size both in
terms of number of sectors and bytes.


# 1.23 08-Dec-2013 jnemeth

For the add and resize subcommands, change the -s option. If there is
no suffix, or the suffix is 's' or 'S', size is in sectors (as before)
otherwise size is in bytes.


# 1.22 06-Dec-2013 jnemeth

Don't attempt to create/resize an unaligned partition if the attempt
to create/resize an aligned one failed. This simplifies the code
and prevents surprises. If the user wants an unaligned partition
in the case where an aligned one fails, they can simply retry the
command without the "-a" option. This change was requested by
wiz@, and after some thought I agree with it.


# 1.21 30-Nov-2013 jnemeth

Add two new options:

-g which shows the GUID for a partition
-i which shows all the gory details for a particular option

XXX the output format of -i is subject to change


# 1.20 22-Nov-2013 jnemeth

bump date


# 1.19 22-Nov-2013 jnemeth

In the manpage:
- s/-b number/-b blocknr/
- s/-s count/-s sectors/
- s/-p count/-p partitions/

In the program:
- s/-b lba/-b blocknr/
- s/-s lba/-s sectors/

This makes the documentation in the manpage and the program consistent
and makes it more clear what the parameters are. Also, "-s lba" was
just plain wrong since LBA stands for Logical Block Address[ing], and
the -s option didn't represent any kind of address, but rather a size.


# 1.18 20-Nov-2013 wiz

shrunk.


# 1.17 20-Nov-2013 jnemeth

Add a resize command. This command was inspired by FreeBSD's gpart(8),
but the code was written by myself.


# 1.16 19-Nov-2013 jnemeth

update synopsis for add subcommand


# 1.15 19-Nov-2013 jnemeth

Add two new options to the "add" subcommand:

-a alignment -- attempt to align the start and size of the partition
-l label -- supply a label for the partition

These options were inspired by FreeBSD's gpart(8) command, but the
code was written by me.


# 1.14 24-Oct-2013 jnemeth

- markup
- typo; the label command labels partitions, not remove them
- migrate -s isn't applicable to NetBSD
- add information about the space required for migration
- add a "gpt show -l" example


# 1.13 20-Oct-2013 jnemeth

revert typo fix; teach me to blindly take changes from upstream


# 1.12 19-Oct-2013 jnemeth

type fix: accommodate. -> accomodate.


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6 yamt-pagecache-base5
# 1.11 02-May-2012 jakllsch

branches: 1.11.2;
Bump date to date of previous change.


Revision tags: yamt-pagecache-base4
# 1.10 09-Mar-2012 drochner

fix a path


Revision tags: netbsd-6-base
# 1.9 11-Nov-2011 wiz

branches: 1.9.2;
Add an EXAMPLE section showing how to add a swap file system using gpt. Bump date.


Revision tags: yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.8 19-Sep-2011 wiz

branches: 1.8.2;
Minimally document gpt recover. Bump date.


Revision tags: cherry-xenmp-base
# 1.7 27-Mar-2011 jym

Document biosboot. Xref boot(8) and installboot(8).


Revision tags: bouyer-quota2-nbase bouyer-quota2-base
# 1.6 09-Feb-2011 schnoebe

List all the aliases supported for GPT partition types.


Revision tags: matt-mips64-premerge-20101231 matt-premerge-20091211 jym-xensuspend-nbase jym-xensuspend-base
# 1.5 11-Mar-2009 joerg

branches: 1.5.2;
Don't workaround ancient macro argument limit with .Xo/.Xc.


# 1.4 09-Mar-2009 joerg

Fix preamble to match order set out by mdoc(7). Discussed with wiz.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 netbsd-5-0-RC2 netbsd-5-0-RC1 netbsd-5-base matt-mips64-base2 netbsd-4-0-1-RELEASE wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 wrstuden-fixsa-newbase wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 wrstuden-revivesa-base yamt-pf42-base mjf-devfs2-base keiichi-mipv6-base matt-armv6-nbase matt-armv6-prevmlocking wrstuden-fixsa-base-1 netbsd-4-0-RELEASE cube-autoconf-base mjf-devfs-base netbsd-4-0-RC5 netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 matt-armv6-base matt-mips64-base hpcarm-cleanup-base wrstuden-fixsa-base netbsd-4-base
# 1.3 24-Nov-2006 christos

branches: 1.3.28;
fix spelling of accommodate; from Zapher.


# 1.2 17-Oct-2006 wiz

Serial comma. Add RCS Id. Remove superfluous quotes.


# 1.1 15-Oct-2006 christos

branches: 1.1.1;
Initial revision


# 1.76 07-Apr-2022 kre

Note that biosboot without -A clears the PMBR "active" flag.
While here, fix some grammar and make the selection options
for biosboot a little clearer.

Ride nia@'s Dd bump.


# 1.75 07-Apr-2022 nia

gpt.8: Clarify that "windows" partition types are also used for FAT32
("msdos" in NetBSD terms), and UDF partitions. Use the same name as
Wikipedia, "Microsoft basic data".


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base
# 1.74 27-Jul-2020 christos

catch up with source rename of fbsd-zfs -> zfs


# 1.73 24-May-2020 wiz

Fix typo in macro. Sort option descriptions.


# 1.72 24-May-2020 jmcneill

Add -H flag to ignore existing MBR (Hybrid MBR/GPT mode).


# 1.71 24-May-2020 jmcneill

Exit gracefully when auto-expanding a partition and it is already the
correct size. Add a -q flag to "resize" and "resizedisk" commands to skip
printing warnings in the already resize paths.


Revision tags: netbsd-9-2-RELEASE netbsd-9-1-RELEASE phil-wifi-20200421 phil-wifi-20200411 is-mlppp-base phil-wifi-20200406 netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base
# 1.70 26-Jul-2019 martin

Remove outdated note about sysinst restrictions


# 1.69 25-Jun-2019 jnemeth

Add an "uuid" command to generate a new UUID for a portion. The
primary intention is for use for after cloning disks to prevent
collisions.


Revision tags: phil-wifi-20190609
# 1.68 04-Apr-2019 martin

Allow specifying the partition via -b startsec for the biosboot cmd.


# 1.67 26-Mar-2019 martin

Allow -b to specify a partition for "gpt unset" as well.


# 1.66 25-Mar-2019 martin

Allow -b startsec to specify the partition to change for the set subcommand
as well.
Add another option, -N, as a quick way to remove all attributes.


# 1.65 24-Mar-2019 martin

Make the "show" subcommand accept -b startsec to identify a partition
(very usefull for scripts and other robotic callers).


# 1.64 24-Mar-2019 martin

Add support for specifying the partition to resize via -b startsec
(similar to label and other subcommands). Do not fully add gpt_find
functionality here, as resizing multiple partitions in one go does not
make sense.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502
# 1.63 01-May-2018 kre

branches: 1.63.2;

Spello. (it is "existence").

ispell also says that we should s/parseable/parsable/ but I'm
not sure about that one, so I left it.

I also left a correct spelling that no-one has bothered to mangle!


# 1.62 01-May-2018 wiz

Bump date for new EXIT STATUS section.


# 1.61 01-May-2018 wiz

Sort sections.


# 1.60 01-May-2018 martin

Make the "gpt header" command return EXIT_FAILURE when no GPT is present.
This helps sysinst to tell a GPT labeled disk from others.
Very lazy version of a change proposed by kre.


Revision tags: pgoyette-compat-0422 pgoyette-compat-0415
# 1.59 11-Apr-2018 mrg

add information about how to boot from gpt. mostly taken from the wiki.


Revision tags: pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322
# 1.58 19-Mar-2018 mlelstv

Check device parameter to avoid segfaults. Agument synopsis for -l option.


Revision tags: pgoyette-compat-0315 pgoyette-compat-base
# 1.57 15-Jan-2018 sborrill

branches: 1.57.2;
Explain what suffixes are accepted when specifying a size.


# 1.56 03-Oct-2017 mlelstv

clarify that alignment is the number of bytes to align to.


# 1.55 05-Aug-2017 wiz

Use Fx/Nx.


# 1.54 04-Aug-2017 kre

Fix a typo, and make a couple of minor wording improvements.
I resisted the (very weak) impulse to Americanise some spellings ...


# 1.53 03-Aug-2017 msaitoh

Add note about bootme flag:

The bootme flag is used to indicate which partiotion should be booted
by UEFI boot code.


Revision tags: matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320
# 1.52 16-Feb-2017 christos

branches: 1.52.4;
Add -T timestamp for reproducible builds.


# 1.51 27-Jan-2017 abhinav

Fix spelling of partition.


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104
# 1.50 01-Nov-2016 jdolecek

branches: 1.50.2;
remove dup line


Revision tags: localcount-20160914
# 1.49 11-Sep-2016 sevan

Document the version gpt first appeared.
Replace contractions.
Bump date.


Revision tags: pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.48 09-Jun-2016 christos

branches: 1.48.2;
Rename 'a' to set the active PMBR flag to 'A'


# 1.47 09-Jun-2016 kre

Fix rendering of biosboot command synopsis.


# 1.46 09-Jun-2016 christos

PR/51230: Add the ability to set the active flag in the PMBR.


# 1.45 25-Dec-2015 wiz

Simplify usage for gpt show.


# 1.44 25-Dec-2015 martin

Add a -a flag to the show command, so we can display the full GPT with
all information in one go.


# 1.43 06-Dec-2015 wiz

Bump date for previous.
Remove trailing whitespace.


# 1.42 06-Dec-2015 christos

Add listing commands for type, set and unset.
Add help and formatting for set and unset.
Change show to print all the attribute info in one line.


# 1.41 02-Dec-2015 christos

Allow backup and restore to operate on files.


# 1.40 01-Dec-2015 christos

Reflect reality better; we don't handle multiple devices anymore, and
the partitions option is only for the commands that support it.


# 1.39 01-Dec-2015 christos

Firs step of refactoring, remove all globals, factor out some common code,
handle alternate usage but not advertise it.


# 1.38 30-Nov-2015 christos

- automatically sync the wedge information unless -n is specified.
- document the general options in the traditional way.
- split the main program into a separate file.


# 1.37 03-Nov-2015 jnemeth

Add a "header" subcommand that displays information about the size of
the disk along with information from the GPT header if it exists.


# 1.36 06-Dec-2014 wiz

Bump date for previous.


# 1.35 06-Dec-2014 mlelstv

Add some more common partition types.


# 1.34 04-Oct-2014 wiz

Remove trailing whitespace.


# 1.33 04-Oct-2014 christos

Allow specifying sector and media size on the command line.


# 1.32 29-Sep-2014 jnemeth

PR/47990 - Dr. Wolfgang Stukenbrock -- add "-L <label>" as selector option


# 1.31 28-Sep-2014 jnemeth

PR/44218 - David Young -- add "type" subcommand to change a partition type


# 1.30 23-Sep-2014 jnemeth

- make gpt_gpt() available for use directly by subcommands
- create new resizedisk disk subcommand for relocating backup GPT


# 1.29 20-Sep-2014 jnemeth

document the new restore subcommand


Revision tags: netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 tls-maxphys-base
# 1.28 19-Dec-2013 wiz

branches: 1.28.4;
Bump date for previous.


# 1.27 19-Dec-2013 jnemeth

Add the backup subcommand. It dumps the contents of the partition
tables as a plist, which is readable by the restore subcommand.

XXX restore subcommand forthcoming


# 1.26 09-Dec-2013 wiz

Fix typo.


# 1.25 09-Dec-2013 jnemeth

Add two new subcommands, "set" and "unset". These were inspired by
FreeBSD's gpart(8), but the code is all mine. The purpose of these
is to set and unset partition attributes.


# 1.24 09-Dec-2013 jnemeth

For the "show -i <entry>" subcommand, print Start and Size both in
terms of number of sectors and bytes.


# 1.23 08-Dec-2013 jnemeth

For the add and resize subcommands, change the -s option. If there is
no suffix, or the suffix is 's' or 'S', size is in sectors (as before)
otherwise size is in bytes.


# 1.22 06-Dec-2013 jnemeth

Don't attempt to create/resize an unaligned partition if the attempt
to create/resize an aligned one failed. This simplifies the code
and prevents surprises. If the user wants an unaligned partition
in the case where an aligned one fails, they can simply retry the
command without the "-a" option. This change was requested by
wiz@, and after some thought I agree with it.


# 1.21 30-Nov-2013 jnemeth

Add two new options:

-g which shows the GUID for a partition
-i which shows all the gory details for a particular option

XXX the output format of -i is subject to change


# 1.20 22-Nov-2013 jnemeth

bump date


# 1.19 22-Nov-2013 jnemeth

In the manpage:
- s/-b number/-b blocknr/
- s/-s count/-s sectors/
- s/-p count/-p partitions/

In the program:
- s/-b lba/-b blocknr/
- s/-s lba/-s sectors/

This makes the documentation in the manpage and the program consistent
and makes it more clear what the parameters are. Also, "-s lba" was
just plain wrong since LBA stands for Logical Block Address[ing], and
the -s option didn't represent any kind of address, but rather a size.


# 1.18 20-Nov-2013 wiz

shrunk.


# 1.17 20-Nov-2013 jnemeth

Add a resize command. This command was inspired by FreeBSD's gpart(8),
but the code was written by myself.


# 1.16 19-Nov-2013 jnemeth

update synopsis for add subcommand


# 1.15 19-Nov-2013 jnemeth

Add two new options to the "add" subcommand:

-a alignment -- attempt to align the start and size of the partition
-l label -- supply a label for the partition

These options were inspired by FreeBSD's gpart(8) command, but the
code was written by me.


# 1.14 24-Oct-2013 jnemeth

- markup
- typo; the label command labels partitions, not remove them
- migrate -s isn't applicable to NetBSD
- add information about the space required for migration
- add a "gpt show -l" example


# 1.13 20-Oct-2013 jnemeth

revert typo fix; teach me to blindly take changes from upstream


# 1.12 19-Oct-2013 jnemeth

type fix: accommodate. -> accomodate.


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6 yamt-pagecache-base5
# 1.11 02-May-2012 jakllsch

branches: 1.11.2;
Bump date to date of previous change.


Revision tags: yamt-pagecache-base4
# 1.10 09-Mar-2012 drochner

fix a path


Revision tags: netbsd-6-base
# 1.9 11-Nov-2011 wiz

branches: 1.9.2;
Add an EXAMPLE section showing how to add a swap file system using gpt. Bump date.


Revision tags: yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.8 19-Sep-2011 wiz

branches: 1.8.2;
Minimally document gpt recover. Bump date.


Revision tags: cherry-xenmp-base
# 1.7 27-Mar-2011 jym

Document biosboot. Xref boot(8) and installboot(8).


Revision tags: bouyer-quota2-nbase bouyer-quota2-base
# 1.6 09-Feb-2011 schnoebe

List all the aliases supported for GPT partition types.


Revision tags: matt-mips64-premerge-20101231 matt-premerge-20091211 jym-xensuspend-nbase jym-xensuspend-base
# 1.5 11-Mar-2009 joerg

branches: 1.5.2;
Don't workaround ancient macro argument limit with .Xo/.Xc.


# 1.4 09-Mar-2009 joerg

Fix preamble to match order set out by mdoc(7). Discussed with wiz.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 netbsd-5-0-RC2 netbsd-5-0-RC1 netbsd-5-base matt-mips64-base2 netbsd-4-0-1-RELEASE wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 wrstuden-fixsa-newbase wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 wrstuden-revivesa-base yamt-pf42-base mjf-devfs2-base keiichi-mipv6-base matt-armv6-nbase matt-armv6-prevmlocking wrstuden-fixsa-base-1 netbsd-4-0-RELEASE cube-autoconf-base mjf-devfs-base netbsd-4-0-RC5 netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 matt-armv6-base matt-mips64-base hpcarm-cleanup-base wrstuden-fixsa-base netbsd-4-base
# 1.3 24-Nov-2006 christos

branches: 1.3.28;
fix spelling of accommodate; from Zapher.


# 1.2 17-Oct-2006 wiz

Serial comma. Add RCS Id. Remove superfluous quotes.


# 1.1 15-Oct-2006 christos

branches: 1.1.1;
Initial revision


# 1.76 07-Apr-2022 kre

Note that biosboot without -A clears the PMBR "active" flag.
While here, fix some grammar and make the selection options
for biosboot a little clearer.

Ride nia@'s Dd bump.


# 1.75 07-Apr-2022 nia

gpt.8: Clarify that "windows" partition types are also used for FAT32
("msdos" in NetBSD terms), and UDF partitions. Use the same name as
Wikipedia, "Microsoft basic data".


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base
# 1.74 27-Jul-2020 christos

catch up with source rename of fbsd-zfs -> zfs


# 1.73 24-May-2020 wiz

Fix typo in macro. Sort option descriptions.


# 1.72 24-May-2020 jmcneill

Add -H flag to ignore existing MBR (Hybrid MBR/GPT mode).


# 1.71 24-May-2020 jmcneill

Exit gracefully when auto-expanding a partition and it is already the
correct size. Add a -q flag to "resize" and "resizedisk" commands to skip
printing warnings in the already resize paths.


Revision tags: netbsd-9-2-RELEASE netbsd-9-1-RELEASE phil-wifi-20200421 phil-wifi-20200411 is-mlppp-base phil-wifi-20200406 netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base
# 1.70 26-Jul-2019 martin

Remove outdated note about sysinst restrictions


# 1.69 25-Jun-2019 jnemeth

Add an "uuid" command to generate a new UUID for a portion. The
primary intention is for use for after cloning disks to prevent
collisions.


Revision tags: phil-wifi-20190609
# 1.68 04-Apr-2019 martin

Allow specifying the partition via -b startsec for the biosboot cmd.


# 1.67 26-Mar-2019 martin

Allow -b to specify a partition for "gpt unset" as well.


# 1.66 25-Mar-2019 martin

Allow -b startsec to specify the partition to change for the set subcommand
as well.
Add another option, -N, as a quick way to remove all attributes.


# 1.65 24-Mar-2019 martin

Make the "show" subcommand accept -b startsec to identify a partition
(very usefull for scripts and other robotic callers).


# 1.64 24-Mar-2019 martin

Add support for specifying the partition to resize via -b startsec
(similar to label and other subcommands). Do not fully add gpt_find
functionality here, as resizing multiple partitions in one go does not
make sense.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502
# 1.63 01-May-2018 kre

branches: 1.63.2;

Spello. (it is "existence").

ispell also says that we should s/parseable/parsable/ but I'm
not sure about that one, so I left it.

I also left a correct spelling that no-one has bothered to mangle!


# 1.62 01-May-2018 wiz

Bump date for new EXIT STATUS section.


# 1.61 01-May-2018 wiz

Sort sections.


# 1.60 01-May-2018 martin

Make the "gpt header" command return EXIT_FAILURE when no GPT is present.
This helps sysinst to tell a GPT labeled disk from others.
Very lazy version of a change proposed by kre.


Revision tags: pgoyette-compat-0422 pgoyette-compat-0415
# 1.59 11-Apr-2018 mrg

add information about how to boot from gpt. mostly taken from the wiki.


Revision tags: pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322
# 1.58 19-Mar-2018 mlelstv

Check device parameter to avoid segfaults. Agument synopsis for -l option.


Revision tags: pgoyette-compat-0315 pgoyette-compat-base
# 1.57 15-Jan-2018 sborrill

branches: 1.57.2;
Explain what suffixes are accepted when specifying a size.


# 1.56 03-Oct-2017 mlelstv

clarify that alignment is the number of bytes to align to.


# 1.55 05-Aug-2017 wiz

Use Fx/Nx.


# 1.54 04-Aug-2017 kre

Fix a typo, and make a couple of minor wording improvements.
I resisted the (very weak) impulse to Americanise some spellings ...


# 1.53 03-Aug-2017 msaitoh

Add note about bootme flag:

The bootme flag is used to indicate which partiotion should be booted
by UEFI boot code.


Revision tags: matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320
# 1.52 16-Feb-2017 christos

branches: 1.52.4;
Add -T timestamp for reproducible builds.


# 1.51 27-Jan-2017 abhinav

Fix spelling of partition.


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104
# 1.50 01-Nov-2016 jdolecek

branches: 1.50.2;
remove dup line


Revision tags: localcount-20160914
# 1.49 11-Sep-2016 sevan

Document the version gpt first appeared.
Replace contractions.
Bump date.


Revision tags: pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.48 09-Jun-2016 christos

branches: 1.48.2;
Rename 'a' to set the active PMBR flag to 'A'


# 1.47 09-Jun-2016 kre

Fix rendering of biosboot command synopsis.


# 1.46 09-Jun-2016 christos

PR/51230: Add the ability to set the active flag in the PMBR.


# 1.45 25-Dec-2015 wiz

Simplify usage for gpt show.


# 1.44 25-Dec-2015 martin

Add a -a flag to the show command, so we can display the full GPT with
all information in one go.


# 1.43 06-Dec-2015 wiz

Bump date for previous.
Remove trailing whitespace.


# 1.42 06-Dec-2015 christos

Add listing commands for type, set and unset.
Add help and formatting for set and unset.
Change show to print all the attribute info in one line.


# 1.41 02-Dec-2015 christos

Allow backup and restore to operate on files.


# 1.40 01-Dec-2015 christos

Reflect reality better; we don't handle multiple devices anymore, and
the partitions option is only for the commands that support it.


# 1.39 01-Dec-2015 christos

Firs step of refactoring, remove all globals, factor out some common code,
handle alternate usage but not advertise it.


# 1.38 30-Nov-2015 christos

- automatically sync the wedge information unless -n is specified.
- document the general options in the traditional way.
- split the main program into a separate file.


# 1.37 03-Nov-2015 jnemeth

Add a "header" subcommand that displays information about the size of
the disk along with information from the GPT header if it exists.


# 1.36 06-Dec-2014 wiz

Bump date for previous.


# 1.35 06-Dec-2014 mlelstv

Add some more common partition types.


# 1.34 04-Oct-2014 wiz

Remove trailing whitespace.


# 1.33 04-Oct-2014 christos

Allow specifying sector and media size on the command line.


# 1.32 29-Sep-2014 jnemeth

PR/47990 - Dr. Wolfgang Stukenbrock -- add "-L <label>" as selector option


# 1.31 28-Sep-2014 jnemeth

PR/44218 - David Young -- add "type" subcommand to change a partition type


# 1.30 23-Sep-2014 jnemeth

- make gpt_gpt() available for use directly by subcommands
- create new resizedisk disk subcommand for relocating backup GPT


# 1.29 20-Sep-2014 jnemeth

document the new restore subcommand


Revision tags: netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 tls-maxphys-base
# 1.28 19-Dec-2013 wiz

branches: 1.28.4;
Bump date for previous.


# 1.27 19-Dec-2013 jnemeth

Add the backup subcommand. It dumps the contents of the partition
tables as a plist, which is readable by the restore subcommand.

XXX restore subcommand forthcoming


# 1.26 09-Dec-2013 wiz

Fix typo.


# 1.25 09-Dec-2013 jnemeth

Add two new subcommands, "set" and "unset". These were inspired by
FreeBSD's gpart(8), but the code is all mine. The purpose of these
is to set and unset partition attributes.


# 1.24 09-Dec-2013 jnemeth

For the "show -i <entry>" subcommand, print Start and Size both in
terms of number of sectors and bytes.


# 1.23 08-Dec-2013 jnemeth

For the add and resize subcommands, change the -s option. If there is
no suffix, or the suffix is 's' or 'S', size is in sectors (as before)
otherwise size is in bytes.


# 1.22 06-Dec-2013 jnemeth

Don't attempt to create/resize an unaligned partition if the attempt
to create/resize an aligned one failed. This simplifies the code
and prevents surprises. If the user wants an unaligned partition
in the case where an aligned one fails, they can simply retry the
command without the "-a" option. This change was requested by
wiz@, and after some thought I agree with it.


# 1.21 30-Nov-2013 jnemeth

Add two new options:

-g which shows the GUID for a partition
-i which shows all the gory details for a particular option

XXX the output format of -i is subject to change


# 1.20 22-Nov-2013 jnemeth

bump date


# 1.19 22-Nov-2013 jnemeth

In the manpage:
- s/-b number/-b blocknr/
- s/-s count/-s sectors/
- s/-p count/-p partitions/

In the program:
- s/-b lba/-b blocknr/
- s/-s lba/-s sectors/

This makes the documentation in the manpage and the program consistent
and makes it more clear what the parameters are. Also, "-s lba" was
just plain wrong since LBA stands for Logical Block Address[ing], and
the -s option didn't represent any kind of address, but rather a size.


# 1.18 20-Nov-2013 wiz

shrunk.


# 1.17 20-Nov-2013 jnemeth

Add a resize command. This command was inspired by FreeBSD's gpart(8),
but the code was written by myself.


# 1.16 19-Nov-2013 jnemeth

update synopsis for add subcommand


# 1.15 19-Nov-2013 jnemeth

Add two new options to the "add" subcommand:

-a alignment -- attempt to align the start and size of the partition
-l label -- supply a label for the partition

These options were inspired by FreeBSD's gpart(8) command, but the
code was written by me.


# 1.14 24-Oct-2013 jnemeth

- markup
- typo; the label command labels partitions, not remove them
- migrate -s isn't applicable to NetBSD
- add information about the space required for migration
- add a "gpt show -l" example


# 1.13 20-Oct-2013 jnemeth

revert typo fix; teach me to blindly take changes from upstream


# 1.12 19-Oct-2013 jnemeth

type fix: accommodate. -> accomodate.


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6 yamt-pagecache-base5
# 1.11 02-May-2012 jakllsch

branches: 1.11.2;
Bump date to date of previous change.


Revision tags: yamt-pagecache-base4
# 1.10 09-Mar-2012 drochner

fix a path


Revision tags: netbsd-6-base
# 1.9 11-Nov-2011 wiz

branches: 1.9.2;
Add an EXAMPLE section showing how to add a swap file system using gpt. Bump date.


Revision tags: yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.8 19-Sep-2011 wiz

branches: 1.8.2;
Minimally document gpt recover. Bump date.


Revision tags: cherry-xenmp-base
# 1.7 27-Mar-2011 jym

Document biosboot. Xref boot(8) and installboot(8).


Revision tags: bouyer-quota2-nbase bouyer-quota2-base
# 1.6 09-Feb-2011 schnoebe

List all the aliases supported for GPT partition types.


Revision tags: matt-mips64-premerge-20101231 matt-premerge-20091211 jym-xensuspend-nbase jym-xensuspend-base
# 1.5 11-Mar-2009 joerg

branches: 1.5.2;
Don't workaround ancient macro argument limit with .Xo/.Xc.


# 1.4 09-Mar-2009 joerg

Fix preamble to match order set out by mdoc(7). Discussed with wiz.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 netbsd-5-0-RC2 netbsd-5-0-RC1 netbsd-5-base matt-mips64-base2 netbsd-4-0-1-RELEASE wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 wrstuden-fixsa-newbase wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 wrstuden-revivesa-base yamt-pf42-base mjf-devfs2-base keiichi-mipv6-base matt-armv6-nbase matt-armv6-prevmlocking wrstuden-fixsa-base-1 netbsd-4-0-RELEASE cube-autoconf-base mjf-devfs-base netbsd-4-0-RC5 netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 matt-armv6-base matt-mips64-base hpcarm-cleanup-base wrstuden-fixsa-base netbsd-4-base
# 1.3 24-Nov-2006 christos

branches: 1.3.28;
fix spelling of accommodate; from Zapher.


# 1.2 17-Oct-2006 wiz

Serial comma. Add RCS Id. Remove superfluous quotes.


# 1.1 15-Oct-2006 christos

branches: 1.1.1;
Initial revision


# 1.74 27-Jul-2020 christos

catch up with source rename of fbsd-zfs -> zfs


# 1.73 24-May-2020 wiz

Fix typo in macro. Sort option descriptions.


# 1.72 24-May-2020 jmcneill

Add -H flag to ignore existing MBR (Hybrid MBR/GPT mode).


# 1.71 24-May-2020 jmcneill

Exit gracefully when auto-expanding a partition and it is already the
correct size. Add a -q flag to "resize" and "resizedisk" commands to skip
printing warnings in the already resize paths.


Revision tags: phil-wifi-20200421 phil-wifi-20200411 is-mlppp-base phil-wifi-20200406 netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base
# 1.70 26-Jul-2019 martin

Remove outdated note about sysinst restrictions


# 1.69 25-Jun-2019 jnemeth

Add an "uuid" command to generate a new UUID for a portion. The
primary intention is for use for after cloning disks to prevent
collisions.


Revision tags: phil-wifi-20190609
# 1.68 04-Apr-2019 martin

Allow specifying the partition via -b startsec for the biosboot cmd.


# 1.67 26-Mar-2019 martin

Allow -b to specify a partition for "gpt unset" as well.


# 1.66 25-Mar-2019 martin

Allow -b startsec to specify the partition to change for the set subcommand
as well.
Add another option, -N, as a quick way to remove all attributes.


# 1.65 24-Mar-2019 martin

Make the "show" subcommand accept -b startsec to identify a partition
(very usefull for scripts and other robotic callers).


# 1.64 24-Mar-2019 martin

Add support for specifying the partition to resize via -b startsec
(similar to label and other subcommands). Do not fully add gpt_find
functionality here, as resizing multiple partitions in one go does not
make sense.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502
# 1.63 01-May-2018 kre

branches: 1.63.2;

Spello. (it is "existence").

ispell also says that we should s/parseable/parsable/ but I'm
not sure about that one, so I left it.

I also left a correct spelling that no-one has bothered to mangle!


# 1.62 01-May-2018 wiz

Bump date for new EXIT STATUS section.


# 1.61 01-May-2018 wiz

Sort sections.


# 1.60 01-May-2018 martin

Make the "gpt header" command return EXIT_FAILURE when no GPT is present.
This helps sysinst to tell a GPT labeled disk from others.
Very lazy version of a change proposed by kre.


Revision tags: pgoyette-compat-0422 pgoyette-compat-0415
# 1.59 11-Apr-2018 mrg

add information about how to boot from gpt. mostly taken from the wiki.


Revision tags: pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322
# 1.58 19-Mar-2018 mlelstv

Check device parameter to avoid segfaults. Agument synopsis for -l option.


Revision tags: pgoyette-compat-0315 pgoyette-compat-base
# 1.57 15-Jan-2018 sborrill

branches: 1.57.2;
Explain what suffixes are accepted when specifying a size.


# 1.56 03-Oct-2017 mlelstv

clarify that alignment is the number of bytes to align to.


# 1.55 05-Aug-2017 wiz

Use Fx/Nx.


# 1.54 04-Aug-2017 kre

Fix a typo, and make a couple of minor wording improvements.
I resisted the (very weak) impulse to Americanise some spellings ...


# 1.53 03-Aug-2017 msaitoh

Add note about bootme flag:

The bootme flag is used to indicate which partiotion should be booted
by UEFI boot code.


Revision tags: matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320
# 1.52 16-Feb-2017 christos

branches: 1.52.4;
Add -T timestamp for reproducible builds.


# 1.51 27-Jan-2017 abhinav

Fix spelling of partition.


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104
# 1.50 01-Nov-2016 jdolecek

branches: 1.50.2;
remove dup line


Revision tags: localcount-20160914
# 1.49 11-Sep-2016 sevan

Document the version gpt first appeared.
Replace contractions.
Bump date.


Revision tags: pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.48 09-Jun-2016 christos

branches: 1.48.2;
Rename 'a' to set the active PMBR flag to 'A'


# 1.47 09-Jun-2016 kre

Fix rendering of biosboot command synopsis.


# 1.46 09-Jun-2016 christos

PR/51230: Add the ability to set the active flag in the PMBR.


# 1.45 25-Dec-2015 wiz

Simplify usage for gpt show.


# 1.44 25-Dec-2015 martin

Add a -a flag to the show command, so we can display the full GPT with
all information in one go.


# 1.43 06-Dec-2015 wiz

Bump date for previous.
Remove trailing whitespace.


# 1.42 06-Dec-2015 christos

Add listing commands for type, set and unset.
Add help and formatting for set and unset.
Change show to print all the attribute info in one line.


# 1.41 02-Dec-2015 christos

Allow backup and restore to operate on files.


# 1.40 01-Dec-2015 christos

Reflect reality better; we don't handle multiple devices anymore, and
the partitions option is only for the commands that support it.


# 1.39 01-Dec-2015 christos

Firs step of refactoring, remove all globals, factor out some common code,
handle alternate usage but not advertise it.


# 1.38 30-Nov-2015 christos

- automatically sync the wedge information unless -n is specified.
- document the general options in the traditional way.
- split the main program into a separate file.


# 1.37 03-Nov-2015 jnemeth

Add a "header" subcommand that displays information about the size of
the disk along with information from the GPT header if it exists.


# 1.36 06-Dec-2014 wiz

Bump date for previous.


# 1.35 06-Dec-2014 mlelstv

Add some more common partition types.


# 1.34 04-Oct-2014 wiz

Remove trailing whitespace.


# 1.33 04-Oct-2014 christos

Allow specifying sector and media size on the command line.


# 1.32 29-Sep-2014 jnemeth

PR/47990 - Dr. Wolfgang Stukenbrock -- add "-L <label>" as selector option


# 1.31 28-Sep-2014 jnemeth

PR/44218 - David Young -- add "type" subcommand to change a partition type


# 1.30 23-Sep-2014 jnemeth

- make gpt_gpt() available for use directly by subcommands
- create new resizedisk disk subcommand for relocating backup GPT


# 1.29 20-Sep-2014 jnemeth

document the new restore subcommand


Revision tags: netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 tls-maxphys-base
# 1.28 19-Dec-2013 wiz

branches: 1.28.4;
Bump date for previous.


# 1.27 19-Dec-2013 jnemeth

Add the backup subcommand. It dumps the contents of the partition
tables as a plist, which is readable by the restore subcommand.

XXX restore subcommand forthcoming


# 1.26 09-Dec-2013 wiz

Fix typo.


# 1.25 09-Dec-2013 jnemeth

Add two new subcommands, "set" and "unset". These were inspired by
FreeBSD's gpart(8), but the code is all mine. The purpose of these
is to set and unset partition attributes.


# 1.24 09-Dec-2013 jnemeth

For the "show -i <entry>" subcommand, print Start and Size both in
terms of number of sectors and bytes.


# 1.23 08-Dec-2013 jnemeth

For the add and resize subcommands, change the -s option. If there is
no suffix, or the suffix is 's' or 'S', size is in sectors (as before)
otherwise size is in bytes.


# 1.22 06-Dec-2013 jnemeth

Don't attempt to create/resize an unaligned partition if the attempt
to create/resize an aligned one failed. This simplifies the code
and prevents surprises. If the user wants an unaligned partition
in the case where an aligned one fails, they can simply retry the
command without the "-a" option. This change was requested by
wiz@, and after some thought I agree with it.


# 1.21 30-Nov-2013 jnemeth

Add two new options:

-g which shows the GUID for a partition
-i which shows all the gory details for a particular option

XXX the output format of -i is subject to change


# 1.20 22-Nov-2013 jnemeth

bump date


# 1.19 22-Nov-2013 jnemeth

In the manpage:
- s/-b number/-b blocknr/
- s/-s count/-s sectors/
- s/-p count/-p partitions/

In the program:
- s/-b lba/-b blocknr/
- s/-s lba/-s sectors/

This makes the documentation in the manpage and the program consistent
and makes it more clear what the parameters are. Also, "-s lba" was
just plain wrong since LBA stands for Logical Block Address[ing], and
the -s option didn't represent any kind of address, but rather a size.


# 1.18 20-Nov-2013 wiz

shrunk.


# 1.17 20-Nov-2013 jnemeth

Add a resize command. This command was inspired by FreeBSD's gpart(8),
but the code was written by myself.


# 1.16 19-Nov-2013 jnemeth

update synopsis for add subcommand


# 1.15 19-Nov-2013 jnemeth

Add two new options to the "add" subcommand:

-a alignment -- attempt to align the start and size of the partition
-l label -- supply a label for the partition

These options were inspired by FreeBSD's gpart(8) command, but the
code was written by me.


# 1.14 24-Oct-2013 jnemeth

- markup
- typo; the label command labels partitions, not remove them
- migrate -s isn't applicable to NetBSD
- add information about the space required for migration
- add a "gpt show -l" example


# 1.13 20-Oct-2013 jnemeth

revert typo fix; teach me to blindly take changes from upstream


# 1.12 19-Oct-2013 jnemeth

type fix: accommodate. -> accomodate.


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6 yamt-pagecache-base5
# 1.11 02-May-2012 jakllsch

branches: 1.11.2;
Bump date to date of previous change.


Revision tags: yamt-pagecache-base4
# 1.10 09-Mar-2012 drochner

fix a path


Revision tags: netbsd-6-base
# 1.9 11-Nov-2011 wiz

branches: 1.9.2;
Add an EXAMPLE section showing how to add a swap file system using gpt. Bump date.


Revision tags: yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.8 19-Sep-2011 wiz

branches: 1.8.2;
Minimally document gpt recover. Bump date.


Revision tags: cherry-xenmp-base
# 1.7 27-Mar-2011 jym

Document biosboot. Xref boot(8) and installboot(8).


Revision tags: bouyer-quota2-nbase bouyer-quota2-base
# 1.6 09-Feb-2011 schnoebe

List all the aliases supported for GPT partition types.


Revision tags: matt-mips64-premerge-20101231 matt-premerge-20091211 jym-xensuspend-nbase jym-xensuspend-base
# 1.5 11-Mar-2009 joerg

branches: 1.5.2;
Don't workaround ancient macro argument limit with .Xo/.Xc.


# 1.4 09-Mar-2009 joerg

Fix preamble to match order set out by mdoc(7). Discussed with wiz.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 netbsd-5-0-RC2 netbsd-5-0-RC1 netbsd-5-base matt-mips64-base2 netbsd-4-0-1-RELEASE wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 wrstuden-fixsa-newbase wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 wrstuden-revivesa-base yamt-pf42-base mjf-devfs2-base keiichi-mipv6-base matt-armv6-nbase matt-armv6-prevmlocking wrstuden-fixsa-base-1 netbsd-4-0-RELEASE cube-autoconf-base mjf-devfs-base netbsd-4-0-RC5 netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 matt-armv6-base matt-mips64-base hpcarm-cleanup-base wrstuden-fixsa-base netbsd-4-base
# 1.3 24-Nov-2006 christos

branches: 1.3.28;
fix spelling of accommodate; from Zapher.


# 1.2 17-Oct-2006 wiz

Serial comma. Add RCS Id. Remove superfluous quotes.


# 1.1 15-Oct-2006 christos

branches: 1.1.1;
Initial revision


# 1.73 24-May-2020 wiz

Fix typo in macro. Sort option descriptions.


# 1.72 24-May-2020 jmcneill

Add -H flag to ignore existing MBR (Hybrid MBR/GPT mode).


# 1.71 24-May-2020 jmcneill

Exit gracefully when auto-expanding a partition and it is already the
correct size. Add a -q flag to "resize" and "resizedisk" commands to skip
printing warnings in the already resize paths.


Revision tags: phil-wifi-20200421 phil-wifi-20200411 is-mlppp-base phil-wifi-20200406 netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base
# 1.70 26-Jul-2019 martin

Remove outdated note about sysinst restrictions


# 1.69 25-Jun-2019 jnemeth

Add an "uuid" command to generate a new UUID for a portion. The
primary intention is for use for after cloning disks to prevent
collisions.


Revision tags: phil-wifi-20190609
# 1.68 04-Apr-2019 martin

Allow specifying the partition via -b startsec for the biosboot cmd.


# 1.67 26-Mar-2019 martin

Allow -b to specify a partition for "gpt unset" as well.


# 1.66 25-Mar-2019 martin

Allow -b startsec to specify the partition to change for the set subcommand
as well.
Add another option, -N, as a quick way to remove all attributes.


# 1.65 24-Mar-2019 martin

Make the "show" subcommand accept -b startsec to identify a partition
(very usefull for scripts and other robotic callers).


# 1.64 24-Mar-2019 martin

Add support for specifying the partition to resize via -b startsec
(similar to label and other subcommands). Do not fully add gpt_find
functionality here, as resizing multiple partitions in one go does not
make sense.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502
# 1.63 01-May-2018 kre

branches: 1.63.2;

Spello. (it is "existence").

ispell also says that we should s/parseable/parsable/ but I'm
not sure about that one, so I left it.

I also left a correct spelling that no-one has bothered to mangle!


# 1.62 01-May-2018 wiz

Bump date for new EXIT STATUS section.


# 1.61 01-May-2018 wiz

Sort sections.


# 1.60 01-May-2018 martin

Make the "gpt header" command return EXIT_FAILURE when no GPT is present.
This helps sysinst to tell a GPT labeled disk from others.
Very lazy version of a change proposed by kre.


Revision tags: pgoyette-compat-0422 pgoyette-compat-0415
# 1.59 11-Apr-2018 mrg

add information about how to boot from gpt. mostly taken from the wiki.


Revision tags: pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322
# 1.58 19-Mar-2018 mlelstv

Check device parameter to avoid segfaults. Agument synopsis for -l option.


Revision tags: pgoyette-compat-0315 pgoyette-compat-base
# 1.57 15-Jan-2018 sborrill

branches: 1.57.2;
Explain what suffixes are accepted when specifying a size.


# 1.56 03-Oct-2017 mlelstv

clarify that alignment is the number of bytes to align to.


# 1.55 05-Aug-2017 wiz

Use Fx/Nx.


# 1.54 04-Aug-2017 kre

Fix a typo, and make a couple of minor wording improvements.
I resisted the (very weak) impulse to Americanise some spellings ...


# 1.53 03-Aug-2017 msaitoh

Add note about bootme flag:

The bootme flag is used to indicate which partiotion should be booted
by UEFI boot code.


Revision tags: matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320
# 1.52 16-Feb-2017 christos

branches: 1.52.4;
Add -T timestamp for reproducible builds.


# 1.51 27-Jan-2017 abhinav

Fix spelling of partition.


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104
# 1.50 01-Nov-2016 jdolecek

branches: 1.50.2;
remove dup line


Revision tags: localcount-20160914
# 1.49 11-Sep-2016 sevan

Document the version gpt first appeared.
Replace contractions.
Bump date.


Revision tags: pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.48 09-Jun-2016 christos

branches: 1.48.2;
Rename 'a' to set the active PMBR flag to 'A'


# 1.47 09-Jun-2016 kre

Fix rendering of biosboot command synopsis.


# 1.46 09-Jun-2016 christos

PR/51230: Add the ability to set the active flag in the PMBR.


# 1.45 25-Dec-2015 wiz

Simplify usage for gpt show.


# 1.44 25-Dec-2015 martin

Add a -a flag to the show command, so we can display the full GPT with
all information in one go.


# 1.43 06-Dec-2015 wiz

Bump date for previous.
Remove trailing whitespace.


# 1.42 06-Dec-2015 christos

Add listing commands for type, set and unset.
Add help and formatting for set and unset.
Change show to print all the attribute info in one line.


# 1.41 02-Dec-2015 christos

Allow backup and restore to operate on files.


# 1.40 01-Dec-2015 christos

Reflect reality better; we don't handle multiple devices anymore, and
the partitions option is only for the commands that support it.


# 1.39 01-Dec-2015 christos

Firs step of refactoring, remove all globals, factor out some common code,
handle alternate usage but not advertise it.


# 1.38 30-Nov-2015 christos

- automatically sync the wedge information unless -n is specified.
- document the general options in the traditional way.
- split the main program into a separate file.


# 1.37 03-Nov-2015 jnemeth

Add a "header" subcommand that displays information about the size of
the disk along with information from the GPT header if it exists.


# 1.36 06-Dec-2014 wiz

Bump date for previous.


# 1.35 06-Dec-2014 mlelstv

Add some more common partition types.


# 1.34 04-Oct-2014 wiz

Remove trailing whitespace.


# 1.33 04-Oct-2014 christos

Allow specifying sector and media size on the command line.


# 1.32 29-Sep-2014 jnemeth

PR/47990 - Dr. Wolfgang Stukenbrock -- add "-L <label>" as selector option


# 1.31 28-Sep-2014 jnemeth

PR/44218 - David Young -- add "type" subcommand to change a partition type


# 1.30 23-Sep-2014 jnemeth

- make gpt_gpt() available for use directly by subcommands
- create new resizedisk disk subcommand for relocating backup GPT


# 1.29 20-Sep-2014 jnemeth

document the new restore subcommand


Revision tags: netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 tls-maxphys-base
# 1.28 19-Dec-2013 wiz

branches: 1.28.4;
Bump date for previous.


# 1.27 19-Dec-2013 jnemeth

Add the backup subcommand. It dumps the contents of the partition
tables as a plist, which is readable by the restore subcommand.

XXX restore subcommand forthcoming


# 1.26 09-Dec-2013 wiz

Fix typo.


# 1.25 09-Dec-2013 jnemeth

Add two new subcommands, "set" and "unset". These were inspired by
FreeBSD's gpart(8), but the code is all mine. The purpose of these
is to set and unset partition attributes.


# 1.24 09-Dec-2013 jnemeth

For the "show -i <entry>" subcommand, print Start and Size both in
terms of number of sectors and bytes.


# 1.23 08-Dec-2013 jnemeth

For the add and resize subcommands, change the -s option. If there is
no suffix, or the suffix is 's' or 'S', size is in sectors (as before)
otherwise size is in bytes.


# 1.22 06-Dec-2013 jnemeth

Don't attempt to create/resize an unaligned partition if the attempt
to create/resize an aligned one failed. This simplifies the code
and prevents surprises. If the user wants an unaligned partition
in the case where an aligned one fails, they can simply retry the
command without the "-a" option. This change was requested by
wiz@, and after some thought I agree with it.


# 1.21 30-Nov-2013 jnemeth

Add two new options:

-g which shows the GUID for a partition
-i which shows all the gory details for a particular option

XXX the output format of -i is subject to change


# 1.20 22-Nov-2013 jnemeth

bump date


# 1.19 22-Nov-2013 jnemeth

In the manpage:
- s/-b number/-b blocknr/
- s/-s count/-s sectors/
- s/-p count/-p partitions/

In the program:
- s/-b lba/-b blocknr/
- s/-s lba/-s sectors/

This makes the documentation in the manpage and the program consistent
and makes it more clear what the parameters are. Also, "-s lba" was
just plain wrong since LBA stands for Logical Block Address[ing], and
the -s option didn't represent any kind of address, but rather a size.


# 1.18 20-Nov-2013 wiz

shrunk.


# 1.17 20-Nov-2013 jnemeth

Add a resize command. This command was inspired by FreeBSD's gpart(8),
but the code was written by myself.


# 1.16 19-Nov-2013 jnemeth

update synopsis for add subcommand


# 1.15 19-Nov-2013 jnemeth

Add two new options to the "add" subcommand:

-a alignment -- attempt to align the start and size of the partition
-l label -- supply a label for the partition

These options were inspired by FreeBSD's gpart(8) command, but the
code was written by me.


# 1.14 24-Oct-2013 jnemeth

- markup
- typo; the label command labels partitions, not remove them
- migrate -s isn't applicable to NetBSD
- add information about the space required for migration
- add a "gpt show -l" example


# 1.13 20-Oct-2013 jnemeth

revert typo fix; teach me to blindly take changes from upstream


# 1.12 19-Oct-2013 jnemeth

type fix: accommodate. -> accomodate.


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6 yamt-pagecache-base5
# 1.11 02-May-2012 jakllsch

branches: 1.11.2;
Bump date to date of previous change.


Revision tags: yamt-pagecache-base4
# 1.10 09-Mar-2012 drochner

fix a path


Revision tags: netbsd-6-base
# 1.9 11-Nov-2011 wiz

branches: 1.9.2;
Add an EXAMPLE section showing how to add a swap file system using gpt. Bump date.


Revision tags: yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.8 19-Sep-2011 wiz

branches: 1.8.2;
Minimally document gpt recover. Bump date.


Revision tags: cherry-xenmp-base
# 1.7 27-Mar-2011 jym

Document biosboot. Xref boot(8) and installboot(8).


Revision tags: bouyer-quota2-nbase bouyer-quota2-base
# 1.6 09-Feb-2011 schnoebe

List all the aliases supported for GPT partition types.


Revision tags: matt-mips64-premerge-20101231 matt-premerge-20091211 jym-xensuspend-nbase jym-xensuspend-base
# 1.5 11-Mar-2009 joerg

branches: 1.5.2;
Don't workaround ancient macro argument limit with .Xo/.Xc.


# 1.4 09-Mar-2009 joerg

Fix preamble to match order set out by mdoc(7). Discussed with wiz.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 netbsd-5-0-RC2 netbsd-5-0-RC1 netbsd-5-base matt-mips64-base2 netbsd-4-0-1-RELEASE wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 wrstuden-fixsa-newbase wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 wrstuden-revivesa-base yamt-pf42-base mjf-devfs2-base keiichi-mipv6-base matt-armv6-nbase matt-armv6-prevmlocking wrstuden-fixsa-base-1 netbsd-4-0-RELEASE cube-autoconf-base mjf-devfs-base netbsd-4-0-RC5 netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 matt-armv6-base matt-mips64-base hpcarm-cleanup-base wrstuden-fixsa-base netbsd-4-base
# 1.3 24-Nov-2006 christos

branches: 1.3.28;
fix spelling of accommodate; from Zapher.


# 1.2 17-Oct-2006 wiz

Serial comma. Add RCS Id. Remove superfluous quotes.


# 1.1 15-Oct-2006 christos

branches: 1.1.1;
Initial revision


# 1.70 26-Jul-2019 martin

Remove outdated note about sysinst restrictions


# 1.69 25-Jun-2019 jnemeth

Add an "uuid" command to generate a new UUID for a portion. The
primary intention is for use for after cloning disks to prevent
collisions.


Revision tags: phil-wifi-20190609
# 1.68 04-Apr-2019 martin

Allow specifying the partition via -b startsec for the biosboot cmd.


# 1.67 26-Mar-2019 martin

Allow -b to specify a partition for "gpt unset" as well.


# 1.66 25-Mar-2019 martin

Allow -b startsec to specify the partition to change for the set subcommand
as well.
Add another option, -N, as a quick way to remove all attributes.


# 1.65 24-Mar-2019 martin

Make the "show" subcommand accept -b startsec to identify a partition
(very usefull for scripts and other robotic callers).


# 1.64 24-Mar-2019 martin

Add support for specifying the partition to resize via -b startsec
(similar to label and other subcommands). Do not fully add gpt_find
functionality here, as resizing multiple partitions in one go does not
make sense.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502
# 1.63 01-May-2018 kre

branches: 1.63.2;

Spello. (it is "existence").

ispell also says that we should s/parseable/parsable/ but I'm
not sure about that one, so I left it.

I also left a correct spelling that no-one has bothered to mangle!


# 1.62 01-May-2018 wiz

Bump date for new EXIT STATUS section.


# 1.61 01-May-2018 wiz

Sort sections.


# 1.60 01-May-2018 martin

Make the "gpt header" command return EXIT_FAILURE when no GPT is present.
This helps sysinst to tell a GPT labeled disk from others.
Very lazy version of a change proposed by kre.


Revision tags: pgoyette-compat-0422 pgoyette-compat-0415
# 1.59 11-Apr-2018 mrg

add information about how to boot from gpt. mostly taken from the wiki.


Revision tags: pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322
# 1.58 19-Mar-2018 mlelstv

Check device parameter to avoid segfaults. Agument synopsis for -l option.


Revision tags: pgoyette-compat-0315 pgoyette-compat-base
# 1.57 15-Jan-2018 sborrill

branches: 1.57.2;
Explain what suffixes are accepted when specifying a size.


# 1.56 03-Oct-2017 mlelstv

clarify that alignment is the number of bytes to align to.


# 1.55 05-Aug-2017 wiz

Use Fx/Nx.


# 1.54 04-Aug-2017 kre

Fix a typo, and make a couple of minor wording improvements.
I resisted the (very weak) impulse to Americanise some spellings ...


# 1.53 03-Aug-2017 msaitoh

Add note about bootme flag:

The bootme flag is used to indicate which partiotion should be booted
by UEFI boot code.


Revision tags: matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320
# 1.52 16-Feb-2017 christos

branches: 1.52.4;
Add -T timestamp for reproducible builds.


# 1.51 27-Jan-2017 abhinav

Fix spelling of partition.


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104
# 1.50 01-Nov-2016 jdolecek

branches: 1.50.2;
remove dup line


Revision tags: localcount-20160914
# 1.49 11-Sep-2016 sevan

Document the version gpt first appeared.
Replace contractions.
Bump date.


Revision tags: pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.48 09-Jun-2016 christos

branches: 1.48.2;
Rename 'a' to set the active PMBR flag to 'A'


# 1.47 09-Jun-2016 kre

Fix rendering of biosboot command synopsis.


# 1.46 09-Jun-2016 christos

PR/51230: Add the ability to set the active flag in the PMBR.


# 1.45 25-Dec-2015 wiz

Simplify usage for gpt show.


# 1.44 25-Dec-2015 martin

Add a -a flag to the show command, so we can display the full GPT with
all information in one go.


# 1.43 06-Dec-2015 wiz

Bump date for previous.
Remove trailing whitespace.


# 1.42 06-Dec-2015 christos

Add listing commands for type, set and unset.
Add help and formatting for set and unset.
Change show to print all the attribute info in one line.


# 1.41 02-Dec-2015 christos

Allow backup and restore to operate on files.


# 1.40 01-Dec-2015 christos

Reflect reality better; we don't handle multiple devices anymore, and
the partitions option is only for the commands that support it.


# 1.39 01-Dec-2015 christos

Firs step of refactoring, remove all globals, factor out some common code,
handle alternate usage but not advertise it.


# 1.38 30-Nov-2015 christos

- automatically sync the wedge information unless -n is specified.
- document the general options in the traditional way.
- split the main program into a separate file.


# 1.37 03-Nov-2015 jnemeth

Add a "header" subcommand that displays information about the size of
the disk along with information from the GPT header if it exists.


# 1.36 06-Dec-2014 wiz

Bump date for previous.


# 1.35 06-Dec-2014 mlelstv

Add some more common partition types.


# 1.34 04-Oct-2014 wiz

Remove trailing whitespace.


# 1.33 04-Oct-2014 christos

Allow specifying sector and media size on the command line.


# 1.32 29-Sep-2014 jnemeth

PR/47990 - Dr. Wolfgang Stukenbrock -- add "-L <label>" as selector option


# 1.31 28-Sep-2014 jnemeth

PR/44218 - David Young -- add "type" subcommand to change a partition type


# 1.30 23-Sep-2014 jnemeth

- make gpt_gpt() available for use directly by subcommands
- create new resizedisk disk subcommand for relocating backup GPT


# 1.29 20-Sep-2014 jnemeth

document the new restore subcommand


Revision tags: netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 tls-maxphys-base
# 1.28 19-Dec-2013 wiz

branches: 1.28.4;
Bump date for previous.


# 1.27 19-Dec-2013 jnemeth

Add the backup subcommand. It dumps the contents of the partition
tables as a plist, which is readable by the restore subcommand.

XXX restore subcommand forthcoming


# 1.26 09-Dec-2013 wiz

Fix typo.


# 1.25 09-Dec-2013 jnemeth

Add two new subcommands, "set" and "unset". These were inspired by
FreeBSD's gpart(8), but the code is all mine. The purpose of these
is to set and unset partition attributes.


# 1.24 09-Dec-2013 jnemeth

For the "show -i <entry>" subcommand, print Start and Size both in
terms of number of sectors and bytes.


# 1.23 08-Dec-2013 jnemeth

For the add and resize subcommands, change the -s option. If there is
no suffix, or the suffix is 's' or 'S', size is in sectors (as before)
otherwise size is in bytes.


# 1.22 06-Dec-2013 jnemeth

Don't attempt to create/resize an unaligned partition if the attempt
to create/resize an aligned one failed. This simplifies the code
and prevents surprises. If the user wants an unaligned partition
in the case where an aligned one fails, they can simply retry the
command without the "-a" option. This change was requested by
wiz@, and after some thought I agree with it.


# 1.21 30-Nov-2013 jnemeth

Add two new options:

-g which shows the GUID for a partition
-i which shows all the gory details for a particular option

XXX the output format of -i is subject to change


# 1.20 22-Nov-2013 jnemeth

bump date


# 1.19 22-Nov-2013 jnemeth

In the manpage:
- s/-b number/-b blocknr/
- s/-s count/-s sectors/
- s/-p count/-p partitions/

In the program:
- s/-b lba/-b blocknr/
- s/-s lba/-s sectors/

This makes the documentation in the manpage and the program consistent
and makes it more clear what the parameters are. Also, "-s lba" was
just plain wrong since LBA stands for Logical Block Address[ing], and
the -s option didn't represent any kind of address, but rather a size.


# 1.18 20-Nov-2013 wiz

shrunk.


# 1.17 20-Nov-2013 jnemeth

Add a resize command. This command was inspired by FreeBSD's gpart(8),
but the code was written by myself.


# 1.16 19-Nov-2013 jnemeth

update synopsis for add subcommand


# 1.15 19-Nov-2013 jnemeth

Add two new options to the "add" subcommand:

-a alignment -- attempt to align the start and size of the partition
-l label -- supply a label for the partition

These options were inspired by FreeBSD's gpart(8) command, but the
code was written by me.


# 1.14 24-Oct-2013 jnemeth

- markup
- typo; the label command labels partitions, not remove them
- migrate -s isn't applicable to NetBSD
- add information about the space required for migration
- add a "gpt show -l" example


# 1.13 20-Oct-2013 jnemeth

revert typo fix; teach me to blindly take changes from upstream


# 1.12 19-Oct-2013 jnemeth

type fix: accommodate. -> accomodate.


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6 yamt-pagecache-base5
# 1.11 02-May-2012 jakllsch

branches: 1.11.2;
Bump date to date of previous change.


Revision tags: yamt-pagecache-base4
# 1.10 09-Mar-2012 drochner

fix a path


Revision tags: netbsd-6-base
# 1.9 11-Nov-2011 wiz

branches: 1.9.2;
Add an EXAMPLE section showing how to add a swap file system using gpt. Bump date.


Revision tags: yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.8 19-Sep-2011 wiz

branches: 1.8.2;
Minimally document gpt recover. Bump date.


Revision tags: cherry-xenmp-base
# 1.7 27-Mar-2011 jym

Document biosboot. Xref boot(8) and installboot(8).


Revision tags: bouyer-quota2-nbase bouyer-quota2-base
# 1.6 09-Feb-2011 schnoebe

List all the aliases supported for GPT partition types.


Revision tags: matt-mips64-premerge-20101231 matt-premerge-20091211 jym-xensuspend-nbase jym-xensuspend-base
# 1.5 11-Mar-2009 joerg

branches: 1.5.2;
Don't workaround ancient macro argument limit with .Xo/.Xc.


# 1.4 09-Mar-2009 joerg

Fix preamble to match order set out by mdoc(7). Discussed with wiz.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 netbsd-5-0-RC2 netbsd-5-0-RC1 netbsd-5-base matt-mips64-base2 netbsd-4-0-1-RELEASE wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 wrstuden-fixsa-newbase wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 wrstuden-revivesa-base yamt-pf42-base mjf-devfs2-base keiichi-mipv6-base matt-armv6-nbase matt-armv6-prevmlocking wrstuden-fixsa-base-1 netbsd-4-0-RELEASE cube-autoconf-base mjf-devfs-base netbsd-4-0-RC5 netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 matt-armv6-base matt-mips64-base hpcarm-cleanup-base wrstuden-fixsa-base netbsd-4-base
# 1.3 24-Nov-2006 christos

branches: 1.3.28;
fix spelling of accommodate; from Zapher.


# 1.2 17-Oct-2006 wiz

Serial comma. Add RCS Id. Remove superfluous quotes.


# 1.1 15-Oct-2006 christos

branches: 1.1.1;
Initial revision


# 1.69 25-Jun-2019 jnemeth

Add an "uuid" command to generate a new UUID for a portion. The
primary intention is for use for after cloning disks to prevent
collisions.


Revision tags: phil-wifi-20190609
# 1.68 04-Apr-2019 martin

Allow specifying the partition via -b startsec for the biosboot cmd.


# 1.67 26-Mar-2019 martin

Allow -b to specify a partition for "gpt unset" as well.


# 1.66 25-Mar-2019 martin

Allow -b startsec to specify the partition to change for the set subcommand
as well.
Add another option, -N, as a quick way to remove all attributes.


# 1.65 24-Mar-2019 martin

Make the "show" subcommand accept -b startsec to identify a partition
(very usefull for scripts and other robotic callers).


# 1.64 24-Mar-2019 martin

Add support for specifying the partition to resize via -b startsec
(similar to label and other subcommands). Do not fully add gpt_find
functionality here, as resizing multiple partitions in one go does not
make sense.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502
# 1.63 01-May-2018 kre

branches: 1.63.2;

Spello. (it is "existence").

ispell also says that we should s/parseable/parsable/ but I'm
not sure about that one, so I left it.

I also left a correct spelling that no-one has bothered to mangle!


# 1.62 01-May-2018 wiz

Bump date for new EXIT STATUS section.


# 1.61 01-May-2018 wiz

Sort sections.


# 1.60 01-May-2018 martin

Make the "gpt header" command return EXIT_FAILURE when no GPT is present.
This helps sysinst to tell a GPT labeled disk from others.
Very lazy version of a change proposed by kre.


Revision tags: pgoyette-compat-0422 pgoyette-compat-0415
# 1.59 11-Apr-2018 mrg

add information about how to boot from gpt. mostly taken from the wiki.


Revision tags: pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322
# 1.58 19-Mar-2018 mlelstv

Check device parameter to avoid segfaults. Agument synopsis for -l option.


Revision tags: pgoyette-compat-0315 pgoyette-compat-base
# 1.57 15-Jan-2018 sborrill

branches: 1.57.2;
Explain what suffixes are accepted when specifying a size.


# 1.56 03-Oct-2017 mlelstv

clarify that alignment is the number of bytes to align to.


# 1.55 05-Aug-2017 wiz

Use Fx/Nx.


# 1.54 04-Aug-2017 kre

Fix a typo, and make a couple of minor wording improvements.
I resisted the (very weak) impulse to Americanise some spellings ...


# 1.53 03-Aug-2017 msaitoh

Add note about bootme flag:

The bootme flag is used to indicate which partiotion should be booted
by UEFI boot code.


Revision tags: matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320
# 1.52 16-Feb-2017 christos

branches: 1.52.4;
Add -T timestamp for reproducible builds.


# 1.51 27-Jan-2017 abhinav

Fix spelling of partition.


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104
# 1.50 01-Nov-2016 jdolecek

branches: 1.50.2;
remove dup line


Revision tags: localcount-20160914
# 1.49 11-Sep-2016 sevan

Document the version gpt first appeared.
Replace contractions.
Bump date.


Revision tags: pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.48 09-Jun-2016 christos

branches: 1.48.2;
Rename 'a' to set the active PMBR flag to 'A'


# 1.47 09-Jun-2016 kre

Fix rendering of biosboot command synopsis.


# 1.46 09-Jun-2016 christos

PR/51230: Add the ability to set the active flag in the PMBR.


# 1.45 25-Dec-2015 wiz

Simplify usage for gpt show.


# 1.44 25-Dec-2015 martin

Add a -a flag to the show command, so we can display the full GPT with
all information in one go.


# 1.43 06-Dec-2015 wiz

Bump date for previous.
Remove trailing whitespace.


# 1.42 06-Dec-2015 christos

Add listing commands for type, set and unset.
Add help and formatting for set and unset.
Change show to print all the attribute info in one line.


# 1.41 02-Dec-2015 christos

Allow backup and restore to operate on files.


# 1.40 01-Dec-2015 christos

Reflect reality better; we don't handle multiple devices anymore, and
the partitions option is only for the commands that support it.


# 1.39 01-Dec-2015 christos

Firs step of refactoring, remove all globals, factor out some common code,
handle alternate usage but not advertise it.


# 1.38 30-Nov-2015 christos

- automatically sync the wedge information unless -n is specified.
- document the general options in the traditional way.
- split the main program into a separate file.


# 1.37 03-Nov-2015 jnemeth

Add a "header" subcommand that displays information about the size of
the disk along with information from the GPT header if it exists.


# 1.36 06-Dec-2014 wiz

Bump date for previous.


# 1.35 06-Dec-2014 mlelstv

Add some more common partition types.


# 1.34 04-Oct-2014 wiz

Remove trailing whitespace.


# 1.33 04-Oct-2014 christos

Allow specifying sector and media size on the command line.


# 1.32 29-Sep-2014 jnemeth

PR/47990 - Dr. Wolfgang Stukenbrock -- add "-L <label>" as selector option


# 1.31 28-Sep-2014 jnemeth

PR/44218 - David Young -- add "type" subcommand to change a partition type


# 1.30 23-Sep-2014 jnemeth

- make gpt_gpt() available for use directly by subcommands
- create new resizedisk disk subcommand for relocating backup GPT


# 1.29 20-Sep-2014 jnemeth

document the new restore subcommand


Revision tags: netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 tls-maxphys-base
# 1.28 19-Dec-2013 wiz

branches: 1.28.4;
Bump date for previous.


# 1.27 19-Dec-2013 jnemeth

Add the backup subcommand. It dumps the contents of the partition
tables as a plist, which is readable by the restore subcommand.

XXX restore subcommand forthcoming


# 1.26 09-Dec-2013 wiz

Fix typo.


# 1.25 09-Dec-2013 jnemeth

Add two new subcommands, "set" and "unset". These were inspired by
FreeBSD's gpart(8), but the code is all mine. The purpose of these
is to set and unset partition attributes.


# 1.24 09-Dec-2013 jnemeth

For the "show -i <entry>" subcommand, print Start and Size both in
terms of number of sectors and bytes.


# 1.23 08-Dec-2013 jnemeth

For the add and resize subcommands, change the -s option. If there is
no suffix, or the suffix is 's' or 'S', size is in sectors (as before)
otherwise size is in bytes.


# 1.22 06-Dec-2013 jnemeth

Don't attempt to create/resize an unaligned partition if the attempt
to create/resize an aligned one failed. This simplifies the code
and prevents surprises. If the user wants an unaligned partition
in the case where an aligned one fails, they can simply retry the
command without the "-a" option. This change was requested by
wiz@, and after some thought I agree with it.


# 1.21 30-Nov-2013 jnemeth

Add two new options:

-g which shows the GUID for a partition
-i which shows all the gory details for a particular option

XXX the output format of -i is subject to change


# 1.20 22-Nov-2013 jnemeth

bump date


# 1.19 22-Nov-2013 jnemeth

In the manpage:
- s/-b number/-b blocknr/
- s/-s count/-s sectors/
- s/-p count/-p partitions/

In the program:
- s/-b lba/-b blocknr/
- s/-s lba/-s sectors/

This makes the documentation in the manpage and the program consistent
and makes it more clear what the parameters are. Also, "-s lba" was
just plain wrong since LBA stands for Logical Block Address[ing], and
the -s option didn't represent any kind of address, but rather a size.


# 1.18 20-Nov-2013 wiz

shrunk.


# 1.17 20-Nov-2013 jnemeth

Add a resize command. This command was inspired by FreeBSD's gpart(8),
but the code was written by myself.


# 1.16 19-Nov-2013 jnemeth

update synopsis for add subcommand


# 1.15 19-Nov-2013 jnemeth

Add two new options to the "add" subcommand:

-a alignment -- attempt to align the start and size of the partition
-l label -- supply a label for the partition

These options were inspired by FreeBSD's gpart(8) command, but the
code was written by me.


# 1.14 24-Oct-2013 jnemeth

- markup
- typo; the label command labels partitions, not remove them
- migrate -s isn't applicable to NetBSD
- add information about the space required for migration
- add a "gpt show -l" example


# 1.13 20-Oct-2013 jnemeth

revert typo fix; teach me to blindly take changes from upstream


# 1.12 19-Oct-2013 jnemeth

type fix: accommodate. -> accomodate.


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6 yamt-pagecache-base5
# 1.11 02-May-2012 jakllsch

branches: 1.11.2;
Bump date to date of previous change.


Revision tags: yamt-pagecache-base4
# 1.10 09-Mar-2012 drochner

fix a path


Revision tags: netbsd-6-base
# 1.9 11-Nov-2011 wiz

branches: 1.9.2;
Add an EXAMPLE section showing how to add a swap file system using gpt. Bump date.


Revision tags: yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.8 19-Sep-2011 wiz

branches: 1.8.2;
Minimally document gpt recover. Bump date.


Revision tags: cherry-xenmp-base
# 1.7 27-Mar-2011 jym

Document biosboot. Xref boot(8) and installboot(8).


Revision tags: bouyer-quota2-nbase bouyer-quota2-base
# 1.6 09-Feb-2011 schnoebe

List all the aliases supported for GPT partition types.


Revision tags: matt-mips64-premerge-20101231 matt-premerge-20091211 jym-xensuspend-nbase jym-xensuspend-base
# 1.5 11-Mar-2009 joerg

branches: 1.5.2;
Don't workaround ancient macro argument limit with .Xo/.Xc.


# 1.4 09-Mar-2009 joerg

Fix preamble to match order set out by mdoc(7). Discussed with wiz.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 netbsd-5-0-RC2 netbsd-5-0-RC1 netbsd-5-base matt-mips64-base2 netbsd-4-0-1-RELEASE wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 wrstuden-fixsa-newbase wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 wrstuden-revivesa-base yamt-pf42-base mjf-devfs2-base keiichi-mipv6-base matt-armv6-nbase matt-armv6-prevmlocking wrstuden-fixsa-base-1 netbsd-4-0-RELEASE cube-autoconf-base mjf-devfs-base netbsd-4-0-RC5 netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 matt-armv6-base matt-mips64-base hpcarm-cleanup-base wrstuden-fixsa-base netbsd-4-base
# 1.3 24-Nov-2006 christos

branches: 1.3.28;
fix spelling of accommodate; from Zapher.


# 1.2 17-Oct-2006 wiz

Serial comma. Add RCS Id. Remove superfluous quotes.


# 1.1 15-Oct-2006 christos

branches: 1.1.1;
Initial revision


# 1.68 04-Apr-2019 martin

Allow specifying the partition via -b startsec for the biosboot cmd.


# 1.67 26-Mar-2019 martin

Allow -b to specify a partition for "gpt unset" as well.


# 1.66 25-Mar-2019 martin

Allow -b startsec to specify the partition to change for the set subcommand
as well.
Add another option, -N, as a quick way to remove all attributes.


# 1.65 24-Mar-2019 martin

Make the "show" subcommand accept -b startsec to identify a partition
(very usefull for scripts and other robotic callers).


# 1.64 24-Mar-2019 martin

Add support for specifying the partition to resize via -b startsec
(similar to label and other subcommands). Do not fully add gpt_find
functionality here, as resizing multiple partitions in one go does not
make sense.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502
# 1.63 01-May-2018 kre

Spello. (it is "existence").

ispell also says that we should s/parseable/parsable/ but I'm
not sure about that one, so I left it.

I also left a correct spelling that no-one has bothered to mangle!


# 1.62 01-May-2018 wiz

Bump date for new EXIT STATUS section.


# 1.61 01-May-2018 wiz

Sort sections.


# 1.60 01-May-2018 martin

Make the "gpt header" command return EXIT_FAILURE when no GPT is present.
This helps sysinst to tell a GPT labeled disk from others.
Very lazy version of a change proposed by kre.


Revision tags: pgoyette-compat-0422 pgoyette-compat-0415
# 1.59 11-Apr-2018 mrg

add information about how to boot from gpt. mostly taken from the wiki.


Revision tags: pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322
# 1.58 19-Mar-2018 mlelstv

Check device parameter to avoid segfaults. Agument synopsis for -l option.


Revision tags: pgoyette-compat-0315 pgoyette-compat-base
# 1.57 15-Jan-2018 sborrill

branches: 1.57.2;
Explain what suffixes are accepted when specifying a size.


# 1.56 03-Oct-2017 mlelstv

clarify that alignment is the number of bytes to align to.


# 1.55 05-Aug-2017 wiz

Use Fx/Nx.


# 1.54 04-Aug-2017 kre

Fix a typo, and make a couple of minor wording improvements.
I resisted the (very weak) impulse to Americanise some spellings ...


# 1.53 03-Aug-2017 msaitoh

Add note about bootme flag:

The bootme flag is used to indicate which partiotion should be booted
by UEFI boot code.


Revision tags: matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320
# 1.52 16-Feb-2017 christos

branches: 1.52.4;
Add -T timestamp for reproducible builds.


# 1.51 27-Jan-2017 abhinav

Fix spelling of partition.


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104
# 1.50 01-Nov-2016 jdolecek

branches: 1.50.2;
remove dup line


Revision tags: localcount-20160914
# 1.49 11-Sep-2016 sevan

Document the version gpt first appeared.
Replace contractions.
Bump date.


Revision tags: pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.48 09-Jun-2016 christos

branches: 1.48.2;
Rename 'a' to set the active PMBR flag to 'A'


# 1.47 09-Jun-2016 kre

Fix rendering of biosboot command synopsis.


# 1.46 09-Jun-2016 christos

PR/51230: Add the ability to set the active flag in the PMBR.


# 1.45 25-Dec-2015 wiz

Simplify usage for gpt show.


# 1.44 25-Dec-2015 martin

Add a -a flag to the show command, so we can display the full GPT with
all information in one go.


# 1.43 06-Dec-2015 wiz

Bump date for previous.
Remove trailing whitespace.


# 1.42 06-Dec-2015 christos

Add listing commands for type, set and unset.
Add help and formatting for set and unset.
Change show to print all the attribute info in one line.


# 1.41 02-Dec-2015 christos

Allow backup and restore to operate on files.


# 1.40 01-Dec-2015 christos

Reflect reality better; we don't handle multiple devices anymore, and
the partitions option is only for the commands that support it.


# 1.39 01-Dec-2015 christos

Firs step of refactoring, remove all globals, factor out some common code,
handle alternate usage but not advertise it.


# 1.38 30-Nov-2015 christos

- automatically sync the wedge information unless -n is specified.
- document the general options in the traditional way.
- split the main program into a separate file.


# 1.37 03-Nov-2015 jnemeth

Add a "header" subcommand that displays information about the size of
the disk along with information from the GPT header if it exists.


# 1.36 06-Dec-2014 wiz

Bump date for previous.


# 1.35 06-Dec-2014 mlelstv

Add some more common partition types.


# 1.34 04-Oct-2014 wiz

Remove trailing whitespace.


# 1.33 04-Oct-2014 christos

Allow specifying sector and media size on the command line.


# 1.32 29-Sep-2014 jnemeth

PR/47990 - Dr. Wolfgang Stukenbrock -- add "-L <label>" as selector option


# 1.31 28-Sep-2014 jnemeth

PR/44218 - David Young -- add "type" subcommand to change a partition type


# 1.30 23-Sep-2014 jnemeth

- make gpt_gpt() available for use directly by subcommands
- create new resizedisk disk subcommand for relocating backup GPT


# 1.29 20-Sep-2014 jnemeth

document the new restore subcommand


Revision tags: netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 tls-maxphys-base
# 1.28 19-Dec-2013 wiz

branches: 1.28.4;
Bump date for previous.


# 1.27 19-Dec-2013 jnemeth

Add the backup subcommand. It dumps the contents of the partition
tables as a plist, which is readable by the restore subcommand.

XXX restore subcommand forthcoming


# 1.26 09-Dec-2013 wiz

Fix typo.


# 1.25 09-Dec-2013 jnemeth

Add two new subcommands, "set" and "unset". These were inspired by
FreeBSD's gpart(8), but the code is all mine. The purpose of these
is to set and unset partition attributes.


# 1.24 09-Dec-2013 jnemeth

For the "show -i <entry>" subcommand, print Start and Size both in
terms of number of sectors and bytes.


# 1.23 08-Dec-2013 jnemeth

For the add and resize subcommands, change the -s option. If there is
no suffix, or the suffix is 's' or 'S', size is in sectors (as before)
otherwise size is in bytes.


# 1.22 06-Dec-2013 jnemeth

Don't attempt to create/resize an unaligned partition if the attempt
to create/resize an aligned one failed. This simplifies the code
and prevents surprises. If the user wants an unaligned partition
in the case where an aligned one fails, they can simply retry the
command without the "-a" option. This change was requested by
wiz@, and after some thought I agree with it.


# 1.21 30-Nov-2013 jnemeth

Add two new options:

-g which shows the GUID for a partition
-i which shows all the gory details for a particular option

XXX the output format of -i is subject to change


# 1.20 22-Nov-2013 jnemeth

bump date


# 1.19 22-Nov-2013 jnemeth

In the manpage:
- s/-b number/-b blocknr/
- s/-s count/-s sectors/
- s/-p count/-p partitions/

In the program:
- s/-b lba/-b blocknr/
- s/-s lba/-s sectors/

This makes the documentation in the manpage and the program consistent
and makes it more clear what the parameters are. Also, "-s lba" was
just plain wrong since LBA stands for Logical Block Address[ing], and
the -s option didn't represent any kind of address, but rather a size.


# 1.18 20-Nov-2013 wiz

shrunk.


# 1.17 20-Nov-2013 jnemeth

Add a resize command. This command was inspired by FreeBSD's gpart(8),
but the code was written by myself.


# 1.16 19-Nov-2013 jnemeth

update synopsis for add subcommand


# 1.15 19-Nov-2013 jnemeth

Add two new options to the "add" subcommand:

-a alignment -- attempt to align the start and size of the partition
-l label -- supply a label for the partition

These options were inspired by FreeBSD's gpart(8) command, but the
code was written by me.


# 1.14 24-Oct-2013 jnemeth

- markup
- typo; the label command labels partitions, not remove them
- migrate -s isn't applicable to NetBSD
- add information about the space required for migration
- add a "gpt show -l" example


# 1.13 20-Oct-2013 jnemeth

revert typo fix; teach me to blindly take changes from upstream


# 1.12 19-Oct-2013 jnemeth

type fix: accommodate. -> accomodate.


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6 yamt-pagecache-base5
# 1.11 02-May-2012 jakllsch

branches: 1.11.2;
Bump date to date of previous change.


Revision tags: yamt-pagecache-base4
# 1.10 09-Mar-2012 drochner

fix a path


Revision tags: netbsd-6-base
# 1.9 11-Nov-2011 wiz

branches: 1.9.2;
Add an EXAMPLE section showing how to add a swap file system using gpt. Bump date.


Revision tags: yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.8 19-Sep-2011 wiz

branches: 1.8.2;
Minimally document gpt recover. Bump date.


Revision tags: cherry-xenmp-base
# 1.7 27-Mar-2011 jym

Document biosboot. Xref boot(8) and installboot(8).


Revision tags: bouyer-quota2-nbase bouyer-quota2-base
# 1.6 09-Feb-2011 schnoebe

List all the aliases supported for GPT partition types.


Revision tags: matt-mips64-premerge-20101231 matt-premerge-20091211 jym-xensuspend-nbase jym-xensuspend-base
# 1.5 11-Mar-2009 joerg

branches: 1.5.2;
Don't workaround ancient macro argument limit with .Xo/.Xc.


# 1.4 09-Mar-2009 joerg

Fix preamble to match order set out by mdoc(7). Discussed with wiz.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 netbsd-5-0-RC2 netbsd-5-0-RC1 netbsd-5-base matt-mips64-base2 netbsd-4-0-1-RELEASE wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 wrstuden-fixsa-newbase wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 wrstuden-revivesa-base yamt-pf42-base mjf-devfs2-base keiichi-mipv6-base matt-armv6-nbase matt-armv6-prevmlocking wrstuden-fixsa-base-1 netbsd-4-0-RELEASE cube-autoconf-base mjf-devfs-base netbsd-4-0-RC5 netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 matt-armv6-base matt-mips64-base hpcarm-cleanup-base wrstuden-fixsa-base netbsd-4-base
# 1.3 24-Nov-2006 christos

branches: 1.3.28;
fix spelling of accommodate; from Zapher.


# 1.2 17-Oct-2006 wiz

Serial comma. Add RCS Id. Remove superfluous quotes.


# 1.1 15-Oct-2006 christos

branches: 1.1.1;
Initial revision


# 1.57 15-Jan-2018 sborrill

Explain what suffixes are accepted when specifying a size.


# 1.56 03-Oct-2017 mlelstv

clarify that alignment is the number of bytes to align to.


# 1.55 05-Aug-2017 wiz

Use Fx/Nx.


# 1.54 04-Aug-2017 kre

Fix a typo, and make a couple of minor wording improvements.
I resisted the (very weak) impulse to Americanise some spellings ...


# 1.53 03-Aug-2017 msaitoh

Add note about bootme flag:

The bootme flag is used to indicate which partiotion should be booted
by UEFI boot code.


Revision tags: matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320
# 1.52 16-Feb-2017 christos

Add -T timestamp for reproducible builds.


# 1.51 27-Jan-2017 abhinav

Fix spelling of partition.


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104
# 1.50 01-Nov-2016 jdolecek

branches: 1.50.2;
remove dup line


Revision tags: localcount-20160914
# 1.49 11-Sep-2016 sevan

Document the version gpt first appeared.
Replace contractions.
Bump date.


Revision tags: pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.48 09-Jun-2016 christos

branches: 1.48.2;
Rename 'a' to set the active PMBR flag to 'A'


# 1.47 09-Jun-2016 kre

Fix rendering of biosboot command synopsis.


# 1.46 09-Jun-2016 christos

PR/51230: Add the ability to set the active flag in the PMBR.


# 1.45 25-Dec-2015 wiz

Simplify usage for gpt show.


# 1.44 25-Dec-2015 martin

Add a -a flag to the show command, so we can display the full GPT with
all information in one go.


# 1.43 06-Dec-2015 wiz

Bump date for previous.
Remove trailing whitespace.


# 1.42 06-Dec-2015 christos

Add listing commands for type, set and unset.
Add help and formatting for set and unset.
Change show to print all the attribute info in one line.


# 1.41 02-Dec-2015 christos

Allow backup and restore to operate on files.


# 1.40 01-Dec-2015 christos

Reflect reality better; we don't handle multiple devices anymore, and
the partitions option is only for the commands that support it.


# 1.39 01-Dec-2015 christos

Firs step of refactoring, remove all globals, factor out some common code,
handle alternate usage but not advertise it.


# 1.38 30-Nov-2015 christos

- automatically sync the wedge information unless -n is specified.
- document the general options in the traditional way.
- split the main program into a separate file.


# 1.37 03-Nov-2015 jnemeth

Add a "header" subcommand that displays information about the size of
the disk along with information from the GPT header if it exists.


# 1.36 06-Dec-2014 wiz

Bump date for previous.


# 1.35 06-Dec-2014 mlelstv

Add some more common partition types.


# 1.34 04-Oct-2014 wiz

Remove trailing whitespace.


# 1.33 04-Oct-2014 christos

Allow specifying sector and media size on the command line.


# 1.32 29-Sep-2014 jnemeth

PR/47990 - Dr. Wolfgang Stukenbrock -- add "-L <label>" as selector option


# 1.31 28-Sep-2014 jnemeth

PR/44218 - David Young -- add "type" subcommand to change a partition type


# 1.30 23-Sep-2014 jnemeth

- make gpt_gpt() available for use directly by subcommands
- create new resizedisk disk subcommand for relocating backup GPT


# 1.29 20-Sep-2014 jnemeth

document the new restore subcommand


Revision tags: netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 tls-maxphys-base
# 1.28 19-Dec-2013 wiz

branches: 1.28.4;
Bump date for previous.


# 1.27 19-Dec-2013 jnemeth

Add the backup subcommand. It dumps the contents of the partition
tables as a plist, which is readable by the restore subcommand.

XXX restore subcommand forthcoming


# 1.26 09-Dec-2013 wiz

Fix typo.


# 1.25 09-Dec-2013 jnemeth

Add two new subcommands, "set" and "unset". These were inspired by
FreeBSD's gpart(8), but the code is all mine. The purpose of these
is to set and unset partition attributes.


# 1.24 09-Dec-2013 jnemeth

For the "show -i <entry>" subcommand, print Start and Size both in
terms of number of sectors and bytes.


# 1.23 08-Dec-2013 jnemeth

For the add and resize subcommands, change the -s option. If there is
no suffix, or the suffix is 's' or 'S', size is in sectors (as before)
otherwise size is in bytes.


# 1.22 06-Dec-2013 jnemeth

Don't attempt to create/resize an unaligned partition if the attempt
to create/resize an aligned one failed. This simplifies the code
and prevents surprises. If the user wants an unaligned partition
in the case where an aligned one fails, they can simply retry the
command without the "-a" option. This change was requested by
wiz@, and after some thought I agree with it.


# 1.21 30-Nov-2013 jnemeth

Add two new options:

-g which shows the GUID for a partition
-i which shows all the gory details for a particular option

XXX the output format of -i is subject to change


# 1.20 22-Nov-2013 jnemeth

bump date


# 1.19 22-Nov-2013 jnemeth

In the manpage:
- s/-b number/-b blocknr/
- s/-s count/-s sectors/
- s/-p count/-p partitions/

In the program:
- s/-b lba/-b blocknr/
- s/-s lba/-s sectors/

This makes the documentation in the manpage and the program consistent
and makes it more clear what the parameters are. Also, "-s lba" was
just plain wrong since LBA stands for Logical Block Address[ing], and
the -s option didn't represent any kind of address, but rather a size.


# 1.18 20-Nov-2013 wiz

shrunk.


# 1.17 20-Nov-2013 jnemeth

Add a resize command. This command was inspired by FreeBSD's gpart(8),
but the code was written by myself.


# 1.16 19-Nov-2013 jnemeth

update synopsis for add subcommand


# 1.15 19-Nov-2013 jnemeth

Add two new options to the "add" subcommand:

-a alignment -- attempt to align the start and size of the partition
-l label -- supply a label for the partition

These options were inspired by FreeBSD's gpart(8) command, but the
code was written by me.


# 1.14 24-Oct-2013 jnemeth

- markup
- typo; the label command labels partitions, not remove them
- migrate -s isn't applicable to NetBSD
- add information about the space required for migration
- add a "gpt show -l" example


# 1.13 20-Oct-2013 jnemeth

revert typo fix; teach me to blindly take changes from upstream


# 1.12 19-Oct-2013 jnemeth

type fix: accommodate. -> accomodate.


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6 yamt-pagecache-base5
# 1.11 02-May-2012 jakllsch

branches: 1.11.2;
Bump date to date of previous change.


Revision tags: yamt-pagecache-base4
# 1.10 09-Mar-2012 drochner

fix a path


Revision tags: netbsd-6-base
# 1.9 11-Nov-2011 wiz

branches: 1.9.2;
Add an EXAMPLE section showing how to add a swap file system using gpt. Bump date.


Revision tags: yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.8 19-Sep-2011 wiz

branches: 1.8.2;
Minimally document gpt recover. Bump date.


Revision tags: cherry-xenmp-base
# 1.7 27-Mar-2011 jym

Document biosboot. Xref boot(8) and installboot(8).


Revision tags: bouyer-quota2-nbase bouyer-quota2-base
# 1.6 09-Feb-2011 schnoebe

List all the aliases supported for GPT partition types.


Revision tags: matt-mips64-premerge-20101231 matt-premerge-20091211 jym-xensuspend-nbase jym-xensuspend-base
# 1.5 11-Mar-2009 joerg

branches: 1.5.2;
Don't workaround ancient macro argument limit with .Xo/.Xc.


# 1.4 09-Mar-2009 joerg

Fix preamble to match order set out by mdoc(7). Discussed with wiz.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 netbsd-5-0-RC2 netbsd-5-0-RC1 netbsd-5-base matt-mips64-base2 netbsd-4-0-1-RELEASE wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 wrstuden-fixsa-newbase wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 wrstuden-revivesa-base yamt-pf42-base mjf-devfs2-base keiichi-mipv6-base matt-armv6-nbase matt-armv6-prevmlocking wrstuden-fixsa-base-1 netbsd-4-0-RELEASE cube-autoconf-base mjf-devfs-base netbsd-4-0-RC5 netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 matt-armv6-base matt-mips64-base hpcarm-cleanup-base wrstuden-fixsa-base netbsd-4-base
# 1.3 24-Nov-2006 christos

branches: 1.3.28;
fix spelling of accommodate; from Zapher.


# 1.2 17-Oct-2006 wiz

Serial comma. Add RCS Id. Remove superfluous quotes.


# 1.1 15-Oct-2006 christos

branches: 1.1.1;
Initial revision


# 1.56 03-Oct-2017 mlelstv

clarify that alignment is the number of bytes to align to.


# 1.55 05-Aug-2017 wiz

Use Fx/Nx.


# 1.54 04-Aug-2017 kre

Fix a typo, and make a couple of minor wording improvements.
I resisted the (very weak) impulse to Americanise some spellings ...


# 1.53 03-Aug-2017 msaitoh

Add note about bootme flag:

The bootme flag is used to indicate which partiotion should be booted
by UEFI boot code.


Revision tags: perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320
# 1.52 16-Feb-2017 christos

Add -T timestamp for reproducible builds.


# 1.51 27-Jan-2017 abhinav

Fix spelling of partition.


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104
# 1.50 01-Nov-2016 jdolecek

branches: 1.50.2;
remove dup line


Revision tags: localcount-20160914
# 1.49 11-Sep-2016 sevan

Document the version gpt first appeared.
Replace contractions.
Bump date.


Revision tags: pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.48 09-Jun-2016 christos

branches: 1.48.2;
Rename 'a' to set the active PMBR flag to 'A'


# 1.47 09-Jun-2016 kre

Fix rendering of biosboot command synopsis.


# 1.46 09-Jun-2016 christos

PR/51230: Add the ability to set the active flag in the PMBR.


# 1.45 25-Dec-2015 wiz

Simplify usage for gpt show.


# 1.44 25-Dec-2015 martin

Add a -a flag to the show command, so we can display the full GPT with
all information in one go.


# 1.43 06-Dec-2015 wiz

Bump date for previous.
Remove trailing whitespace.


# 1.42 06-Dec-2015 christos

Add listing commands for type, set and unset.
Add help and formatting for set and unset.
Change show to print all the attribute info in one line.


# 1.41 02-Dec-2015 christos

Allow backup and restore to operate on files.


# 1.40 01-Dec-2015 christos

Reflect reality better; we don't handle multiple devices anymore, and
the partitions option is only for the commands that support it.


# 1.39 01-Dec-2015 christos

Firs step of refactoring, remove all globals, factor out some common code,
handle alternate usage but not advertise it.


# 1.38 30-Nov-2015 christos

- automatically sync the wedge information unless -n is specified.
- document the general options in the traditional way.
- split the main program into a separate file.


# 1.37 03-Nov-2015 jnemeth

Add a "header" subcommand that displays information about the size of
the disk along with information from the GPT header if it exists.


# 1.36 06-Dec-2014 wiz

Bump date for previous.


# 1.35 06-Dec-2014 mlelstv

Add some more common partition types.


# 1.34 04-Oct-2014 wiz

Remove trailing whitespace.


# 1.33 04-Oct-2014 christos

Allow specifying sector and media size on the command line.


# 1.32 29-Sep-2014 jnemeth

PR/47990 - Dr. Wolfgang Stukenbrock -- add "-L <label>" as selector option


# 1.31 28-Sep-2014 jnemeth

PR/44218 - David Young -- add "type" subcommand to change a partition type


# 1.30 23-Sep-2014 jnemeth

- make gpt_gpt() available for use directly by subcommands
- create new resizedisk disk subcommand for relocating backup GPT


# 1.29 20-Sep-2014 jnemeth

document the new restore subcommand


Revision tags: netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 tls-maxphys-base
# 1.28 19-Dec-2013 wiz

branches: 1.28.4;
Bump date for previous.


# 1.27 19-Dec-2013 jnemeth

Add the backup subcommand. It dumps the contents of the partition
tables as a plist, which is readable by the restore subcommand.

XXX restore subcommand forthcoming


# 1.26 09-Dec-2013 wiz

Fix typo.


# 1.25 09-Dec-2013 jnemeth

Add two new subcommands, "set" and "unset". These were inspired by
FreeBSD's gpart(8), but the code is all mine. The purpose of these
is to set and unset partition attributes.


# 1.24 09-Dec-2013 jnemeth

For the "show -i <entry>" subcommand, print Start and Size both in
terms of number of sectors and bytes.


# 1.23 08-Dec-2013 jnemeth

For the add and resize subcommands, change the -s option. If there is
no suffix, or the suffix is 's' or 'S', size is in sectors (as before)
otherwise size is in bytes.


# 1.22 06-Dec-2013 jnemeth

Don't attempt to create/resize an unaligned partition if the attempt
to create/resize an aligned one failed. This simplifies the code
and prevents surprises. If the user wants an unaligned partition
in the case where an aligned one fails, they can simply retry the
command without the "-a" option. This change was requested by
wiz@, and after some thought I agree with it.


# 1.21 30-Nov-2013 jnemeth

Add two new options:

-g which shows the GUID for a partition
-i which shows all the gory details for a particular option

XXX the output format of -i is subject to change


# 1.20 22-Nov-2013 jnemeth

bump date


# 1.19 22-Nov-2013 jnemeth

In the manpage:
- s/-b number/-b blocknr/
- s/-s count/-s sectors/
- s/-p count/-p partitions/

In the program:
- s/-b lba/-b blocknr/
- s/-s lba/-s sectors/

This makes the documentation in the manpage and the program consistent
and makes it more clear what the parameters are. Also, "-s lba" was
just plain wrong since LBA stands for Logical Block Address[ing], and
the -s option didn't represent any kind of address, but rather a size.


# 1.18 20-Nov-2013 wiz

shrunk.


# 1.17 20-Nov-2013 jnemeth

Add a resize command. This command was inspired by FreeBSD's gpart(8),
but the code was written by myself.


# 1.16 19-Nov-2013 jnemeth

update synopsis for add subcommand


# 1.15 19-Nov-2013 jnemeth

Add two new options to the "add" subcommand:

-a alignment -- attempt to align the start and size of the partition
-l label -- supply a label for the partition

These options were inspired by FreeBSD's gpart(8) command, but the
code was written by me.


# 1.14 24-Oct-2013 jnemeth

- markup
- typo; the label command labels partitions, not remove them
- migrate -s isn't applicable to NetBSD
- add information about the space required for migration
- add a "gpt show -l" example


# 1.13 20-Oct-2013 jnemeth

revert typo fix; teach me to blindly take changes from upstream


# 1.12 19-Oct-2013 jnemeth

type fix: accommodate. -> accomodate.


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6 yamt-pagecache-base5
# 1.11 02-May-2012 jakllsch

branches: 1.11.2;
Bump date to date of previous change.


Revision tags: yamt-pagecache-base4
# 1.10 09-Mar-2012 drochner

fix a path


Revision tags: netbsd-6-base
# 1.9 11-Nov-2011 wiz

branches: 1.9.2;
Add an EXAMPLE section showing how to add a swap file system using gpt. Bump date.


Revision tags: yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.8 19-Sep-2011 wiz

branches: 1.8.2;
Minimally document gpt recover. Bump date.


Revision tags: cherry-xenmp-base
# 1.7 27-Mar-2011 jym

Document biosboot. Xref boot(8) and installboot(8).


Revision tags: bouyer-quota2-nbase bouyer-quota2-base
# 1.6 09-Feb-2011 schnoebe

List all the aliases supported for GPT partition types.


Revision tags: matt-mips64-premerge-20101231 matt-premerge-20091211 jym-xensuspend-nbase jym-xensuspend-base
# 1.5 11-Mar-2009 joerg

branches: 1.5.2;
Don't workaround ancient macro argument limit with .Xo/.Xc.


# 1.4 09-Mar-2009 joerg

Fix preamble to match order set out by mdoc(7). Discussed with wiz.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 netbsd-5-0-RC2 netbsd-5-0-RC1 netbsd-5-base matt-mips64-base2 netbsd-4-0-1-RELEASE wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 wrstuden-fixsa-newbase wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 wrstuden-revivesa-base yamt-pf42-base mjf-devfs2-base keiichi-mipv6-base matt-armv6-nbase matt-armv6-prevmlocking wrstuden-fixsa-base-1 netbsd-4-0-RELEASE cube-autoconf-base mjf-devfs-base netbsd-4-0-RC5 netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 matt-armv6-base matt-mips64-base hpcarm-cleanup-base wrstuden-fixsa-base netbsd-4-base
# 1.3 24-Nov-2006 christos

branches: 1.3.28;
fix spelling of accommodate; from Zapher.


# 1.2 17-Oct-2006 wiz

Serial comma. Add RCS Id. Remove superfluous quotes.


# 1.1 15-Oct-2006 christos

branches: 1.1.1;
Initial revision


# 1.55 05-Aug-2017 wiz

Use Fx/Nx.


# 1.54 04-Aug-2017 kre

Fix a typo, and make a couple of minor wording improvements.
I resisted the (very weak) impulse to Americanise some spellings ...


# 1.53 03-Aug-2017 msaitoh

Add note about bootme flag:

The bootme flag is used to indicate which partiotion should be booted
by UEFI boot code.


Revision tags: perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320
# 1.52 16-Feb-2017 christos

Add -T timestamp for reproducible builds.


# 1.51 27-Jan-2017 abhinav

Fix spelling of partition.


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104
# 1.50 01-Nov-2016 jdolecek

branches: 1.50.2;
remove dup line


Revision tags: localcount-20160914
# 1.49 11-Sep-2016 sevan

Document the version gpt first appeared.
Replace contractions.
Bump date.


Revision tags: pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.48 09-Jun-2016 christos

branches: 1.48.2;
Rename 'a' to set the active PMBR flag to 'A'


# 1.47 09-Jun-2016 kre

Fix rendering of biosboot command synopsis.


# 1.46 09-Jun-2016 christos

PR/51230: Add the ability to set the active flag in the PMBR.


# 1.45 25-Dec-2015 wiz

Simplify usage for gpt show.


# 1.44 25-Dec-2015 martin

Add a -a flag to the show command, so we can display the full GPT with
all information in one go.


# 1.43 06-Dec-2015 wiz

Bump date for previous.
Remove trailing whitespace.


# 1.42 06-Dec-2015 christos

Add listing commands for type, set and unset.
Add help and formatting for set and unset.
Change show to print all the attribute info in one line.


# 1.41 02-Dec-2015 christos

Allow backup and restore to operate on files.


# 1.40 01-Dec-2015 christos

Reflect reality better; we don't handle multiple devices anymore, and
the partitions option is only for the commands that support it.


# 1.39 01-Dec-2015 christos

Firs step of refactoring, remove all globals, factor out some common code,
handle alternate usage but not advertise it.


# 1.38 30-Nov-2015 christos

- automatically sync the wedge information unless -n is specified.
- document the general options in the traditional way.
- split the main program into a separate file.


# 1.37 03-Nov-2015 jnemeth

Add a "header" subcommand that displays information about the size of
the disk along with information from the GPT header if it exists.


# 1.36 06-Dec-2014 wiz

Bump date for previous.


# 1.35 06-Dec-2014 mlelstv

Add some more common partition types.


# 1.34 04-Oct-2014 wiz

Remove trailing whitespace.


# 1.33 04-Oct-2014 christos

Allow specifying sector and media size on the command line.


# 1.32 29-Sep-2014 jnemeth

PR/47990 - Dr. Wolfgang Stukenbrock -- add "-L <label>" as selector option


# 1.31 28-Sep-2014 jnemeth

PR/44218 - David Young -- add "type" subcommand to change a partition type


# 1.30 23-Sep-2014 jnemeth

- make gpt_gpt() available for use directly by subcommands
- create new resizedisk disk subcommand for relocating backup GPT


# 1.29 20-Sep-2014 jnemeth

document the new restore subcommand


Revision tags: netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 tls-maxphys-base
# 1.28 19-Dec-2013 wiz

branches: 1.28.4;
Bump date for previous.


# 1.27 19-Dec-2013 jnemeth

Add the backup subcommand. It dumps the contents of the partition
tables as a plist, which is readable by the restore subcommand.

XXX restore subcommand forthcoming


# 1.26 09-Dec-2013 wiz

Fix typo.


# 1.25 09-Dec-2013 jnemeth

Add two new subcommands, "set" and "unset". These were inspired by
FreeBSD's gpart(8), but the code is all mine. The purpose of these
is to set and unset partition attributes.


# 1.24 09-Dec-2013 jnemeth

For the "show -i <entry>" subcommand, print Start and Size both in
terms of number of sectors and bytes.


# 1.23 08-Dec-2013 jnemeth

For the add and resize subcommands, change the -s option. If there is
no suffix, or the suffix is 's' or 'S', size is in sectors (as before)
otherwise size is in bytes.


# 1.22 06-Dec-2013 jnemeth

Don't attempt to create/resize an unaligned partition if the attempt
to create/resize an aligned one failed. This simplifies the code
and prevents surprises. If the user wants an unaligned partition
in the case where an aligned one fails, they can simply retry the
command without the "-a" option. This change was requested by
wiz@, and after some thought I agree with it.


# 1.21 30-Nov-2013 jnemeth

Add two new options:

-g which shows the GUID for a partition
-i which shows all the gory details for a particular option

XXX the output format of -i is subject to change


# 1.20 22-Nov-2013 jnemeth

bump date


# 1.19 22-Nov-2013 jnemeth

In the manpage:
- s/-b number/-b blocknr/
- s/-s count/-s sectors/
- s/-p count/-p partitions/

In the program:
- s/-b lba/-b blocknr/
- s/-s lba/-s sectors/

This makes the documentation in the manpage and the program consistent
and makes it more clear what the parameters are. Also, "-s lba" was
just plain wrong since LBA stands for Logical Block Address[ing], and
the -s option didn't represent any kind of address, but rather a size.


# 1.18 20-Nov-2013 wiz

shrunk.


# 1.17 20-Nov-2013 jnemeth

Add a resize command. This command was inspired by FreeBSD's gpart(8),
but the code was written by myself.


# 1.16 19-Nov-2013 jnemeth

update synopsis for add subcommand


# 1.15 19-Nov-2013 jnemeth

Add two new options to the "add" subcommand:

-a alignment -- attempt to align the start and size of the partition
-l label -- supply a label for the partition

These options were inspired by FreeBSD's gpart(8) command, but the
code was written by me.


# 1.14 24-Oct-2013 jnemeth

- markup
- typo; the label command labels partitions, not remove them
- migrate -s isn't applicable to NetBSD
- add information about the space required for migration
- add a "gpt show -l" example


# 1.13 20-Oct-2013 jnemeth

revert typo fix; teach me to blindly take changes from upstream


# 1.12 19-Oct-2013 jnemeth

type fix: accommodate. -> accomodate.


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6 yamt-pagecache-base5
# 1.11 02-May-2012 jakllsch

branches: 1.11.2;
Bump date to date of previous change.


Revision tags: yamt-pagecache-base4
# 1.10 09-Mar-2012 drochner

fix a path


Revision tags: netbsd-6-base
# 1.9 11-Nov-2011 wiz

branches: 1.9.2;
Add an EXAMPLE section showing how to add a swap file system using gpt. Bump date.


Revision tags: yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.8 19-Sep-2011 wiz

branches: 1.8.2;
Minimally document gpt recover. Bump date.


Revision tags: cherry-xenmp-base
# 1.7 27-Mar-2011 jym

Document biosboot. Xref boot(8) and installboot(8).


Revision tags: bouyer-quota2-nbase bouyer-quota2-base
# 1.6 09-Feb-2011 schnoebe

List all the aliases supported for GPT partition types.


Revision tags: matt-mips64-premerge-20101231 matt-premerge-20091211 jym-xensuspend-nbase jym-xensuspend-base
# 1.5 11-Mar-2009 joerg

branches: 1.5.2;
Don't workaround ancient macro argument limit with .Xo/.Xc.


# 1.4 09-Mar-2009 joerg

Fix preamble to match order set out by mdoc(7). Discussed with wiz.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 netbsd-5-0-RC2 netbsd-5-0-RC1 netbsd-5-base matt-mips64-base2 netbsd-4-0-1-RELEASE wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 wrstuden-fixsa-newbase wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 wrstuden-revivesa-base yamt-pf42-base mjf-devfs2-base keiichi-mipv6-base matt-armv6-nbase matt-armv6-prevmlocking wrstuden-fixsa-base-1 netbsd-4-0-RELEASE cube-autoconf-base mjf-devfs-base netbsd-4-0-RC5 netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 matt-armv6-base matt-mips64-base hpcarm-cleanup-base wrstuden-fixsa-base netbsd-4-base
# 1.3 24-Nov-2006 christos

branches: 1.3.28;
fix spelling of accommodate; from Zapher.


# 1.2 17-Oct-2006 wiz

Serial comma. Add RCS Id. Remove superfluous quotes.


# 1.1 15-Oct-2006 christos

branches: 1.1.1;
Initial revision


# 1.54 04-Aug-2017 kre

Fix a typo, and make a couple of minor wording improvements.
I resisted the (very weak) impulse to Americanise some spellings ...


# 1.53 03-Aug-2017 msaitoh

Add note about bootme flag:

The bootme flag is used to indicate which partiotion should be booted
by UEFI boot code.


Revision tags: perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320
# 1.52 16-Feb-2017 christos

Add -T timestamp for reproducible builds.


# 1.51 27-Jan-2017 abhinav

Fix spelling of partition.


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104
# 1.50 01-Nov-2016 jdolecek

branches: 1.50.2;
remove dup line


Revision tags: localcount-20160914
# 1.49 11-Sep-2016 sevan

Document the version gpt first appeared.
Replace contractions.
Bump date.


Revision tags: pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.48 09-Jun-2016 christos

branches: 1.48.2;
Rename 'a' to set the active PMBR flag to 'A'


# 1.47 09-Jun-2016 kre

Fix rendering of biosboot command synopsis.


# 1.46 09-Jun-2016 christos

PR/51230: Add the ability to set the active flag in the PMBR.


# 1.45 25-Dec-2015 wiz

Simplify usage for gpt show.


# 1.44 25-Dec-2015 martin

Add a -a flag to the show command, so we can display the full GPT with
all information in one go.


# 1.43 06-Dec-2015 wiz

Bump date for previous.
Remove trailing whitespace.


# 1.42 06-Dec-2015 christos

Add listing commands for type, set and unset.
Add help and formatting for set and unset.
Change show to print all the attribute info in one line.


# 1.41 02-Dec-2015 christos

Allow backup and restore to operate on files.


# 1.40 01-Dec-2015 christos

Reflect reality better; we don't handle multiple devices anymore, and
the partitions option is only for the commands that support it.


# 1.39 01-Dec-2015 christos

Firs step of refactoring, remove all globals, factor out some common code,
handle alternate usage but not advertise it.


# 1.38 30-Nov-2015 christos

- automatically sync the wedge information unless -n is specified.
- document the general options in the traditional way.
- split the main program into a separate file.


# 1.37 03-Nov-2015 jnemeth

Add a "header" subcommand that displays information about the size of
the disk along with information from the GPT header if it exists.


# 1.36 06-Dec-2014 wiz

Bump date for previous.


# 1.35 06-Dec-2014 mlelstv

Add some more common partition types.


# 1.34 04-Oct-2014 wiz

Remove trailing whitespace.


# 1.33 04-Oct-2014 christos

Allow specifying sector and media size on the command line.


# 1.32 29-Sep-2014 jnemeth

PR/47990 - Dr. Wolfgang Stukenbrock -- add "-L <label>" as selector option


# 1.31 28-Sep-2014 jnemeth

PR/44218 - David Young -- add "type" subcommand to change a partition type


# 1.30 23-Sep-2014 jnemeth

- make gpt_gpt() available for use directly by subcommands
- create new resizedisk disk subcommand for relocating backup GPT


# 1.29 20-Sep-2014 jnemeth

document the new restore subcommand


Revision tags: netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 tls-maxphys-base
# 1.28 19-Dec-2013 wiz

branches: 1.28.4;
Bump date for previous.


# 1.27 19-Dec-2013 jnemeth

Add the backup subcommand. It dumps the contents of the partition
tables as a plist, which is readable by the restore subcommand.

XXX restore subcommand forthcoming


# 1.26 09-Dec-2013 wiz

Fix typo.


# 1.25 09-Dec-2013 jnemeth

Add two new subcommands, "set" and "unset". These were inspired by
FreeBSD's gpart(8), but the code is all mine. The purpose of these
is to set and unset partition attributes.


# 1.24 09-Dec-2013 jnemeth

For the "show -i <entry>" subcommand, print Start and Size both in
terms of number of sectors and bytes.


# 1.23 08-Dec-2013 jnemeth

For the add and resize subcommands, change the -s option. If there is
no suffix, or the suffix is 's' or 'S', size is in sectors (as before)
otherwise size is in bytes.


# 1.22 06-Dec-2013 jnemeth

Don't attempt to create/resize an unaligned partition if the attempt
to create/resize an aligned one failed. This simplifies the code
and prevents surprises. If the user wants an unaligned partition
in the case where an aligned one fails, they can simply retry the
command without the "-a" option. This change was requested by
wiz@, and after some thought I agree with it.


# 1.21 30-Nov-2013 jnemeth

Add two new options:

-g which shows the GUID for a partition
-i which shows all the gory details for a particular option

XXX the output format of -i is subject to change


# 1.20 22-Nov-2013 jnemeth

bump date


# 1.19 22-Nov-2013 jnemeth

In the manpage:
- s/-b number/-b blocknr/
- s/-s count/-s sectors/
- s/-p count/-p partitions/

In the program:
- s/-b lba/-b blocknr/
- s/-s lba/-s sectors/

This makes the documentation in the manpage and the program consistent
and makes it more clear what the parameters are. Also, "-s lba" was
just plain wrong since LBA stands for Logical Block Address[ing], and
the -s option didn't represent any kind of address, but rather a size.


# 1.18 20-Nov-2013 wiz

shrunk.


# 1.17 20-Nov-2013 jnemeth

Add a resize command. This command was inspired by FreeBSD's gpart(8),
but the code was written by myself.


# 1.16 19-Nov-2013 jnemeth

update synopsis for add subcommand


# 1.15 19-Nov-2013 jnemeth

Add two new options to the "add" subcommand:

-a alignment -- attempt to align the start and size of the partition
-l label -- supply a label for the partition

These options were inspired by FreeBSD's gpart(8) command, but the
code was written by me.


# 1.14 24-Oct-2013 jnemeth

- markup
- typo; the label command labels partitions, not remove them
- migrate -s isn't applicable to NetBSD
- add information about the space required for migration
- add a "gpt show -l" example


# 1.13 20-Oct-2013 jnemeth

revert typo fix; teach me to blindly take changes from upstream


# 1.12 19-Oct-2013 jnemeth

type fix: accommodate. -> accomodate.


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6 yamt-pagecache-base5
# 1.11 02-May-2012 jakllsch

branches: 1.11.2;
Bump date to date of previous change.


Revision tags: yamt-pagecache-base4
# 1.10 09-Mar-2012 drochner

fix a path


Revision tags: netbsd-6-base
# 1.9 11-Nov-2011 wiz

branches: 1.9.2;
Add an EXAMPLE section showing how to add a swap file system using gpt. Bump date.


Revision tags: yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.8 19-Sep-2011 wiz

branches: 1.8.2;
Minimally document gpt recover. Bump date.


Revision tags: cherry-xenmp-base
# 1.7 27-Mar-2011 jym

Document biosboot. Xref boot(8) and installboot(8).


Revision tags: bouyer-quota2-nbase bouyer-quota2-base
# 1.6 09-Feb-2011 schnoebe

List all the aliases supported for GPT partition types.


Revision tags: matt-mips64-premerge-20101231 matt-premerge-20091211 jym-xensuspend-nbase jym-xensuspend-base
# 1.5 11-Mar-2009 joerg

branches: 1.5.2;
Don't workaround ancient macro argument limit with .Xo/.Xc.


# 1.4 09-Mar-2009 joerg

Fix preamble to match order set out by mdoc(7). Discussed with wiz.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 netbsd-5-0-RC2 netbsd-5-0-RC1 netbsd-5-base matt-mips64-base2 netbsd-4-0-1-RELEASE wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 wrstuden-fixsa-newbase wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 wrstuden-revivesa-base yamt-pf42-base mjf-devfs2-base keiichi-mipv6-base matt-armv6-nbase matt-armv6-prevmlocking wrstuden-fixsa-base-1 netbsd-4-0-RELEASE cube-autoconf-base mjf-devfs-base netbsd-4-0-RC5 netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 matt-armv6-base matt-mips64-base hpcarm-cleanup-base wrstuden-fixsa-base netbsd-4-base
# 1.3 24-Nov-2006 christos

branches: 1.3.28;
fix spelling of accommodate; from Zapher.


# 1.2 17-Oct-2006 wiz

Serial comma. Add RCS Id. Remove superfluous quotes.


# 1.1 15-Oct-2006 christos

branches: 1.1.1;
Initial revision


# 1.52 16-Feb-2017 christos

Add -T timestamp for reproducible builds.


# 1.51 27-Jan-2017 abhinav

Fix spelling of partition.


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104
# 1.50 01-Nov-2016 jdolecek

remove dup line


Revision tags: localcount-20160914
# 1.49 11-Sep-2016 sevan

Document the version gpt first appeared.
Replace contractions.
Bump date.


Revision tags: pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.48 09-Jun-2016 christos

branches: 1.48.2;
Rename 'a' to set the active PMBR flag to 'A'


# 1.47 09-Jun-2016 kre

Fix rendering of biosboot command synopsis.


# 1.46 09-Jun-2016 christos

PR/51230: Add the ability to set the active flag in the PMBR.


# 1.45 25-Dec-2015 wiz

Simplify usage for gpt show.


# 1.44 25-Dec-2015 martin

Add a -a flag to the show command, so we can display the full GPT with
all information in one go.


# 1.43 06-Dec-2015 wiz

Bump date for previous.
Remove trailing whitespace.


# 1.42 06-Dec-2015 christos

Add listing commands for type, set and unset.
Add help and formatting for set and unset.
Change show to print all the attribute info in one line.


# 1.41 02-Dec-2015 christos

Allow backup and restore to operate on files.


# 1.40 01-Dec-2015 christos

Reflect reality better; we don't handle multiple devices anymore, and
the partitions option is only for the commands that support it.


# 1.39 01-Dec-2015 christos

Firs step of refactoring, remove all globals, factor out some common code,
handle alternate usage but not advertise it.


# 1.38 30-Nov-2015 christos

- automatically sync the wedge information unless -n is specified.
- document the general options in the traditional way.
- split the main program into a separate file.


# 1.37 03-Nov-2015 jnemeth

Add a "header" subcommand that displays information about the size of
the disk along with information from the GPT header if it exists.


# 1.36 06-Dec-2014 wiz

Bump date for previous.


# 1.35 06-Dec-2014 mlelstv

Add some more common partition types.


# 1.34 04-Oct-2014 wiz

Remove trailing whitespace.


# 1.33 04-Oct-2014 christos

Allow specifying sector and media size on the command line.


# 1.32 29-Sep-2014 jnemeth

PR/47990 - Dr. Wolfgang Stukenbrock -- add "-L <label>" as selector option


# 1.31 28-Sep-2014 jnemeth

PR/44218 - David Young -- add "type" subcommand to change a partition type


# 1.30 23-Sep-2014 jnemeth

- make gpt_gpt() available for use directly by subcommands
- create new resizedisk disk subcommand for relocating backup GPT


# 1.29 20-Sep-2014 jnemeth

document the new restore subcommand


Revision tags: netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 tls-maxphys-base
# 1.28 19-Dec-2013 wiz

branches: 1.28.4;
Bump date for previous.


# 1.27 19-Dec-2013 jnemeth

Add the backup subcommand. It dumps the contents of the partition
tables as a plist, which is readable by the restore subcommand.

XXX restore subcommand forthcoming


# 1.26 09-Dec-2013 wiz

Fix typo.


# 1.25 09-Dec-2013 jnemeth

Add two new subcommands, "set" and "unset". These were inspired by
FreeBSD's gpart(8), but the code is all mine. The purpose of these
is to set and unset partition attributes.


# 1.24 09-Dec-2013 jnemeth

For the "show -i <entry>" subcommand, print Start and Size both in
terms of number of sectors and bytes.


# 1.23 08-Dec-2013 jnemeth

For the add and resize subcommands, change the -s option. If there is
no suffix, or the suffix is 's' or 'S', size is in sectors (as before)
otherwise size is in bytes.


# 1.22 06-Dec-2013 jnemeth

Don't attempt to create/resize an unaligned partition if the attempt
to create/resize an aligned one failed. This simplifies the code
and prevents surprises. If the user wants an unaligned partition
in the case where an aligned one fails, they can simply retry the
command without the "-a" option. This change was requested by
wiz@, and after some thought I agree with it.


# 1.21 30-Nov-2013 jnemeth

Add two new options:

-g which shows the GUID for a partition
-i which shows all the gory details for a particular option

XXX the output format of -i is subject to change


# 1.20 22-Nov-2013 jnemeth

bump date


# 1.19 22-Nov-2013 jnemeth

In the manpage:
- s/-b number/-b blocknr/
- s/-s count/-s sectors/
- s/-p count/-p partitions/

In the program:
- s/-b lba/-b blocknr/
- s/-s lba/-s sectors/

This makes the documentation in the manpage and the program consistent
and makes it more clear what the parameters are. Also, "-s lba" was
just plain wrong since LBA stands for Logical Block Address[ing], and
the -s option didn't represent any kind of address, but rather a size.


# 1.18 20-Nov-2013 wiz

shrunk.


# 1.17 20-Nov-2013 jnemeth

Add a resize command. This command was inspired by FreeBSD's gpart(8),
but the code was written by myself.


# 1.16 19-Nov-2013 jnemeth

update synopsis for add subcommand


# 1.15 19-Nov-2013 jnemeth

Add two new options to the "add" subcommand:

-a alignment -- attempt to align the start and size of the partition
-l label -- supply a label for the partition

These options were inspired by FreeBSD's gpart(8) command, but the
code was written by me.


# 1.14 24-Oct-2013 jnemeth

- markup
- typo; the label command labels partitions, not remove them
- migrate -s isn't applicable to NetBSD
- add information about the space required for migration
- add a "gpt show -l" example


# 1.13 20-Oct-2013 jnemeth

revert typo fix; teach me to blindly take changes from upstream


# 1.12 19-Oct-2013 jnemeth

type fix: accommodate. -> accomodate.


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6 yamt-pagecache-base5
# 1.11 02-May-2012 jakllsch

branches: 1.11.2;
Bump date to date of previous change.


Revision tags: yamt-pagecache-base4
# 1.10 09-Mar-2012 drochner

fix a path


Revision tags: netbsd-6-base
# 1.9 11-Nov-2011 wiz

branches: 1.9.2;
Add an EXAMPLE section showing how to add a swap file system using gpt. Bump date.


Revision tags: yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.8 19-Sep-2011 wiz

branches: 1.8.2;
Minimally document gpt recover. Bump date.


Revision tags: cherry-xenmp-base
# 1.7 27-Mar-2011 jym

Document biosboot. Xref boot(8) and installboot(8).


Revision tags: bouyer-quota2-nbase bouyer-quota2-base
# 1.6 09-Feb-2011 schnoebe

List all the aliases supported for GPT partition types.


Revision tags: matt-mips64-premerge-20101231 matt-premerge-20091211 jym-xensuspend-nbase jym-xensuspend-base
# 1.5 11-Mar-2009 joerg

branches: 1.5.2;
Don't workaround ancient macro argument limit with .Xo/.Xc.


# 1.4 09-Mar-2009 joerg

Fix preamble to match order set out by mdoc(7). Discussed with wiz.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 netbsd-5-0-RC2 netbsd-5-0-RC1 netbsd-5-base matt-mips64-base2 netbsd-4-0-1-RELEASE wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 wrstuden-fixsa-newbase wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 wrstuden-revivesa-base yamt-pf42-base mjf-devfs2-base keiichi-mipv6-base matt-armv6-nbase matt-armv6-prevmlocking wrstuden-fixsa-base-1 netbsd-4-0-RELEASE cube-autoconf-base mjf-devfs-base netbsd-4-0-RC5 netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 matt-armv6-base matt-mips64-base hpcarm-cleanup-base wrstuden-fixsa-base netbsd-4-base
# 1.3 24-Nov-2006 christos

branches: 1.3.28;
fix spelling of accommodate; from Zapher.


# 1.2 17-Oct-2006 wiz

Serial comma. Add RCS Id. Remove superfluous quotes.


# 1.1 15-Oct-2006 christos

branches: 1.1.1;
Initial revision


# 1.51 27-Jan-2017 abhinav

Fix spelling of partition.


Revision tags: bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104
# 1.50 01-Nov-2016 jdolecek

remove dup line


Revision tags: localcount-20160914
# 1.49 11-Sep-2016 sevan

Document the version gpt first appeared.
Replace contractions.
Bump date.


Revision tags: pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.48 09-Jun-2016 christos

branches: 1.48.2;
Rename 'a' to set the active PMBR flag to 'A'


# 1.47 09-Jun-2016 kre

Fix rendering of biosboot command synopsis.


# 1.46 09-Jun-2016 christos

PR/51230: Add the ability to set the active flag in the PMBR.


# 1.45 25-Dec-2015 wiz

Simplify usage for gpt show.


# 1.44 25-Dec-2015 martin

Add a -a flag to the show command, so we can display the full GPT with
all information in one go.


# 1.43 06-Dec-2015 wiz

Bump date for previous.
Remove trailing whitespace.


# 1.42 06-Dec-2015 christos

Add listing commands for type, set and unset.
Add help and formatting for set and unset.
Change show to print all the attribute info in one line.


# 1.41 02-Dec-2015 christos

Allow backup and restore to operate on files.


# 1.40 01-Dec-2015 christos

Reflect reality better; we don't handle multiple devices anymore, and
the partitions option is only for the commands that support it.


# 1.39 01-Dec-2015 christos

Firs step of refactoring, remove all globals, factor out some common code,
handle alternate usage but not advertise it.


# 1.38 30-Nov-2015 christos

- automatically sync the wedge information unless -n is specified.
- document the general options in the traditional way.
- split the main program into a separate file.


# 1.37 03-Nov-2015 jnemeth

Add a "header" subcommand that displays information about the size of
the disk along with information from the GPT header if it exists.


# 1.36 06-Dec-2014 wiz

Bump date for previous.


# 1.35 06-Dec-2014 mlelstv

Add some more common partition types.


# 1.34 04-Oct-2014 wiz

Remove trailing whitespace.


# 1.33 04-Oct-2014 christos

Allow specifying sector and media size on the command line.


# 1.32 29-Sep-2014 jnemeth

PR/47990 - Dr. Wolfgang Stukenbrock -- add "-L <label>" as selector option


# 1.31 28-Sep-2014 jnemeth

PR/44218 - David Young -- add "type" subcommand to change a partition type


# 1.30 23-Sep-2014 jnemeth

- make gpt_gpt() available for use directly by subcommands
- create new resizedisk disk subcommand for relocating backup GPT


# 1.29 20-Sep-2014 jnemeth

document the new restore subcommand


Revision tags: netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 tls-maxphys-base
# 1.28 19-Dec-2013 wiz

branches: 1.28.4;
Bump date for previous.


# 1.27 19-Dec-2013 jnemeth

Add the backup subcommand. It dumps the contents of the partition
tables as a plist, which is readable by the restore subcommand.

XXX restore subcommand forthcoming


# 1.26 09-Dec-2013 wiz

Fix typo.


# 1.25 09-Dec-2013 jnemeth

Add two new subcommands, "set" and "unset". These were inspired by
FreeBSD's gpart(8), but the code is all mine. The purpose of these
is to set and unset partition attributes.


# 1.24 09-Dec-2013 jnemeth

For the "show -i <entry>" subcommand, print Start and Size both in
terms of number of sectors and bytes.


# 1.23 08-Dec-2013 jnemeth

For the add and resize subcommands, change the -s option. If there is
no suffix, or the suffix is 's' or 'S', size is in sectors (as before)
otherwise size is in bytes.


# 1.22 06-Dec-2013 jnemeth

Don't attempt to create/resize an unaligned partition if the attempt
to create/resize an aligned one failed. This simplifies the code
and prevents surprises. If the user wants an unaligned partition
in the case where an aligned one fails, they can simply retry the
command without the "-a" option. This change was requested by
wiz@, and after some thought I agree with it.


# 1.21 30-Nov-2013 jnemeth

Add two new options:

-g which shows the GUID for a partition
-i which shows all the gory details for a particular option

XXX the output format of -i is subject to change


# 1.20 22-Nov-2013 jnemeth

bump date


# 1.19 22-Nov-2013 jnemeth

In the manpage:
- s/-b number/-b blocknr/
- s/-s count/-s sectors/
- s/-p count/-p partitions/

In the program:
- s/-b lba/-b blocknr/
- s/-s lba/-s sectors/

This makes the documentation in the manpage and the program consistent
and makes it more clear what the parameters are. Also, "-s lba" was
just plain wrong since LBA stands for Logical Block Address[ing], and
the -s option didn't represent any kind of address, but rather a size.


# 1.18 20-Nov-2013 wiz

shrunk.


# 1.17 20-Nov-2013 jnemeth

Add a resize command. This command was inspired by FreeBSD's gpart(8),
but the code was written by myself.


# 1.16 19-Nov-2013 jnemeth

update synopsis for add subcommand


# 1.15 19-Nov-2013 jnemeth

Add two new options to the "add" subcommand:

-a alignment -- attempt to align the start and size of the partition
-l label -- supply a label for the partition

These options were inspired by FreeBSD's gpart(8) command, but the
code was written by me.


# 1.14 24-Oct-2013 jnemeth

- markup
- typo; the label command labels partitions, not remove them
- migrate -s isn't applicable to NetBSD
- add information about the space required for migration
- add a "gpt show -l" example


# 1.13 20-Oct-2013 jnemeth

revert typo fix; teach me to blindly take changes from upstream


# 1.12 19-Oct-2013 jnemeth

type fix: accommodate. -> accomodate.


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6 yamt-pagecache-base5
# 1.11 02-May-2012 jakllsch

branches: 1.11.2;
Bump date to date of previous change.


Revision tags: yamt-pagecache-base4
# 1.10 09-Mar-2012 drochner

fix a path


Revision tags: netbsd-6-base
# 1.9 11-Nov-2011 wiz

branches: 1.9.2;
Add an EXAMPLE section showing how to add a swap file system using gpt. Bump date.


Revision tags: yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.8 19-Sep-2011 wiz

branches: 1.8.2;
Minimally document gpt recover. Bump date.


Revision tags: cherry-xenmp-base
# 1.7 27-Mar-2011 jym

Document biosboot. Xref boot(8) and installboot(8).


Revision tags: bouyer-quota2-nbase bouyer-quota2-base
# 1.6 09-Feb-2011 schnoebe

List all the aliases supported for GPT partition types.


Revision tags: matt-mips64-premerge-20101231 matt-premerge-20091211 jym-xensuspend-nbase jym-xensuspend-base
# 1.5 11-Mar-2009 joerg

branches: 1.5.2;
Don't workaround ancient macro argument limit with .Xo/.Xc.


# 1.4 09-Mar-2009 joerg

Fix preamble to match order set out by mdoc(7). Discussed with wiz.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 netbsd-5-0-RC2 netbsd-5-0-RC1 netbsd-5-base matt-mips64-base2 netbsd-4-0-1-RELEASE wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 wrstuden-fixsa-newbase wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 wrstuden-revivesa-base yamt-pf42-base mjf-devfs2-base keiichi-mipv6-base matt-armv6-nbase matt-armv6-prevmlocking wrstuden-fixsa-base-1 netbsd-4-0-RELEASE cube-autoconf-base mjf-devfs-base netbsd-4-0-RC5 netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 matt-armv6-base matt-mips64-base hpcarm-cleanup-base wrstuden-fixsa-base netbsd-4-base
# 1.3 24-Nov-2006 christos

branches: 1.3.28;
fix spelling of accommodate; from Zapher.


# 1.2 17-Oct-2006 wiz

Serial comma. Add RCS Id. Remove superfluous quotes.


# 1.1 15-Oct-2006 christos

branches: 1.1.1;
Initial revision


Revision tags: pgoyette-localcount-20161104
# 1.50 01-Nov-2016 jdolecek

remove dup line


Revision tags: localcount-20160914
# 1.49 11-Sep-2016 sevan

Document the version gpt first appeared.
Replace contractions.
Bump date.


Revision tags: pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.48 09-Jun-2016 christos

branches: 1.48.2;
Rename 'a' to set the active PMBR flag to 'A'


# 1.47 09-Jun-2016 kre

Fix rendering of biosboot command synopsis.


# 1.46 09-Jun-2016 christos

PR/51230: Add the ability to set the active flag in the PMBR.


# 1.45 25-Dec-2015 wiz

Simplify usage for gpt show.


# 1.44 25-Dec-2015 martin

Add a -a flag to the show command, so we can display the full GPT with
all information in one go.


# 1.43 06-Dec-2015 wiz

Bump date for previous.
Remove trailing whitespace.


# 1.42 06-Dec-2015 christos

Add listing commands for type, set and unset.
Add help and formatting for set and unset.
Change show to print all the attribute info in one line.


# 1.41 02-Dec-2015 christos

Allow backup and restore to operate on files.


# 1.40 01-Dec-2015 christos

Reflect reality better; we don't handle multiple devices anymore, and
the partitions option is only for the commands that support it.


# 1.39 01-Dec-2015 christos

Firs step of refactoring, remove all globals, factor out some common code,
handle alternate usage but not advertise it.


# 1.38 30-Nov-2015 christos

- automatically sync the wedge information unless -n is specified.
- document the general options in the traditional way.
- split the main program into a separate file.


# 1.37 03-Nov-2015 jnemeth

Add a "header" subcommand that displays information about the size of
the disk along with information from the GPT header if it exists.


# 1.36 06-Dec-2014 wiz

Bump date for previous.


# 1.35 06-Dec-2014 mlelstv

Add some more common partition types.


# 1.34 04-Oct-2014 wiz

Remove trailing whitespace.


# 1.33 04-Oct-2014 christos

Allow specifying sector and media size on the command line.


# 1.32 29-Sep-2014 jnemeth

PR/47990 - Dr. Wolfgang Stukenbrock -- add "-L <label>" as selector option


# 1.31 28-Sep-2014 jnemeth

PR/44218 - David Young -- add "type" subcommand to change a partition type


# 1.30 23-Sep-2014 jnemeth

- make gpt_gpt() available for use directly by subcommands
- create new resizedisk disk subcommand for relocating backup GPT


# 1.29 20-Sep-2014 jnemeth

document the new restore subcommand


Revision tags: netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 tls-maxphys-base
# 1.28 19-Dec-2013 wiz

branches: 1.28.4;
Bump date for previous.


# 1.27 19-Dec-2013 jnemeth

Add the backup subcommand. It dumps the contents of the partition
tables as a plist, which is readable by the restore subcommand.

XXX restore subcommand forthcoming


# 1.26 09-Dec-2013 wiz

Fix typo.


# 1.25 09-Dec-2013 jnemeth

Add two new subcommands, "set" and "unset". These were inspired by
FreeBSD's gpart(8), but the code is all mine. The purpose of these
is to set and unset partition attributes.


# 1.24 09-Dec-2013 jnemeth

For the "show -i <entry>" subcommand, print Start and Size both in
terms of number of sectors and bytes.


# 1.23 08-Dec-2013 jnemeth

For the add and resize subcommands, change the -s option. If there is
no suffix, or the suffix is 's' or 'S', size is in sectors (as before)
otherwise size is in bytes.


# 1.22 06-Dec-2013 jnemeth

Don't attempt to create/resize an unaligned partition if the attempt
to create/resize an aligned one failed. This simplifies the code
and prevents surprises. If the user wants an unaligned partition
in the case where an aligned one fails, they can simply retry the
command without the "-a" option. This change was requested by
wiz@, and after some thought I agree with it.


# 1.21 30-Nov-2013 jnemeth

Add two new options:

-g which shows the GUID for a partition
-i which shows all the gory details for a particular option

XXX the output format of -i is subject to change


# 1.20 22-Nov-2013 jnemeth

bump date


# 1.19 22-Nov-2013 jnemeth

In the manpage:
- s/-b number/-b blocknr/
- s/-s count/-s sectors/
- s/-p count/-p partitions/

In the program:
- s/-b lba/-b blocknr/
- s/-s lba/-s sectors/

This makes the documentation in the manpage and the program consistent
and makes it more clear what the parameters are. Also, "-s lba" was
just plain wrong since LBA stands for Logical Block Address[ing], and
the -s option didn't represent any kind of address, but rather a size.


# 1.18 20-Nov-2013 wiz

shrunk.


# 1.17 20-Nov-2013 jnemeth

Add a resize command. This command was inspired by FreeBSD's gpart(8),
but the code was written by myself.


# 1.16 19-Nov-2013 jnemeth

update synopsis for add subcommand


# 1.15 19-Nov-2013 jnemeth

Add two new options to the "add" subcommand:

-a alignment -- attempt to align the start and size of the partition
-l label -- supply a label for the partition

These options were inspired by FreeBSD's gpart(8) command, but the
code was written by me.


# 1.14 24-Oct-2013 jnemeth

- markup
- typo; the label command labels partitions, not remove them
- migrate -s isn't applicable to NetBSD
- add information about the space required for migration
- add a "gpt show -l" example


# 1.13 20-Oct-2013 jnemeth

revert typo fix; teach me to blindly take changes from upstream


# 1.12 19-Oct-2013 jnemeth

type fix: accommodate. -> accomodate.


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6 yamt-pagecache-base5
# 1.11 02-May-2012 jakllsch

branches: 1.11.2;
Bump date to date of previous change.


Revision tags: yamt-pagecache-base4
# 1.10 09-Mar-2012 drochner

fix a path


Revision tags: netbsd-6-base
# 1.9 11-Nov-2011 wiz

branches: 1.9.2;
Add an EXAMPLE section showing how to add a swap file system using gpt. Bump date.


Revision tags: yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.8 19-Sep-2011 wiz

branches: 1.8.2;
Minimally document gpt recover. Bump date.


Revision tags: cherry-xenmp-base
# 1.7 27-Mar-2011 jym

Document biosboot. Xref boot(8) and installboot(8).


Revision tags: bouyer-quota2-nbase bouyer-quota2-base
# 1.6 09-Feb-2011 schnoebe

List all the aliases supported for GPT partition types.


Revision tags: matt-mips64-premerge-20101231 matt-premerge-20091211 jym-xensuspend-nbase jym-xensuspend-base
# 1.5 11-Mar-2009 joerg

branches: 1.5.2;
Don't workaround ancient macro argument limit with .Xo/.Xc.


# 1.4 09-Mar-2009 joerg

Fix preamble to match order set out by mdoc(7). Discussed with wiz.


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 netbsd-5-0-RC2 netbsd-5-0-RC1 netbsd-5-base matt-mips64-base2 netbsd-4-0-1-RELEASE wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 wrstuden-fixsa-newbase wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 wrstuden-revivesa-base yamt-pf42-base mjf-devfs2-base keiichi-mipv6-base matt-armv6-nbase matt-armv6-prevmlocking wrstuden-fixsa-base-1 netbsd-4-0-RELEASE cube-autoconf-base mjf-devfs-base netbsd-4-0-RC5 netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 matt-armv6-base matt-mips64-base hpcarm-cleanup-base wrstuden-fixsa-base netbsd-4-base
# 1.3 24-Nov-2006 christos

branches: 1.3.28;
fix spelling of accommodate; from Zapher.


# 1.2 17-Oct-2006 wiz

Serial comma. Add RCS Id. Remove superfluous quotes.


# 1.1 15-Oct-2006 christos

branches: 1.1.1;
Initial revision