2024-09-11 20:46:20 +03: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-07 13:45:30 +02:00
|
|
|
`sudo sfdisk {{[-d|--dump]}} {{path/to/device}} > {{path/to/file.dump}}`
|
2024-09-11 20:46:20 +03: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-07 13:45:30 +02:00
|
|
|
`sfdisk {{[-h|--help]}}`
|