parted: unit
1
1 2.4.14 unit
1 -----------
1
1 -- Command: unit UNIT
1
1 Selects the current default unit that Parted will use to display
1 locations and capacities on the disk and to interpret those given
1 by the user if they are not suffixed by an UNIT.
1
1 UNIT may be one of:
1
1 's'
1 sector (n bytes depending on the sector size, often 512)
1
1 'B'
1 byte
1
1 'KiB'
1 kibibyte (1024 bytes)
1
1 'MiB'
1 mebibyte (1048576 bytes)
1
1 'GiB'
1 gibibyte (1073741824 bytes)
1
1 'TiB'
1 tebibyte (1099511627776 bytes)
1
1 'kB'
1 kilobyte (1000 bytes)
1
1 'MB'
1 megabyte (1000000 bytes)
1
1 'GB'
1 gigabyte (1000000000 bytes)
1
1 'TB'
1 terabyte (1000000000000 bytes)
1
1 '%'
1 percentage of the device (between 0 and 100)
1
1 'cyl'
1 cylinders (related to the BIOS CHS geometry)
1
1 'chs'
1 cylinders, heads, sectors addressing (related to the BIOS CHS
1 geometry)
1
1 'compact'
1 This is a special unit that defaults to megabytes for input,
1 and picks a unit that gives a compact human readable
1 representation for output.
1
1 The default unit apply only for the output and when no unit is
1 specified after an input number. Input numbers can be followed by
1 an unit (without any space or other character between them), in
1 which case this unit apply instead of the default unit for this
1 particular number, but CHS and cylinder units are not supported as
1 a suffix. If no suffix is given, then the default unit is assumed.
1 Parted will compute sensible ranges for the locations you specify
1 (e.g., a range of +/- 500 MB when you specify the location in "G",
1 and a range of +/- 500 KB when you specify the location in "M") and
1 will select the nearest location in this range from the one you
1 wrote that satisfies constraints from both the operation, the
1 filesystem being worked on, the disk label, other partitions and so
1 on. Use the sector unit "s" to specify exact locations (if they do
1 not satisfy all constraints, Parted will ask you for the nearest
1 solution). Note that negative numbers count back from the end of
1 the disk, with "-1s" pointing to the last sector of the disk.
1
1 Note that as of parted-2.4, when you specify start and/or end
1 values using IEC binary units like "MiB", "GiB", "TiB", etc.,
1 parted treats those values as exact, and equivalent to the same
1 number specified in bytes (i.e., with the "B" suffix), in that it
1 provides _no_ "helpful" range of sloppiness. Contrast that with a
1 partition start request of "4GB", which may actually resolve to
1 some sector up to 500MB before or after that point. Thus, when
1 creating a partition, you should prefer to specify units of bytes
1 ("B"), sectors ("s"), or IEC binary units like "MiB", but not "MB",
1 "GB", etc.
1
1 Example:
1
1 (parted) unit compact
1 (parted) print
1 Disk geometry for /dev/hda: 0kB - 123GB
1 Disk label type: msdos
1 Number Start End Size Type File system Flags
1 1 32kB 1078MB 1077MB primary reiserfs boot
1 2 1078MB 2155MB 1078MB primary linux-swap
1 3 2155MB 123GB 121GB extended
1 5 2155MB 7452MB 5297MB logical reiserfs
1 (parted) unit chs print
1 Disk geometry for /dev/hda: 0,0,0 - 14946,225,62
1 BIOS cylinder,head,sector geometry: 14946,255,63. Each cylinder
1 is 8225kB.
1 Disk label type: msdos
1 Number Start End Type File system Flags
1 1 0,1,0 130,254,62 primary reiserfs boot
1 2 131,0,0 261,254,62 primary linux-swap
1 3 262,0,0 14945,254,62 extended
1 5 262,2,0 905,254,62 logical reiserfs
1 (parted) unit mb print
1 Disk geometry for /dev/hda: 0MB - 122942MB
1 Disk label type: msdos
1 Number Start End Size Type File system Flags
1 1 0MB 1078MB 1077MB primary reiserfs boot
1 2 1078MB 2155MB 1078MB primary linux-swap
1 3 2155MB 122935MB 120780MB extended
1 5 2155MB 7452MB 5297MB logical reiserfs
1