[H-GEN] Cleaning up the MBR on a /dev/hda
Jason Parker-Burlingham
jasonp at panix.com
Mon Nov 14 21:17:10 EST 2005
On Tue, Nov 15, 2005 at 11:54:08AM +1000, Ewan Edwards wrote:
> The best idea I've had so far is to somehow capture the partition
> table information, then use dd as above, then somehow write the
> captured information back.
>
> Suggestions gratefully accepted for the 'somehow' steps.
>
The sfdisk manpage says:
-d Dump the partitions of a device in a format useful as input to
sfdisk. For example,
% sfdisk -d /dev/hda > hda.out
% sfdisk /dev/hda < hda.out
will correct the bad last extended partition that the OS/2
fdisk creates.
I believe that standard Linux fdisk has -lu options which would be similarly
useful. It would probably be best to back up all your data, double-check the
backup, and use two different fdisk programs to record the partition locations
before making any changes.
Oh, and Googling says that the "dd bs=512" command you mentioned will not, in
fact, wipe the partition table, and such is my recollection (though I did get
burned trying to run that command once before).
Alternatively, boot from a rescue disk and install GRUB.
--
Jason Parker-Burlingham
<jasonp at panix.com>
(Watch this space)
More information about the General
mailing list