LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to repair win-destroyed MBR without a floppy (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-repair-win-destroyed-mbr-without-a-floppy-39257/)

J_Szucs 12-24-2002 02:10 AM

How to repair win-destroyed MBR without a floppy
 
My gaming OS (Win98) committed a suicide which pleased me much, however I have to re-install it since my baby wants his games back.
I know that gaming OS will destroy the present MBR and I will have to repair it somehow.
Unfortunately my floppy drive is out of order, and accidentally my SuSe 7.3 installation CD is not available for me for two weeks, either.
Is there an other way to put Lilo back into the MBR?
Maybe a winDO$ executable for this purpose, or if I could use an older (SuSe 6.4) installation CD?

jago25_98 12-24-2002 03:13 AM

1) Note down the location of ur linux on HD. It'll be /dev/hda5 or something. Make sure you get the root partition not the swap partition or your windows stuff.

2) get a linux install cd or cd based distro such as:

- knoppix
- mandrake

I have'nt got SUSE :/ you'll have to suck it and see.

3) test booting into linux without using your mbr. Put cd in drive, type "linux root=/dev/theOneYouWroteDown" or try tab to see what 'linux' should be replaced with.

4) if it works its safe to install win98

5) boot from cdrom again and install lilo to the mbr.

Don't worry, as long as linux is on your harddrive and you have some sort of boot device you can boot it :) It's just a matter of knowing how.

J_Szucs 12-24-2002 07:47 AM

In fact, I would feel safer if I could start my installed SuSe 7.3 system booting up from the SuSe 6.4 installation CD, but I could not do that:
When I boot up from the 6.4 CD, yast2 automatically starts no matter if I type 'linux root = /dev/hdb7' at the 'boot:' prompt.
If I exit yast2, I got into a menu, where there is a menu item 'Start an installed system'.
That is what I need so I select that, but then I am prompted for a root device.
I enter /dev/hdb7 (according to /etc/lilo.conf this is my root partition), but SuSe replies:
'Invalid root device'
Actually I tried anything from hda1 through hda5 and hdb1 through hdb9, but none of them were accepted by SuSe 6.4 as a valid root device.
Is it because my present root partiton /dev/hdb7 has a reiserfs file system and the old kernel does not recognize that?

I am also confused by the fact that my boot partition is /dev/hdb5 (which has an ext2 file system).

So, do I need to specify the root or the boot partition at boot-up time (so far none of them worked).

Maybe the fact that I cannot boot-up the system from the 6.4 CD does not prevent me from installing lilo into the MBR, but now I am not sure whether it would find my root device. At least, when I had a SuSe 6.4 system on the HDD, I could boot into it using the SuSe 6.4 installation CD (actually, so far as I remember, when I first installed SuSe it was the only way I could start my Linux for weeks, until I finally found out how to put Lilo into the MBR).
But the CD boot-up does not seem to work when the SuSe versions are different.

J_Szucs 12-24-2002 05:49 PM

Well, this thread seems to sink without help.

I give it a last try.

Anyway, I can no longer postpone the Windows install, since my little son is getting mad.
Maybe I can somehow get back into linux (and here) afterwards...

MasterC 12-24-2002 06:30 PM

Good Luck :)

J_Szucs 12-25-2002 12:59 PM

I had no luck...

As I suspected I am no longer able to start Linux after the win98 install. (It is a shame, but I write this from WinDO$)
Using the SuSe 6.4 installation CD I cannot even exit yast and got to a command prompt. If I try yast menu item 'start an installed system', yast does not accept my root device ('invalid root device').
I found a Mandy 8.2 installation CD, where I could find a 'Rescue Mode', but when I choose repair MBR it also says: 'cannot find root device' (I am now curious how could SuSe 7.3 find a root device on a machine where nor SuSe 6.4 nor Mandy 8.2 can find that).
However, in Mandy's rescue mode I can get to a command prompt and mount my hard drive (although I still cannot boot into it).
Could anyone help me, what is the command in Mandy, by which I could put lilo back into the MBR?

Mara 12-25-2002 04:02 PM

1) Boot from the Mandrake cd.
2) Mount your / from the hd:
mkdir /mnt/main
mount -t reiserfs /dev/hda? /mnt/main
Where /dev/hda? is your / partition.
3) Edit lilo.conf, but the one from your / partition, so it's /mnt/main/etc/lilo.conf, make sure it has 'boot=/dev/hda' line
4) 'chroot /mnt/main', that makes /mnt/main your /
5) run 'lilo'
6) Reboot, lilo should start.

J_Szucs 12-25-2002 05:51 PM

Thanks Mara,

your help was invaluable to get back into Linux!

With some necessary modifications (changed hda? to hdb7 plus mounted /dev/hdb5 to /boot) it worked as expected.

I could also see how close I was to success before. I should have known that chroot trick (step 4), only, and I could have done it on my own. (However, I must admit that I could have never figured out that trick on my own; and that I did not know that simply runnig lilo would repair the mbr; so I only kept trying to start lilo just to see what can I do with it once running)

So, thanks again!

P.S.
I would like to avoid any future reinstallations of win98, if possible.
Could you please give me some hints how to backup windows to a Linux partition so that windows re-installation can be avoided?
(E.g. is it possible to periodically copy the whole windows, and maybe the Program Files directories to the Linux partition, and simply copy it back when needed? Would this result in an operable windows system?)


All times are GMT -5. The time now is 01:36 AM.