Forrest logo
tool overview
On this page you find all important commands for the CLI tool partx. If the command you are looking for is missing please ask our AI.

partx

Partx is a command line tool used in Linux systems to manipulate partition tables on a block device. It is primarily used to recognize and create partitions on disk images or disk devices. The tool operates at the disk partition level and can read, write, update, and delete partition information.

Partx uses the libblkid library to gain access to partition information and works with various disk formats, including GPT (Guid Partition Table) and MBR (Master Boot Record). It can create partition entries based on the disk image or device, which enables easy mounting of individual partitions within an image/file.

The command line options of partx provide flexibility in specifying the partition devices to work with or displaying detailed information about partitions. The '-a' option automatically scans the devices for partitions, while '-d' deletes partition table entries of a specified device. Its '-r' option is used to update the kernel to read the new partition table, without rebooting the system.

Partx is often used in scenarios involving disk image mounting, disk cloning, or when working with disk devices that require partition table modifications. With its wide range of functionalities, it proves to be a versatile tool for partition manipulation in Linux systems.

List of commands for partx:

  • partx:tldr:91ec3 partx: Delete all the partitions found from the kernel (does not alter partitions on disk).
    $ sudo partx --delete ${path-to-device_or_disk_image}
    try on your machine
    explain this command
  • partx:tldr:b8d9d partx: Add all the partitions found in a given block device to the kernel.
    $ sudo partx --add --verbose ${path-to-device_or_disk_image}
    try on your machine
    explain this command
  • partx:tldr:f41e2 partx: List the partitions on a block device or disk image.
    $ sudo partx --list ${path-to-device_or_disk_image}
    try on your machine
    explain this command
tool overview