Discussion:
Re-building a partition table?
(too old to reply)
Barg
2004-12-13 10:59:20 UTC
Permalink
Is it possible to re-build a partition table in Linux?  I accidentally
reformatted a partition!  There's nothing critical on it but I thought it
might be an interesting exercise.

I copied it with

dd if=/dev/hdb8 of=/tmp/part.img

and a look at part.img shows the data's still there.

Any suggestions about how I should proceed now...?
Rich Fearn
2005-01-02 02:29:35 UTC
Permalink
Is it possible to re-build a partition table in Linux? I accidentally
reformatted a partition! There's nothing critical on it but I thought it
might be an interesting exercise.
From the rest of your post I take it you mean re-build a *partition*,
rather than a partition *table*...
I copied it with
dd if=/dev/hdb8 of=/tmp/part.img
So you took a backup of hdb8 before formatting it.
and a look at part.img shows the data's still there.
Any suggestions about how I should proceed now...?
If hdb8 hasn't been changed since you formatted it, you should just be
able to use the same command but the other way round:

dd if=/tmp/part.img of=/dev/hdb8

Rich

Loading...