Linux – How to rescue deleted partition table on drive

gptlinuxpartitionraid

I accidentally dd the first 512 bytes using

dd if=/dev/zero of=/dev/sdb bs=512 count=1

and the partition table is now gone. Is there ANY way to re-create the partition table.

My hard drive is 2X2TB Soft RAID(GPT Partition Table)

root@rescue:/# parted -l
Model: ATA HGST HUS724020AL (scsi)
>Disk /dev/sda: 2000GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number  Start   End     Size    File system     Name     Flags
 1      20.5kB  1049kB  1029kB                  primary  bios_grub
 2      2097kB  1987GB  1987GB                  primary
 3      1987GB  1992GB  5242MB  ext4            primary
 4      1992GB  2000GB  8388MB  linux-swap(v1)  primary


Error: /dev/sdb: unrecognised disk label
Model: ATA HGST HUS724020AL (scsi)
>Disk /dev/sdb: 2000GB
Sector size (logical/physical): 512B/512B
Partition Table: unknown
Disk Flags:

Any help would be much appreciated.

Best Answer

One of the best way to recover damaged partition is to run software such as TestDisk and/or PhotoRec on your device.

It won't succeed for sure, so be cautious. But, most of the time it got me out of a lot of troubles.

Here are full tutorials about using TestDisk and recover your partitions:

Related Topic