parted: Running Parted
1
1 2.2 Using GNU Parted
1 ====================
1
1 Parted has two modes: command line and interactive. Parted should
1 always be started with:
1
1 # parted DEVICE
1
1 where DEVICE is the hard disk device to edit. (If you're lazy and omit
1 the DEVICE argument, Parted will attempt to guess which device you
1 want.)
1
1 In command line mode, this is followed by one or more commands. For
1 example:
1
1 # parted /dev/sda mklabel gpt mkpart P1 ext3 1MiB 8MiB
1
1 Options (like '--help') can only be specified on the command line.
1
1 In interactive mode, commands are entered one at a time at a prompt,
1 and modify the disk immediately. For example:
1
1 (parted) mklabel gpt
1 (parted) mkpart P1 ext3 1MiB 8MiB
1
1 Unambiguous abbreviations are allowed. For example, you can type "p"
1 instead of "print", and "u" instead of "units". Commands can be typed
1 either in English, or your native language (if your language has been
1 translated). This may create ambiguities. Commands are
1 case-insensitive.
1
1 Numbers indicating partition locations can be whole numbers or
1 decimals. The suffix selects the unit, which may be one of those
1 described in ⇒unit, except CHS and compact. If no suffix is
1 given, then the default unit is assumed. Negative numbers count back
1 from the end of the disk, with "-1s" indicating the sector at the end of
1 the disk. Parted will compute sensible ranges for the locations you
1 specify (e.g. a range of +/- 500 MB when you specify the location in
1 "G"). Use the sector unit "s" to specify exact locations. With
1 parted-2.4 and newer, IEC binary units like "MiB", "GiB", "TiB", etc.,
1 specify exact locations as well. ⇒IEC binary units.
1
1 If you don't give a parameter to a command, Parted will prompt you for
1 it. For example:
1
1 (parted) mklabel
1 New disk label type? gpt
1
1 Parted will always warn you before doing something that is potentially
1 dangerous, unless the command is one of those that is inherently
1 dangerous (viz., rm, mklabel and mkpart). Since many partitioning
1 systems have complicated constraints, Parted will usually do something
1 slightly different to what you asked. (For example, create a partition
1 starting at 10.352Mb, not 10.4Mb) If the calculated values differ too
1 much, Parted will ask you for confirmation.
1