2025-03-14 21:59:59 -06:00
|
|
|
# sfdisk
|
|
|
|
|
|
|
|
|
|
> Display or manipulate a disk partition table.
|
|
|
|
|
> More information: <https://manned.org/sfdisk>.
|
|
|
|
|
|
|
|
|
|
- Back up the partition layout to a file:
|
|
|
|
|
|
2025-03-19 19:23:44 -06:00
|
|
|
`sudo sfdisk {{[-d|--dump]}} {{path/to/device}} > {{path/to/file.dump}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Restore a partition layout:
|
|
|
|
|
|
|
|
|
|
`sudo sfdisk {{path/to/device}} < {{path/to/file.dump}}`
|
|
|
|
|
|
|
|
|
|
- Set the type of a partition:
|
|
|
|
|
|
|
|
|
|
`sfdisk --part-type {{path/to/device}}} {{partition_number}} {{swap}}`
|
|
|
|
|
|
|
|
|
|
- Delete a partition:
|
|
|
|
|
|
|
|
|
|
`sfdisk --delete {{path/to/device}} {{partition_number}}`
|
|
|
|
|
|
|
|
|
|
- Display help:
|
|
|
|
|
|
2025-03-19 19:23:44 -06:00
|
|
|
`sfdisk {{[-h|--help]}}`
|