PROPHET/OS
NAME
parts: shows, edits and writes the partition table (GPT) of a drive
SYNOPSIS
parts <drive> [--tui] [command ...]
DESCRIPTION
Shows, edits and writes the partition table (GPT) of a drive. The drive number is the one disks shows; a partition is refused, the table lies on the drive it sits on.
**Nothing reaches the drive without the write step.** Every command edits the table in memory. A line that does not end with write shows the table as planned and says that nothing was written.
Words
The words behind the drive are commands, taken in their order. A command that fails ends the line, and what stood before it is not written.
parts 2 the table and the free space parts 2 init new auto 64M name 1 boot type 1 efi new auto rest write
| Command | What it does | |---|---| | list | the table as it stands in memory now | | init | an empty table, for a drive that carries none | | align <sectors> | what a start is a multiple of; one megabyte unless said | | new <start\|auto> <size\|rest> | a partition in free space; auto is the first gap that holds it | | delete <n> | the entry goes, the sectors under it stay as they are | | resize <n> <size\|rest> | a new size from the same start, up to the next partition | | type <n> <efi\|data\|pfs\|id> | the kind, by word or as an id written 8-4-4-4-12 | | name <n> <text> | at most 36 printable characters | | swap <a> <b> | two entries change places | | sort | the entries in sector order | | write | backup table, backup header, table, header: in that order |
A size is a number of sectors, or bytes with K, M, G or T in powers of 1024 that come out in whole sectors. <n> is the number in the column No. A new partition is of kind data and carries a random id of its own.
Refused, each with its sentence: an entry over another one, outside the usable area, larger than its free space, or a start off the alignment.
The return value is 0 when the line went through, 1 when a command or the drive refused, 2 for a line that is no command.
The whole screen
parts <drive> --tui shows the same table with a menu. Two views behind the tab key: every row in sector order, and the free space alone. The arrows up and down choose a row, left and right a menu item, enter does it; n d r t m s w q are the items by key.
New wants the cursor on free space, Delete, Resize, Type and Name on a partition. Write asks for the word yes before it touches the drive, and Quit asks the same when changes are not written. Escape drops a question.
What it does not do
It moves no data and makes no file system: mkfs.pfs and mkfs.fat32 do that on the partition, after the next start has numbered it. A table that came with a copy from a smaller drive is stretched by pfs disk expand-partition first.
A table whose front does not hold its sums is read from its backup, and write puts both right.
EXAMPLE
$ parts parts <drive> [--tui] [command ...] the partition table of a drive: shows it, edits it, writes it commands, in their order: list, init, align <sectors>, new <start|auto> <size|rest>, delete <n>, resize <n> <size|rest>, type <n> <efi|data|pfs|id>, name <n> <text>, swap <a> <b>, sort, write nothing reaches the drive without `write` --tui: the same on the whole screen, with a menu
SEE ALSO
disks, pfs, mkfs.pfs, mkfs.fat32, mount