repart
storageLinux
The repart command is one of the most frequently used commands in Linux/Unix-like operating systems. repart Repartition a disk or update partition tables
Quick Reference
Command Name:
repart
Category:
storage
Platform:
Linux
Basic Usage:
repart [options] [arguments]
Common Use Cases
Syntax
repart [options] device
Options
| Option | Description |
|---|---|
--dry-run |
Don't make any changes, just show what would be done |
--empty=mode |
Specify handling of existing partitions (refuse, allow, require, force, create) |
--discard=mode |
Control TRIM/UNMAP operations (disabled, passive, active, or force) |
--size=size |
Specify size of operation (auto, min, max, or size) |
--factory-reset=bool |
Whether to apply factory reset partitions |
--can-factory-reset |
Test if factory reset is defined |
--root=path |
Operate relative to specified root directory |
--image=path |
Operate on specified disk image instead of the local machine |
--definitions=path |
Find partition definitions in specified directory |
--key-file=path |
Key to use for LUKS encryption |
--tpm2-device=path |
TPM2 device to use for LUKS encryption |
--tpm2-pcrs=list |
TPM2 PCR indexes to use for LUKS encryption |
--seed=UUID |
128-bit seed UUID for partition UUIDs |
--pretty=bool |
Show pretty-printed partition diagram |
--json=mode |
Generate JSON output (pretty, short, off) |
--no-pager |
Do not pipe output into a pager |
--no-legend |
Do not show the legend |
--help |
Show help message |
--version |
Show version information |
Examples
How to Use These Examples
The examples below show common ways to use the repart command. Try them in your terminal to see the results. You can copy any example by clicking on the code block.