# Recover partition table from memory? [Solved]

## bobpaul

So I was copying the partition table from one drive to another. I meant to do

```
dd if=/dev/sdb of=/dev/hda bs=512 count=1
```

instead I did

```
dd if=/dev/hda of=/dev/sdb bs=512 count=1
```

So now the partition table on my original drive is gone! I'm running gpart right now to try to guess it back, but I noticed all of my /dev/sdb[1...6] partitions still exist because sync() never got issued. That means my partition table still exists in kernel memory and I can still mount my partitions!

Is it possible to read the partition table out of kernel memory and dump it back to the disk?Last edited by bobpaul on Mon Jul 16, 2007 2:48 am; edited 1 time in total

----------

## Lupin_the_3rd

$ cat /proc/partitions

FYI- I always keep backups of these things just in case:

dd if=/dev/sda of=/boot/sda.mbr bs=512 count=1

----------

## ljubo

 *bobpaul wrote:*   

> So now the partition table on my original drive is gone! I'm running gpart right now to try to guess it back..

 

You can also try partition recovery with TestDisk. I find it better than gpart.

Regards, Ljubo

----------

