LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-24-2002, 02:10 AM   #1
J_Szucs
Senior Member
 
Registered: Nov 2001
Location: Budapest, Hungary
Distribution: SuSE 6.4-11.3, Dsl linux, FreeBSD 4.3-6.2, Mandrake 8.2, Redhat, UHU, Debian Etch
Posts: 1,126

Rep: Reputation: 58
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?
 
Old 12-24-2002, 03:13 AM   #2
jago25_98
Member
 
Registered: Jun 2001
Posts: 302

Rep: Reputation: 30
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.
 
Old 12-24-2002, 07:47 AM   #3
J_Szucs
Senior Member
 
Registered: Nov 2001
Location: Budapest, Hungary
Distribution: SuSE 6.4-11.3, Dsl linux, FreeBSD 4.3-6.2, Mandrake 8.2, Redhat, UHU, Debian Etch
Posts: 1,126

Original Poster
Rep: Reputation: 58
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.

Last edited by J_Szucs; 12-24-2002 at 06:01 PM.
 
Old 12-24-2002, 05:49 PM   #4
J_Szucs
Senior Member
 
Registered: Nov 2001
Location: Budapest, Hungary
Distribution: SuSE 6.4-11.3, Dsl linux, FreeBSD 4.3-6.2, Mandrake 8.2, Redhat, UHU, Debian Etch
Posts: 1,126

Original Poster
Rep: Reputation: 58
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...
 
Old 12-24-2002, 06:30 PM   #5
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613

Rep: Reputation: 69
Good Luck
 
Old 12-25-2002, 12:59 PM   #6
J_Szucs
Senior Member
 
Registered: Nov 2001
Location: Budapest, Hungary
Distribution: SuSE 6.4-11.3, Dsl linux, FreeBSD 4.3-6.2, Mandrake 8.2, Redhat, UHU, Debian Etch
Posts: 1,126

Original Poster
Rep: Reputation: 58
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?
 
Old 12-25-2002, 04:02 PM   #7
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
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.
 
Old 12-25-2002, 05:51 PM   #8
J_Szucs
Senior Member
 
Registered: Nov 2001
Location: Budapest, Hungary
Distribution: SuSE 6.4-11.3, Dsl linux, FreeBSD 4.3-6.2, Mandrake 8.2, Redhat, UHU, Debian Etch
Posts: 1,126

Original Poster
Rep: Reputation: 58
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?)

Last edited by J_Szucs; 12-25-2002 at 06:20 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
repair corrupt floppy sectors cccc Linux - Hardware 1 08-05-2005 04:00 AM
Using the installation CD to boot and repair the MBR in Mandrake 10 dvela Mandriva 5 08-19-2004 09:17 AM
Can't install lilo to MBR or floppy pele_smk Slackware 7 12-10-2003 04:46 PM
dualboot - lost win MBR clokwurk Linux - Newbie 4 09-14-2003 03:58 PM
Win XP + mbr + grub = >:O jclark00001 Linux - Newbie 1 02-15-2003 08:36 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:30 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration