LukeShortCloud / rootpages

Root Pages is a collection of easy-to-reference tutorials and guides primarily for Linux and other UNIX-like systems.
Other
56 stars 6 forks source link

[storage][backup_and_recovery] Recreate partition table #1018

Open LukeShortCloud opened 11 months ago

LukeShortCloud commented 11 months ago

Using testdisk.

https://www.simplified.guide/linux/disk-recover-partition-table

LukeShortCloud commented 11 months ago

Related to this, if you have a MBR partition table you can back it up using this command:

$ sudo dd if=/dev/<DEVICE> of=/root/mbr.img bs=512 count=1

For GPT:

$ sudo sgdisk --backup=gpt.img /dev/<DEVICE>
$ sudo sgdisk --load-backup=gpt.img /dev/<DEVICE>
$ sudo sgdisk -G /dev/<DEVICE>

https://askubuntu.com/questions/57908/how-can-i-quickly-copy-a-gpt-partition-scheme-from-one-hard-drive-to-another