\input texinfo    @c -*-texinfo-*-
@c %**start of header
@setfilename parted.info
@settitle Parted User's Manual
@include version.texi
@paragraphindent 2
@c %**end of header

@ifinfo
This file documents the use of GNU Parted, a program for creating
and manipulating partition tables.
@end ifinfo

@ifnottex @c texi2pdf don't understand copying and insertcopying ???
@c modifications must also be done in the titlepage
@copying
Copyright @copyright{} 1999--2023 Free Software Foundation, Inc.

Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with no
Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
Texts.  A copy of the license is included in the section entitled ``GNU
Free Documentation License''.
@end copying
@c WTF does the info get the copying output and the plaintext output not ????
@ifplaintext
@insertcopying
@end ifplaintext
@end ifnottex

@dircategory System administration
@direntry
* parted: (parted).                         GNU partitioning software
@end direntry

@titlepage
@title GNU Parted User Manual
@subtitle GNU Parted, version @value{VERSION}, @value{UPDATED}
@author Andrew Clausen @email{clausen@@gnu.org}
@author Richard M. Kreuter @email{kreuter@@anduril.rutgers.edu}
@author Leslie Patrick Polzer @email{polzer@@gnu.org}


@c @page
@c @vskip 0pt plus 1filll

@c modifications must also be done in the copying block
Copyright @copyright{} 1999--2023 Free Software Foundation, Inc.

Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with no
Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
Texts.  A copy of the license is included in the section entitled ``GNU
Free Documentation License''.
@end titlepage

@ifnottex
@node Top
@top GNU Parted User Manual

@c WTF doesn't texi2html include the titlepage?
@ifhtml
@insertcopying
@end ifhtml

This file documents the use of GNU Parted, a program for creating
and manipulating partition tables.

This document applies roughly to version @strong{@value{VERSION}} of GNU Parted.

The original version was written by Andrew Clausen in text format.
Richard M. Kreuter translated it into Texinfo format in 2002, to be heavily
edited by Leslie P. Polzer in 2006.
@end ifnottex

@shortcontents

@menu
* Introduction::                Overview
* Using Parted::                Partitioning a Hard Drive
* Related information::         Further reading on related topics
* Copying This Manual::         How to make copies of this manual
* History::                     This manual's history
* Concept index::               Concept index
@end menu

@node    Introduction
@chapter Introduction

@menu
* Overview::                    GNU Parted and prerequisite knowledge
* Software Required::           GNU Parted's software dependencies
* Supported Platforms::         Where you can use GNU Parted
* License::                     What you may and may not do with GNU Parted
* Compiling::                   How to build GNU Parted
@end menu

@node Overview
@section Overview of GNU Parted
@cindex description of parted
@cindex overview
@cindex parted description
@cindex bugs, reporting
@cindex reporting bugs
@cindex contacting developers

GNU Parted is a program for creating and manipulating partition tables.

This documentation is written with the assumption that the reader
has some understanding of partitioning and file systems.

GNU Parted was designed to minimize the chance of data loss.  For
example, it was designed to avoid data loss during interruptions (like
power failure) and performs many safety checks.  However, there could
be bugs in GNU Parted, so you should back up your important files before
running Parted.

