Backing up your Partition Table.
by Talk about Deal on Jul.05, 2009, under Blog
This one is common problem, getting your partition table corrupt.
So I always keep a Backup of it.
Which is more than easy, I’m using dd command, which for coping/converting/cloning/and imaging the file.
So the drives, because everything in Linux is file, except your NIC.
For those who don’t know where is the partition table, –
Partition table is a part of your MBR ( Master Boot Record )
The MBR size totals to 512 byte ( 1 Byte = 8 Bits, 1 Byte is used to store one binary value either 0 or 1 )
The Structure of MBR is like this
| Address (Decimal) | Content | Size (Bytes) |
| 0 | Code Area | 440 |
| 440 | Optional Disk Signature | 4 |
| 444 | NULL | 2 |
| 446 | Table of Primary Partition | 64 |
| 510 | 55h MBR Singnature | 1 |
| 511 | AAh MBR Signature | 1 |
First, We will back up the MBR.
dd if=/dev/hda of=mbr.bak bs=512 count=1
dd if=mbr.bak of=/dev/hda skip=446 seek=446bs=1 count=64
For SCSI drives it will list as /dev/sda
To List your drives and partition
You can always use fdisk –l
Technorati Tags: MBR, Partition Table, Backup, Linux, dd, How To