\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-2014 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-2011 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{http://www.gnu.org/software/parted}.  The
library and frontend themselves can be downloaded from
@uref{ftp://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 print unit s print unit chs print}
@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 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{ftp://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{ftp://ftp.gnu.org/gnu/gettext}

@item libreiserfs, if you want reiserfs support:

	@uref{http://reiserfs.osdn.org.ua}

Note that parted will automatically detect libreiserfs at runtime, and enable
reiserfs support.  libreiserfs is new, and hasn't been widely tested yet.

@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 2.  This should have been included with the Parted distribution,
in the COPYING file.  If not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.

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-dynamic-loading
disables dynamic loading of some libraries (only libreiserfs for now,
although we hope to expand this).  Dynamic loading is useful because it
allows you to reuse libparted shared libraries even when you don't know
if some libraries will be available.  It has a small overhead (mainly
linking with libdl), so it may be useful to disable it on bootdisks if
you don't need the flexibility.

@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{http://gparted.sourceforge.net/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

Unfortunately, partitioning your disk is rather complicated.  This is
because there are interactions between many different systems that need
to be taken into consideration.

This manual used to introduce the reader to these systems and their
working.  This content has moved to the GNU Storage Guide.

@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 -s
@itemx --script
never prompt the user

@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::
* help::
* mklabel::
* mkpart::
* name::
* print::
* quit::
* rescue::
* resizepart::
* rm::
* select::
* set::
* 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 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 bsd
@item loop (raw disk access)
@item gpt
@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{fs-type} @var{name}] @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 ext2
@item fat16, fat32
@item hfs, hfs+, hfsx
@item linux-swap
@item NTFS
@item reiserfs
@item ufs
@item btrfs
@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://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.

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{number}]

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

Example:

@example
@group
(parted) @kbd{print}
Disk geometry for /dev/hda: 0.000-2445.679 megabytes
Disk label type: msdos
Minor    Start       End     Type      Filesystem  Flags
1          0.031    945.000  primary   fat32       boot, lba
2        945.000   2358.562  primary   ext2
3       2358.562   2445.187  primary   linux-swap
(parted) @kbd{print 1}
Minor: 1
Flags: boot, lba
File System: fat32
Size:            945.000Mb (0%)
Minimum size:     84.361Mb (0%)
Maximum size:   2445.679Mb (100%)
@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
accidently deleted a partition with parted's rm command, for example.

Example:

@example
(parted) @kbd{print}
@group
Disk geometry for /dev/hdc: 0.000-8063.507 megabytes
Disk label type: msdos
Minor    Start       End     Type      Filesystem  Flags
1          0.031   8056.032  primary   ext3
@end group
(parted) @kbd{rm}
Partition number? 1
(parted) @kbd{print}
@group
Disk geometry for /dev/hdc: 0.000-8063.507 megabytes
Disk label type: msdos
Minor    Start       End     Type      Filesystem  Flags
@end group
@end example

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

@example
(parted) @kbd{rescue}
Start? 0
End? 8056
Information: A ext3 primary partition was found at 0.031MB ->
8056.030MB.  Do you want to add it to the partition table?
Yes/No/Cancel? @kbd{y}
(parted) @kbd{print}
@group
Disk geometry for /dev/hdc: 0.000-8063.507 megabytes
Disk label type: msdos
Minor    Start       End     Type      Filesystem  Flags
1          0.031   8056.032  primary   ext3
@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 accidently delete
a partition with this command, use mkpart 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 or
LVM logical volume.

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 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
(GPT) - This flag identifies a "Microsoft Reserved" partition, which is
used by Windows on GPT disks.  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 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 swap
(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 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{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