The GNU Parted homepage is @uref{https://www.gnu.org/software/parted}.  The
library and frontend themselves can be downloaded from
@uref{https://ftp.gnu.org/gnu/parted}.
You can also find a listing of mailing lists, notes for contributing and
more useful information on the web site.

Please send bug reports to @email{bug-parted@@gnu.org}.  When sending bug
reports, please include the version of GNU Parted.
Please include the output from these commands (for disk @file{/dev/hda}):

@example
@group
# @kbd{parted /dev/hda unit s print free}
@end group
@end example

Feel free to ask for help on this list --- just check that your question
isn't answered here first.  If you don't understand the documentation,
please tell us, so we can explain it better.  General philosophy is:
if you need to ask for help, then something needs to be fixed so you
(and others) don't need to ask for help.

Also, we'd love to hear your ideas :-)

@node Software Required
@section Software Required for the use of Parted
@cindex software dependencies
@cindex required software
@cindex libuuid
@cindex e2fsprogs
@cindex readline
@cindex gettext

If you're installing or compiling Parted yourself, you'll need to
have some other programs installed.  If you are compiling Parted,
you will need both the normal and devel packages of these programs
installed:

@itemize @bullet

@item GNU parted source is available either as a source tarball:

	@uref{https://git.savannah.gnu.org/gitweb/?p=parted.git}

or using git (See the README-hacking instructions):

	@uref{https://git.savannah.gnu.org/gitweb/?p=parted.git}

@item libuuid, part of the e2fsprogs package.  If you don't have this,
you can get it from:

	@uref{http://web.mit.edu/tytso/www/linux/e2fsprogs.html}

If you want to compile Parted and e2fsprogs, note that you will need to
@kbd{make install} and @kbd{make install-libs} e2fsprogs.

@item GNU Readline (optional), available from

	@uref{https://ftp.gnu.org/gnu/readline}

If you are compiling Parted, and you don't have readline, you can
disable Parted's readline support with the @kbd{--disable-readline}
option for @command{configure}.

@item GNU gettext (or compatible software) for compilation, if
internationalisation support is desired.

	@uref{https://ftp.gnu.org/gnu/gettext}

@end itemize

@node Supported Platforms
@section Platforms on which GNU Parted runs
@cindex supported platforms
@cindex platforms, supported

Hopefully, this list will grow a lot.  If you do not have one of these
platforms, then you can use a rescue disk and a static binary of GNU Parted.

@table @asis
@item GNU/Linux
Linux versions 2.0 and up, on Alpha, x86 PCs, PC98, Macintosh PowerPC, Sun hardware.

@item GNU/Hurd
@end table

@node License
@section Terms of distribution for GNU Parted
@cindex license terms
@cindex terms of distribution
@cindex gnu gpl
@cindex gpl

GNU Parted is free software, covered by the GNU General Public License
Version 3, or (at your option) any later version.  This should have been
included with the Parted distribution, in the COPYING file.  If not,
see <http://www.gnu.org/licenses/>.

Libparted is considered part of GNU Parted.  It is covered by the GNU
General Public License.  It is NOT released under the GNU Lesser General
Public License (LGPL).

@node Compiling
@section Building GNU Parted
@cindex compiling parted
@cindex building parted

If you want to compile GNU Parted, this is generally done with:

@example
@group
$ @kbd{./configure}
$ @kbd{make}
@end group
@end example

However, there are a few options for @command{configure}:

@table @code
@item --without-readline
turns off use of readline.  This is useful for making rescue disks,
etc., where few libraries are available.

@item --disable-debug
don't include assertions

@item --disable-nls
turns off native language support.  This is useful for use with old
versions of glibc, or a trimmed down version of glibc suitable for
rescue disks.

@item --disable-shared
turns off shared libraries.  This may be necessary for use with old
versions of GNU libc, if you get a compile error about a ``spilled
register''.  Also useful for boot/rescue disks.

@item --enable-discover-only
support only reading/probing (reduces size considerably)

@item --enable-mtrace
enable malloc() debugging

@item --enable-read-only
disable writing (for debugging)

@end table

@subsection Introduction
If you want to run GNU Parted on a machine without GNU/Linux installed,
or you want to modify a root or boot partition, use GParted Live:
@uref{https://gparted.org/livecd.php}.

@node    Using Parted
@chapter Using Parted
@cindex commands

@menu
* Partitioning::                    Disk partitioning in context
* Running Parted::                  Partitioning with Parted
* Invoking Parted::                 Parted's invocation options and commands
* Command explanations::            Full explanation of parted's commands
@end menu

@node Partitioning
@section Introduction to Partitioning
@cindex partitioning overview

Partitioning is the process of dividing a storage device into local
sections, called partitions, which help organize multiple filesystems
and their associated operating systems.

A storage device presents itself as a sequence of bytes, numbered
starting from zero and increasing until the maximum capacity of the
device is reached. Bytes are normally read and written a sector at a
time, rather than individually. Each sector contains a fixed number
of bytes, with the number determined by the device.

@example
+------------------------------------------------------------+
|            storage device with no partitions               |
+------------------------------------------------------------+
0 start                                                    end
@end example

In order to store multiple filesystems, a storage device can be divided
up in to multiple partitions. Each partition can be thought of as an
area which contains a real filesystem inside of it. To show where these
partitions are on the device a small table is written at the start,
shown as PT in the diagram below. This table is called a partition
table, or disklabel, and also stores the type of each partition and
some flags.

@example
+--+---------------+----------------+------------------------+
|PT|  Partition 1  |  Partition 2   |  Partition 3           |
+--+---------------+----------------+------------------------+
0 start                                                    end
@end example


@node Running Parted
@section Using GNU Parted
@cindex modes of use

Parted has two modes: command line and interactive.  Parted should
always be started with:

@example
# @kbd{parted @var{device}}
@end example

@noindent where @var{device} is the hard disk device to edit.  (If you're
lazy and omit the DEVICE argument, Parted will attempt to guess which
device you want.)

In command line mode, this is followed by one or more commands.  For
example:

@example
# @kbd{parted /dev/sda mklabel gpt mkpart P1 ext3 1MiB 8MiB }
@end example

@noindent Options (like @kbd{--help}) can only be specified on the
command line.

In interactive mode, commands are entered one at a time at a prompt, and
modify the disk immediately.  For example:

@example
(parted) @kbd{mklabel gpt}
(parted) @kbd{mkpart P1 ext3 1MiB 8MiB }
@end example

@noindent Unambiguous abbreviations are allowed.  For example, you can
type ``p'' instead of ``print'', and ``u'' instead of ``units''.
Commands can be typed either in English, or your native language (if
your language has been translated).  This may create ambiguities.
Commands are case-insensitive.

Numbers indicating partition locations can be whole numbers or decimals.
The suffix selects the unit, which may be one of those described in
@ref{unit}, except CHS and compact.  If no suffix is given, then the default
unit is assumed.  Negative numbers count back from the end of the disk,
with ``-1s'' indicating the sector at the end of the disk.
Parted will compute sensible
ranges for the locations you specify (e.g. a range of +/- 500 MB when you
specify the location in ``G''). Use the sector unit ``s'' to specify exact
locations.  With parted-2.4 and newer,
IEC binary units like ``MiB'', ``GiB'', ``TiB'', etc., specify
exact locations as well.
@xref{IEC binary units}.

If you don't give a parameter to a command, Parted will prompt you for it.
For example:

@example
(parted) @kbd{mklabel}
New disk label type? @kbd{gpt}
@end example

Parted will always warn you before doing something that is potentially
dangerous, unless the command is one of those that is inherently
dangerous (viz., rm, mklabel and mkpart).
Since many partitioning systems have complicated constraints, Parted will
usually do something slightly different to what you asked.  (For example,
create a partition starting at 10.352Mb, not 10.4Mb)
If the calculated values differ too much, Parted will ask you for
confirmation.


@node Invoking Parted
@section Command Line Options
@cindex options at invocation
@cindex commands, overview
@cindex invocation options

When invoked from the command line, Parted supports the following syntax:

@example
# @kbd{parted [@var{option}] @var{device} [@var{command} [@var{argument}]]}
@end example

Available options and commands follow.  For detailed explanations of the
use of Parted commands, see @ref{Command explanations}. Options begin
with a hyphen, commands do not:

Options:

@table @samp
@item -h
@itemx --help
display a help message

@item -l
@itemx --list
lists partition layout on all block devices

@item -m
@itemx --machine
display output in machine parseable format

@item -j
@itemx --json
display output in JSON format

@item -s
@itemx --script
never prompt the user

@item -f
@itemx --fix
automatically answer exceptions with "fix" in script mode, which is useful for:
GPT header not including full disk size; moving the backup GPT table to the end of the disk;
MAC fix missing partition map entry; etc.

@item -a alignment-type
@itemx --align alignment-type
Set alignment for newly created partitions, valid alignment types are:
none, cylinder, minimal and optimal.

@item -v
@itemx --version
display the version
@end table

@node Command explanations
@section Parted Session Commands
@cindex command syntax
@cindex detailed command listing
@cindex commands, detailed listing

GNU Parted provides the following commands:

@menu
* align-check::
* disk_set::
* disk_toggle::
* help::
* mklabel::
* mkpart::
* name::
* print::
* quit::
* rescue::
* resizepart::
* rm::
* select::
* set::
* toggle::
* type::
* unit::
@end menu

Note that after version 2.4, the following commands were removed:
check, cp, mkfs, mkpartfs, move, resize.

@node align-check
@subsection align-check
@cindex align-check, command description
@cindex command description, align-check

@deffn Command align-check @var{align-type} @var{n}

Determine whether the starting sector of partition @var{n}
meets the disk's selected alignment criteria.
@var{align-type} must be @samp{minimal}, @samp{optimal}
or an abbreviation.
When in script mode, if the partition does not meet the alignment
requirement, exit with status 1;  otherwise (including on older
kernels for which alignment data is not available), continue processing
any remaining commands.
Without @option{--script}, print either @samp{@var{N} aligned}
or @samp{@var{N} not aligned}.

Example:

@example
(parted) @kbd{align-check minimal 1}
1 aligned
@end example

@end deffn

@node disk_set
@subsection disk_set
@cindex disk_set, command description
@cindex command description, disk_set

@deffn Command disk_set @var{flag} @var{state}

Changes a flag on the disk.  A flag can be either ``on'' or ``off''.
Some or all of these flags will be available, depending on what disk
label you are using:

@table @samp

@item pmbr_boot
(GPT) - this flag enables the boot flag on the GPT's protective MBR
partition.

@end table

The disk's flags are displayed by the print command on the "Disk Flags:"
line.  They are also output as the last field of the disk information
in machine mode.

@example
(parted) @kbd{disk_set pmbr_boot on}
@end example

Set the PMBR's boot flag.
@end deffn

@node disk_toggle
@subsection disk_toggle
@cindex disk_toggle, command description
@cindex command description, disk_toggle

@deffn Command disk_toggle @var{flag}

Toggle the state of the disk flag.
@end deffn

@node help
@subsection help
@cindex help, command description
@cindex command description, help

@deffn Command help [@var{command}]

Prints general help, or help on @var{command}.

Example:

@example
(parted) @kbd{help mklabel}
@end example

Print help for the mklabel command.
@end deffn

@node mklabel
@subsection mklabel
@cindex mklabel, command description
@cindex command description, mkindex

@deffn Command mklabel @var{label-type}

Creates a new disk label, of type @var{label-type}.  The new disk label
will have no partitions.  This command (normally) won't technically
destroy your data, but it will make it basically unusable,
and you will need to use the rescue command (@pxref{Related information})
to recover any partitions.
Parted works on all partition tables.  @footnote{Everyone seems to
have a different word for ``disk label'' --- these are all the same
thing: partition table, partition map.}

@var{label-type} must be one of these supported disk labels:
@itemize @bullet
@item aix
@item amiga
@item bsd
@item dvh
@item gpt
@item loop (raw disk access)
@item mac
@item msdos
@item pc98
@item sun
@end itemize

Example:

@example
(parted) @kbd{mklabel msdos}
@end example

Create an MS-DOS disk label.  This is still the most common disk label for
PCs.
@end deffn

@node mkpart
@subsection mkpart
@cindex mkpart, command description
@cindex command description, mkpart

@deffn Command mkpart [@var{part-type} @var{name} @var{fs-type}] @var{start} @var{end}

Creates a new partition, @emph{without} creating a new file system on
that partition.  This is useful for creating partitions for file systems
(or LVM, etc.) that Parted doesn't support.  You may specify a file
system type, to set the appropriate partition code in the partition
table for the new partition.  @var{fs-type} is required for data
partitions (i.e., non-extended partitions).  @var{start} and @var{end}
are the offset from the beginning of the disk, that is, the ``distance''
from the start of the disk.

@var{part-type} is one of @samp{primary}, @samp{extended} or @samp{logical},
and may be specified only with @samp{msdos} or @samp{dvh} partition tables.
A @var{name} must be specified for a @samp{gpt} partition table.
Neither @var{part-type} nor @var{name} may be used with a @samp{sun}
partition table.

@var{fs-type} must be one of these supported file systems:
@itemize @bullet
@item btrfs
@item ext2, ext3, ext4
@item fat16, fat32
@item hfs, hfs+, hfsx
@item hp-ufs
@item jfs
@item linux-swap, linux-swap(new,old,v0,v1)
@item nilfs2
@item ntfs
@item reiserfs
@item sun-ufs
@item ufs
@item xfs
@end itemize

For example, the following creates a logical partition that will contain
an ext2 file system.  The partition will start at the beginning of the disk,
and end 692.1 megabytes into the disk.

@example
(parted) @kbd{mkpart logical 0.0 692.1}
@end example

Now, we will show how to partition a low-end flash
device (``low-end'', as of 2011/2012).
For such devices, you should use 4MiB-aligned partitions@footnote{
Cheap flash drives will be with us for a long time to
come, and, for them, 1MiB alignment is not enough.
Use at least 4MiB-aligned partitions.
For details, see Arnd Bergman's article,
@uref{http://lwn.net/Articles/428584/} and its many comments.}.
This command creates a tiny place-holder partition at the beginning, and
then uses all remaining space to create the partition you'll actually use:

@example
$ @kbd{parted -s /dev/sdX -- mklabel msdos \}
@kbd{    mkpart primary fat32 64s 4MiB \}
@kbd{    mkpart primary fat32 4MiB -1s}
@end example

Note the use of @samp{--}, to prevent the following @samp{-1s} last-sector
indicator from being interpreted as an invalid command-line option.
The above creates two empty partitions.  The first is unaligned and tiny,
with length less than 4MiB.
The second partition starts precisely at the 4MiB mark
and extends to the end of the device.

The next step is typically to create a file system in the second partition:

@example
$ @kbd{mkfs.vfat /dev/sdX2}
@end example


@end deffn

@node name
@subsection name
@cindex name, command description
@cindex command description, name

@deffn Command name @var{number} @var{name}

Sets the name for the partition @var{number} (GPT, Mac, MIPS and PC98 only).
The name can be placed in quotes. And depending on the shell may need to also
be wrapped in single quotes so that the shell doesn't strip off the double
quotes.

Example:

@example
(parted) @kbd{name 2 'Secret Documents'}
@end example

Set the name of partition 2 to `Secret Documents'.
@end deffn

@node print
@subsection print
@cindex print, command description
@cindex command description, print

@deffn Command print [@var{print-type}]

Displays the partition table on the device parted is editing, or
detailed information about a particular partition.

@var{print-type} is optional, and can be one of @samp{devices},
@samp{free}, @samp{list}, or @samp{all}.

@table @code

@item devices
display all active block devices

@item free
display information about free unpartitioned space on the current block device

@item list, all
display the partition tables of all active block devices

@end table

Example:

@example
@group
(parted) @kbd{print}
Model: ATA Samsung SSD 850 (scsi)
Disk /dev/sda: 2684MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number  Start   End     Size    Type     File system     Flags
 1      1049kB  1000MB  999MB   primary                  boot, lba
 2      1000MB  2300MB  1299MB  primary  ext2            lba
 3      2300MB  2500MB  200MB   primary  linux-swap(v1)  lba
(parted) @kbd{print free}
Model: ATA Samsung SSD 850 (scsi)
Disk /dev/sda: 2684MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number  Start   End     Size    Type     File system     Flags
        16.4kB  1049kB  1032kB           Free Space
 1      1049kB  1000MB  999MB   primary                  boot, lba
 2      1000MB  2300MB  1299MB  primary  ext2            lba
 3      2300MB  2500MB  200MB   primary  linux-swap(v1)  lba
        2500MB  2684MB  185MB            Free Space

@end group
@end example
@end deffn

@node quit
@subsection quit
@cindex quit, command description
@cindex command description, quit

@deffn Command quit

Quits Parted.

@c RMK: generality: the following will apply to any operating system on
@c which parted will run, not only Linux-based ones.
@c clausen: yeah... just that the way hurd and linux work are totally
@c different, and it's actually very hard to speak in general.  Need to
@c discuss this more
It is only after Parted exits that the Linux kernel knows about the changes
Parted has made to the disks.  However, the changes caused by typing your
commands will @emph{probably} be made to the disk immediately after typing a
command.  However, the operating system's cache and the disk's hardware cache
may delay this.
@end deffn

@node rescue
@subsection rescue
@cindex rescue, command description
@cindex command description, rescue

@deffn Command rescue @var{start} @var{end}
Rescue a lost partition that used to be located approximately between
@var{start} and @var{end}.  If such a partition is found, Parted will
ask you if you want to create a partition for it.  This is useful if you
accidentally deleted a partition with parted's rm command, for example.

Example:

@example
(parted) @kbd{print}
@group
Model: ATA Samsung SSD 850 (scsi)
Disk /dev/sda: 2684MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number  Start   End     Size    Type     File system     Flags
 1      1049kB  1000MB  999MB   primary                  boot, lba
 2      1000MB  2300MB  1299MB  primary  ext4            lba
@end group
(parted) @kbd{rm}
Partition number? 2
(parted) @kbd{print}
@group
Model: ATA Samsung SSD 850 (scsi)
Disk /dev/sda: 2684MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number  Start   End     Size    Type     File system     Flags
 1      1049kB  1000MB  999MB   primary                  boot, lba
@end group
@end example

OUCH!  We deleted our ext4 partition!!!  Parted comes to the rescue...

@example
(parted) @kbd{rescue}
Start? 1000
End? 2684
Information: A ext4 primary partition was found at 1000MB ->
2300MB.  Do you want to add it to the partition table?
Yes/No/Cancel? @kbd{y}
(parted) @kbd{print}
@group
Model: ATA Samsung SSD 850 (scsi)
Disk /dev/sda: 2684MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number  Start   End     Size    Type     File system     Flags
 1      1049kB  1000MB  999MB   primary                  boot, lba
 2      1000MB  2300MB  1299MB  primary  ext4            lba
@end group
@end example

It's back!  :)

@end deffn

@node resizepart
@subsection resizepart
@cindex resizepart, command description
@cindex command description, resizepart

@deffn Command resizepart @var{number} @var{end}

Moves the @var{end} position of partition @var{number}.  Note that this
does not modify any filesystem present in the partition.  If you wish to
do this, you will need to use external tools, such as @command{resize2fs}.

When growing a partition you will want to grow the filesystem afterwards,
but when shrinking, you need to shrink the filesystem before the partition.
@end deffn

@node rm
@subsection rm
@cindex rm, command description
@cindex command description, rm


@deffn Command rm @var{number}

Removes the partition with number @var{number}.  If you accidentally delete
a partition with this command, use @pxref{rescue} to
recover it.  Also, you can use the gpart program (@pxref{Related information})
to recover damaged disk labels.

Note for msdos disk labels: if you delete a logical partition, all
logical partitions with a larger partition number will be renumbered.  For
example, if you delete a logical partition with a partition number of 6,
then logical partitions that were number 7, 8 and 9 would be renumbered
to 6, 7 and 8 respectively.  This means, for example, that you have to
update @file{/etc/fstab} on GNU/Linux systems.

Example:

@example
(parted) @kbd{rm 3}
@end example

Remove partition 3.
@end deffn

@node select
@subsection select
@cindex select, command description
@cindex command description, select

@deffn Command select @var{device}

Selects the device, @var{device}, for Parted to edit.  The device can
be a Linux hard disk device, a partition, a software RAID device,
LVM logical volume, or disk image file.

Example:

@example
(parted) @kbd{select /dev/hdb}
@end example

Select @file{/dev/hdb} (the slave device on the first ide controller on
Linux) as the device to edit.
@end deffn

@node set
@subsection set
@cindex set, command description
@cindex command description, set

@deffn Command set @var{number} @var{flag} @var{state}

Changes a flag on the partition with number @var{number}.  A flag can be
either ``on'' or ``off''.  Some or all of these flags will be available,
depending on what disk label you are using:

@table @samp

@item bios_grub
(GPT) - Enable this to record that the selected partition is a
GRUB BIOS partition.

@item legacy_boot
(GPT) - this flag is used to tell special purpose software that the GPT
partition may be bootable.

@item bls_boot
(MS-DOS, GPT) - Enable this to indicate that the selected partition is a
Linux Boot Loader Specification compatible /boot partition.

@item boot
(Mac, MS-DOS, PC98) - should be enabled if you want to boot off the
partition.  The semantics vary between disk labels.  For MS-DOS disk
labels, only one partition can be bootable.  If you are installing LILO
on a partition that partition must be bootable.
For PC98 disk labels, all ext2 partitions must be bootable (this is
enforced by Parted).

@item msftdata
(GPT) - This flag identifies partitions that contain Microsoft filesystems
(NTFS or FAT).  It may optionally be set on Linux filesystems to mimic the
type of configuration created by parted 3.0 and earlier, in which a
separate Linux filesystem type code was not available on GPT disks.  This
flag can only be removed within parted by replacing it with a competing
flag, such as boot or msftres.

@item msftres
(MS-DOS,GPT) - This flag identifies a "Microsoft Reserved" partition, which
is used by Windows.  Note that this flag should not normally be
set on Windows filesystem partitions (those that contain NTFS or FAT
filesystems).

@item irst
(MS-DOS, GPT) - this flag identifies an Intel Rapid Start Technology
partition.

@item esp
(MS-DOS, GPT) - this flag identifies a UEFI System Partition. On GPT
it is an alias for boot.

@item chromeos_kernel
(GPT) - this flag indicates a partition that can be used with the Chrome OS
bootloader and verified boot implementation.

@item lba
(MS-DOS) - this flag can be enabled to tell MS DOS, MS Windows 9x and
MS Windows ME based operating systems to use Linear (LBA) mode.

@item root
(Mac) - this flag should be enabled if the partition is the root device
to be used by Linux.

@item linux-home
(GPT) - Enable this to indicate that the selected partition is a
Linux /home partition.

@item swap
(MS-DOS, GPT, Mac) - this flag should be enabled if the partition is the
swap device to be used by Linux.

@item hidden
(MS-DOS, PC98) - this flag can be enabled to hide partitions from
Microsoft operating systems.

@item raid
(MS-DOS) - this flag can be enabled to tell linux the partition is a
software RAID partition.

@item LVM
(MS-DOS) - this flag can be enabled to tell linux the partition is a
physical volume.

@item PALO
(MS-DOS) - this flag can be enabled so that the partition can be used
by the Linux/PA-RISC boot loader, palo.

@item PREP
(MS-DOS, GPT) - this flag can be enabled so that the partition can be used
as a PReP boot partition on PowerPC PReP or IBM RS6K/CHRP hardware.

@item DIAG
(MS-DOS) - Enable this to indicate that a partition can be used
as a diagnostics / recovery partition.

@end table

The print command displays all enabled flags for each partition.

Example:

@example
(parted) @kbd{set 1 boot on}
@end example

Set the @samp{boot} flag on partition 1.
@end deffn

@node toggle
@subsection toggle
@cindex toggle, command description
@cindex command description, toggle

@deffn Command toggle @var{number} @var{flag}

Toggle the state of @var{flag} on partition @var{number}.

@end deffn

@node type
@subsection type
@cindex type, command description
@cindex command description, type

@deffn Command type @var{number} @var{id} or @var{uuid}

On MS-DOS set the type-id aka partition id to @var{id} on partition
@var{number}. The id is a value between 0x01 and 0xff, e.g. the ID for
Linux is 0x83. A list with some IDs is available at
@uref{https://en.wikipedia.org/wiki/Partition_type}.

On GPT set the type-uuid to @var{uuid} on partition
@var{number}. E.g. the UUID for Linux is
0fc63daf-8483-4772-8e79-3d69d8477de4. A list with some UUIDs is availabe
at @uref{https://en.wikipedia.org/wiki/GUID_Partition_Table}.

@end deffn

@node unit
@subsection unit
@cindex unit, command description
@cindex command description, unit

@deffn Command unit @var{unit}

Selects the current default unit that Parted will use to display
locations and capacities on the disk and to interpret those given
by the user if they are not suffixed by an @var{unit}.

@var{unit} may be one of:

@table @samp
@item s
sector (n bytes depending on the sector size, often 512)

@item B
byte

@item KiB
kibibyte (1024 bytes)

@item MiB
mebibyte (1048576 bytes)

@item GiB
gibibyte (1073741824 bytes)

@item TiB
tebibyte (1099511627776 bytes)

@item kB
kilobyte (1000 bytes)

@item MB
megabyte (1000000 bytes)

@item GB
gigabyte (1000000000 bytes)

@item TB
terabyte (1000000000000 bytes)

@item %
percentage of the device (between 0 and 100)

@item cyl
cylinders (related to the BIOS CHS geometry)

@item chs
cylinders, heads, sectors addressing (related to the BIOS CHS geometry)

@item compact
This is a special unit that defaults to megabytes for input, and picks a
unit that gives a compact human readable representation for output.
@end table

The default unit apply only for the output and when no unit is
specified after an input number.  Input numbers can be followed by
an unit (without any space or other character between them), in
which case this unit apply instead of the default unit for this
particular number, but CHS and cylinder units are not supported as
a suffix.  If no suffix is given, then the default unit is assumed.
Parted will compute sensible ranges for the locations you specify
(e.g., a range of +/- 500 MB when you specify the location in ``G'',
and a range of +/- 500 KB when you specify the location in ``M'')
and will select the nearest location in this range from the one you
wrote that satisfies constraints from both the operation, the
filesystem being worked on, the disk label, other partitions and so
on.  Use the sector unit ``s'' to specify exact locations (if they
do not satisfy all constraints, Parted will ask you for the nearest
solution).  Note that negative numbers count back from the end of
the disk, with ``-1s'' pointing to the last sector of the disk.

@anchor{IEC binary units}
Note that as of parted-2.4, when you specify start and/or end values
using IEC binary units like ``MiB'', ``GiB'', ``TiB'', etc., parted
treats those values as exact, and equivalent to the same number
specified in bytes (i.e., with the ``B'' suffix), in that it provides
@emph{no} ``helpful'' range of sloppiness.  Contrast that with
a partition start request of ``4GB'', which may actually resolve to
some sector up to 500MB before or after that point.
Thus, when creating a partition, you should prefer to specify
units of bytes (``B''), sectors (``s''), or IEC binary units like ``MiB'',
but not ``MB'', ``GB'', etc.

Example:

@example
@group
(parted) unit compact
(parted) print
Disk geometry for /dev/hda: 0kB - 123GB
Disk label type: msdos
Number  Start   End     Size    Type      File system  Flags
1       32kB    1078MB  1077MB  primary   reiserfs     boot
2       1078MB  2155MB  1078MB  primary   linux-swap
3       2155MB  123GB   121GB   extended
5       2155MB  7452MB  5297MB  logical   reiserfs
@end group
@group
(parted) unit chs print
Disk geometry for /dev/hda: 0,0,0 - 14946,225,62
BIOS cylinder,head,sector geometry: 14946,255,63.  Each cylinder
is 8225kB.
Disk label type: msdos
Number  Start       End         Type      File system  Flags
1       0,1,0       130,254,62  primary   reiserfs     boot
2       131,0,0     261,254,62  primary   linux-swap
3       262,0,0     14945,254,62 extended
5       262,2,0     905,254,62  logical   reiserfs
@end group
@group
(parted) unit mb print
Disk geometry for /dev/hda: 0MB - 122942MB
Disk label type: msdos
Number  Start   End     Size    Type      File system  Flags
1       0MB     1078MB  1077MB  primary   reiserfs     boot
2       1078MB  2155MB  1078MB  primary   linux-swap
3       2155MB  122935MB 120780MB extended
5       2155MB  7452MB  5297MB  logical   reiserfs
@end group
@end example

@end deffn

@node Related information
@chapter Related information
@cindex further reading
@cindex related documentation

If you want to find out more information, please see the GNU Parted web site.

These files in the Parted distribution contain further information:

@itemize @bullet

@item @kbd{ABOUT-NLS} - information about using Native Language Support, and the Free Translation Project.

@item @kbd{AUTHORS} - who wrote what.

@item @kbd{ChangeLog} - record of changes made to Parted.

@item @kbd{COPYING} - the GNU General Public License, the terms under which GNU Parted may be distributed.

@item @kbd{COPYING.DOC} - the GNU Free Documentation Licence, the term under
which Parted's documentation may be distributed.

@item @kbd{INSTALL} --- how to compile and install Parted, and most other free
software

@end itemize

@node Copying This Manual
@appendix Copying This Manual

@menu
* GNU Free Documentation License::  License for copying this manual
@end menu

@node GNU Free Documentation License
@appendixsec GNU Free Documentation License
@cindex FDL, GNU Free Documentation License
@include fdl.texi

@node History
@appendix This manual's history
@cindex  history of this manual

This manual was based on the file @kbd{USER} included in GNU Parted version
1.4.22 source distribution.  The GNU Parted source distribution is
available at @uref{https://ftp.gnu.org/gnu/parted}.

Initial Texinfo formatting by Richard M. Kreuter, 2002.

Maintainance by Andrew Clausen from 2002 to 2005 and by Leslie P. Polzer
from July 2005 onwards.

This manual is distributed under the GNU Free Documentation License,
version 1.1 or later, at your discretion, any later version published
by the Free Software Foundation; with no Invariant Sections, with no
Front-Cover Texts, and with no Back-Cover Texts.  @xref{Copying
This Manual}, for details.

@node Concept index
@unnumbered Index
@printindex cp

@bye

@ignore

Notes by RMK:
Notes on possible (unimplemented!) modifications:

The output samples from parted's print command, fdisk's p command, etc.,
might be made into tables (multi-column tables) to ensure spiffy formatting.

I'd like to find a way to make *entry: see *synonym type references in
the index, so, e.g., to refer people looking for Apple to Macintosh, and
PowerPC to Macintosh, etc.  Probably texinfo does this already; I dunno.

Notes by Leslie:

TODO:
     - add "version" command.
     - read through and correct.
     - role of FreeDOS?

@end ignore
