Search This Blog

Sunday, May 1, 2011

How to export/backup partition schema for a disk using old style disk partitions format like 'msdos' written into MBR sector

To backup the partition schema of the disk you can execute:

# sfdisk -d /dev/sda > part.txt

# example output can look like
# cat part.txt
# partition table of /dev/sda
unit: sectors

/dev/sda1 : start=       63, size=204796557, Id= 7, bootable
/dev/sda2 : start=204797952, size=204800000, Id= 7
/dev/sda3 : start=409597952, size=200001536, Id=83
/dev/sda4 : start=        0, size=        0, Id= 0

To restore the part.txt you can use:

# sfdisk /dev/hda < part.txt 
 
References:
man sfdisk 
Wiping Out Old GPT Data 

No comments:

Post a Comment