Scriptable partitioning
high risk
sfdisk -d <dev> > <dev>.ptBack up firstDump/restore partition tables. See the flags and examples below, and run `man sfdisk` for the full reference.
| Flag | Meaning |
|---|---|
-d | Dump |
--no-reread --no-reread | Skip kernel reread |
sfdisk -d /dev/sda > sda.ptBack up the table · explain & risk-check →sfdisk /dev/sdb < sda.ptRestore (overwrites!) · explain & risk-check →Reference text is hand-written and may be incomplete — check man sfdisk for your version. Test destructive commands on a non-production system first.