parted Flashcards
parted
parted is a program to manipulate disk partitions. It supports multiple partition table formats, including MS-DOS and GPT.
parted
- l
- m
- s
- a
- l, –list, Lists partition layout on all block devices.
- m, –machine, Displays machine parseable output.
- s, –script, Never prompts for user intervention.
- a, –align alignment-type, Set alignment for newly created partitions.
Alignment types:
none: Use the minimum alignment.
cylinder: Align partitions to cylinders.
minimal: Use minimum alignment as given by the disk info.
optimal: Use optimum alignment as given by the disk info.
parted [COMMANDS]
[device]
The block device to be used.
parted [commands [options]]
align-check type partition
mklabel label-type
mkpart part-type [fs-type] start end
align-check type partition
Check if partition satisfies the alignment constraint of type. type must be minimal or optimal.
mklabel label-type
Create a new disklabel (partition table) of label-type. label-type should be on of: aix, amiga, bsd, dvh, gpt, loop, mac, msdos, pc98, sun
mkpart part-type [fs-type] start end
Make a part-type partition for filesystem fs-type (if specified), beginning at start and ending at end (default MB). part-type should be one of primary, logical, or extended.
parted [command [options]]
name partition name
quit
rescue start end
name partition name
Set the name of partition to name. This option only works on mac, pc98 and gpt disklabels.
print, Display the partition table.
quit, Exit from parted.
rescue start end
Rescue a lost partition that waas located somewhere between start and end. If a partition is found parted will prompt to create an entry in the partition table for it.
part [command [options]]
resizepart partition end
rm partition
select device
resizepart partition end
Change the end position of partition.
rm partition
Delete the partition.
select device
Choose device as the current device to edit.
part [command [options]]
set partition flag state
unit unit
toggle partition flag
set partition flag state
Change the state of the flag on partition to state. Supported flags: boot, root, swap, hidden, raid, lvm, lba, legacy_boot, irst, esp, palo
state should be: on, off
unit unit
Set unit as the unit to use when displaying locations and sizes. Unit can be: s(sectors), B(bytes), kB, MB, MiB, GB, GiB, TB, TiB, %, cyl, chs(cylinders, heads, sectors), compact.
toggle partition flag
Toggle the state of flag or partition.