How to restore MBR without using dos fdisk?
Hello,
This is a strange problem. I had accidental installed lilo on MBR and I need to remove it. I had another one installed on the boot sector of second primary partition of my disk ( ie hda2 ). My current disk layout shows the second partition marked active or boot able in fdisk but it doesn't boot. now I want to remove the one installed on MBR and don't want to use DOS/Windows fdisk. can anyone help me please? |
Is there any particulay reason you don't want to use DOS FDISK?
Baldrick |
Just to get this straight, are you just trying to boot /dev/hda2? If so, what kind of partition/filesystem is it?
|
fdisk /mbr
should work!!! be careful !! this is a powerful thing... fdisk won't ask confirmation... regards slackie |
Quote:
1. I believe that linux tools should be powerful, complete, self contained and without the need of help from external resources. 2. I am pretty curious about doing it in linux without having to use any other available utility, especially those from MS world. ;) 3. I like to get my hands messy with grease. I think you'll get the picture. |
I think lilo stores a backup copy of the original mbr in something like /boot/boot.0300, try writing it back
Code:
dd if=/boot/boot.0300 of=/dev/hda bs=446 count=1 |
Quote:
My problem is solved. But lets go an extra mile on this one. Who knows, we might need it some day. Lets suppose I don't have that copy, or might say that i don't have any copy of the previous mbr. Then what should we do? Any ideas? If MS can do it, so can we. |
As long as your lilo.conf file is OK just rerun lilo.
|
Try this utility, it can write a mbr that can do what the standard dos mbr does, and more.
http://www.chiark.greenend.org.uk/~neilt/mbr/ the syntax to use should be something like Code:
install-mbr /dev/hda -v --interrupt n --partition D --timeout 0 |
Quote:
|
Not that I'm aware of
|
testdisk does restore DOS MBR
Quote:
Code:
TestDisk 6.8, Data Recovery Utility, August 2007 |
All times are GMT -5. The time now is 12:06 AM. |