pted

Partition table editor

Syntax:

pted [-a num] device cmd ...

Runs on:

QNX Neutrino

Options:

-a num
Align partitions to multiples of num blocks. The default alignment is 2048 blocks (1 MB). This alignment isn't stored anywhere, so if you used another value when initializing a disk, you must specify it again with every subsequent run of pted.
device
The block device to operate on (e.g., /dev/hd0).
cmd
One of the commands below, or a unique prefix thereof:
  • add — add a new partition
  • delete — remove an existing partition
  • edit — modify an existing partition
  • loader — write a primary MBR boot loader
  • initialize — set up a new, empty partition table
  • patch — patch the offsets of Power-Safe (fs-qnx6.so) partitions
  • show — display the existing partitions
  • uniquify — assign new random GUIDs to disk and partitions

For more details, see below.

Description:

The pted utility is a partition table editor that runs on a QNX Neutrino target and operates on disks (e.g., /dev/hd0). It understands both MBR and GPT disk partitioning schemes. The pted editor has some similarities to diskimage, and fdisk, but:

The commands include:

add -t type | -T guid [-s blocks | -p percent] [option...]
Add a GPT partition. All available space is used, unless you specify the -p or -s option. The options include:
  • -# slotnr — use slot number slotnr. Slot numbers start at 1; the default is the first available.
  • -b — set the “biosboot” attribute
  • -n name — set the partition name to name. By default, pted generates a unique name from the partition type.
  • -p pct — use pct percent of space. Positive values denote a percentage of the total data blocks on the disk; negative values indicate a percentage of the largest available gap.
  • -s size — use size blocks for the new partition
  • -t type — a partition type alias (e.g., qnx6)
  • -T guid — a partition type GUID. For information on types, see the entry for the diskimage configuration file.
add -t type [-s blocks | -p pct] [option...]
Add an MBR partition. All available space is used, unless you specify the -p or -s option. The options include:
  • -# slotnr — use slot number slotnr. Slot numbers start at 1; the default is the first available.
  • -b — make the partition bootable
  • -p pct — use pct percent of space. Positive values denote a percentage of the total data blocks on the disk; negative values indicate a percentage of the largest available gap.
  • -s size — use size blocks for the new partition
  • -t type — the partition type (e.g., 177, 178, 179)
Note: You can't use pted to create the following partition types:
  • Type 5 designates an extended partition (used to describe logical partitions).
  • Type 238 is reserved by UEFI for GPT disks. In the protective MBR of a GPT disk, the entire remaining disk (governed by GPT) is described as one large GPT partition.

Without setting up further metadata, adding these partition types could damage the disk contents or cause failures in general disk recognition.

delete -# slotnr
Remove an existing partition. The options include:
  • -# slotnr — delete slot number slotnr
edit -# slotnr [options]
Modify an existing GPT partition. The options include:
  • -# slotnr — edit the partition at slot number slotnr
  • -B — unset the “biosboot” attribute
  • -b — set the “biosboot” attribute
  • -n name — set the partition name to name
  • -t type — set partition type by alias (e.g., qnx6)
  • -T guid — set partition type by GUID
edit -# slotnr [options]
Modify an existing MBR partition. The options include:
  • -# slotnr — edit the partition at slot number slotnr
  • -B — make the partition nonbootable
  • -b — make the partition bootable
  • -t type — set the partition type (e.g., 177, 178, 179)
initialize [-g | -G num]
Set up a new, empty partition table. The options include:
  • -g — initialize a GPT disk with the minimum of 128 entries
  • -G num — initialize a GPT disk with num partition table entries

The default is to initialize an MBR disk.

loader -f path
Write a primary MBR boot loader. The options include:
  • -f path — store the contents of path in the MBR boot loader section
patch [-# slotnr] [-f]
Patch the offsets of Power-Safe partitions. The options include:
  • -# slotnr — patch only slot number slotnr (default: all)
  • -f — force; patch any type of partition (default: Power-Safe only)
show [-# slotnr] [-h[h]] [-v...]
Display the existing partitions. The options include:
  • -# slotnr — show only slot number slotnr
  • -h — show headers (-hh: show headers only)
  • -v — increase verbosity
uniquify
Make unique; assign new random GUIDs to disk and partitions. No options are currently defined.