0

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.

Ram
  • 179
  • 1
  • 2
  • 8
  • Did you search the web? I found https://bbs.archlinux.org/viewtopic.php?pid=909450#p909450 within seconds. – Antonis Christofides Aug 06 '14 at 09:20
  • First of all, GPT has reserved the first sector for an MBR partition table to protect it against accidental deletion by software assuming any disk without an MBR is empty. This means it is in principle easy to recover the first sector of GPT disk, if it has been accidentally overwritten. Moreover since you have two identical disks, it is likely the MBR of each GPT were identical. If that's the case, it might be possible to recover it by simply copying over from the other disk. However that is a dangerous maneuver, so don't do that until somebody else has confirmed, that it should be safe. – kasperd Aug 06 '14 at 09:41

1 Answers1

3

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:

perror
  • 351
  • 1
  • 6
  • 18