1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-21 21:42:08 +02:00
tldr/pages/linux/sfdisk.md
Managor 320d209c78
*: fix style guide issues part 2 (#15777)
Co-authored-by: Darío Hereñú <magallania@gmail.com>
2025-03-07 13:45:30 +02:00

542 B

sfdisk

Display or manipulate a disk partition table. More information: https://manned.org/sfdisk.

  • Back up the partition layout to a file:

sudo sfdisk {{[-d|--dump]}} {{path/to/device}} > {{path/to/file.dump}}

  • 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:

sfdisk {{[-h|--help]}}