LinuxCommandLibrary

mpartition

Partition media for Minix filesystem

SYNOPSIS

mpartition [-v] [-q] [-n] [-d ] [-i ] [-t ] [-s ] [-l ] [-u ] [-a ] [-o ] [-N ] [-F ] [-U ] [-L

PARAMETERS

-v
    Verbose mode. Prints more detailed output.

-q
    Quiet mode. Suppresses output messages.

-n
    Create a new partition table. Overwrites any existing partition table.

-d
    Specifies the target device (e.g., /dev/sda).

-i
    Specifies the index (number) of the partition to operate on.

-t
    Sets the partition type. Usually a hex code (e.g., 8300 for Linux).

-s
    Specifies the starting sector of the partition.

-l
    Specifies the length (number of sectors) of the partition.

-u
    Sets the partition GUID.

-a
    Sets the alignment of the partition.

-o
    Sets the offset of the partition from the start of the disk.

-N
    Sets the partition name (GPT only).

-F
    Sets the filesystem UUID.

-U
    Sets the unique ID of the partition.

-L
    Sets the label of the partition.

-C
    Clears the partition table (removes all partitions).

-e
    Edit an existing partition.

-y
    Answer yes to all prompts.

-r
    Read partition table.

-w
    Write partition table to disk.

-h
    Display help message.

DESCRIPTION

The `mpartition` command is a tool used to create, modify, and manage partition tables on hard disks. It's primarily intended for GPT (GUID Partition Table) disks but can also handle older MBR (Master Boot Record) disks. `mpartition` is particularly useful when standard partitioning tools like `fdisk` or `parted` are inadequate, such as when dealing with unusual partition layouts, large disks (over 2TB) requiring GPT, or specific boot configurations. The tool provides fine-grained control over partition attributes, types, and sizes. It is often used when scripting partition operations or when a more direct interaction with the partition table is needed. Because of the potential for data loss, it requires caution and a good understanding of partitioning concepts.

CAVEATS

Incorrect usage of `mpartition` can lead to data loss. Always back up important data before modifying partition tables. Understanding GPT and MBR partitioning schemes is essential.

PARTITION TYPES

The `-t` option requires a partition type code.
Common codes include:
8300: Linux filesystem
8200: Linux swap
ee00: Protective MBR (GPT)

GPT VS MBR

GPT is a modern partitioning scheme that overcomes limitations of MBR, such as the 2TB size limit and the four primary partition limit. `mpartition` excels at handling GPT disks.

HISTORY

The `mpartition` command emerged as a specialized partitioning tool, particularly relevant with the increasing adoption of GPT partitioning for larger storage devices. While its exact origins are difficult to pinpoint, it likely arose to address limitations in standard partitioning tools when dealing with GPT and more complex partition configurations. It's usage has become more common in embedded systems and situations where scripted or precise partition control is needed.

SEE ALSO

fdisk(8), parted(8), gdisk(8)

Copied to clipboard