LinuxQuestions.org
Visit Jeremy's Blog.
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 03-30-2005, 03:07 AM   #1
AdmiralFreezbee
LQ Newbie
 
Registered: Mar 2005
Posts: 12

Rep: Reputation: 0
problem with MBR / dual boot


I had two hard disks in my pc:
Master: 5GB
Slave: 20GB
Until yesterday only Windows was installed on it.

Now, because all my disks were full I decided to buy a new one (250GB). My master didn't contain any useful information (I thought) only documents, Windows was installed on my slave.

What I forgot was that my MBR was written on my Master. So when I formatted my 5GB disk, Windows couldn't start anymore. Now one of the reasons I bought a new disk was to install Linux.
So I installed Mandrake 10.0 and thought that I could configure lilo so that he could "find" Windows again.

So for the moment my situation is the following. I have two disks:
Master: 250GB
Slave: 20GB

On my master Mandrake Linux 10.0 is installed, on my slave Windows XP is (still) installed. When I start my pc, lilo shows his options: starting Mandrake is no problem, but when I select Windows I get an "non system disk,..." or something like that.

What I want is to configure lilo in such a way that I can start Windows again without losing any of my data (and programs) on my 20GB disk.
Of course, since the Mandrake installation is only one day old, I can easily reinstall (another version of) Linux.

Thanks in advance for those willing to help!
 
Old 03-30-2005, 04:13 AM   #2
sinnerman
LQ Newbie
 
Registered: Mar 2005
Distribution: Mandrake 10.1, Redhat 9
Posts: 11

Rep: Reputation: 0
This isn't exactly answering your question, but I fear you windows partition isn't coming back. Meaning best case senario is that you copy all your files to the linux partition, reinstall windows and then copy all those files back.
Here are the instructions for that though I understand it's not ideal.

First step, boot into Linux. For the following instructions we will assume your username on your linux machine is Admiral
You may have to open a terminal if it auto-boots into X. Then from the command line type:
Admiral@localhost$ cd /mnt/
Admiral@localhost$ ls <-- at this point you should see a directory called windows (or something vaguely familiar like that) If so, carry on with the steps below. If not, post again.
Admiral@localhost$ mkdir /home/Admiral/Windows_Files
Admiral@localhost$ cp -r /mnt/windows/whatever_files /home/Admiral/Windows_Files

During your windows install be sure to create a small partition (~2G) that is FAT32 so that you can read&write files to and from both OSes.

HTH
-S
 
Old 03-30-2005, 05:09 AM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 15,962

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
Your data is not lost - merely your ability to directly access it.

Windows needs to boot from the primary drive. As such you need to convince it that it is on the "master" disk, not the "slave". I believe that LILO achieves this via "map-to=" and "to=" directives.
Basically you need to logically swap hd0 and hd1 so Windows will boot.

Do some searching and you should find references online.
 
Old 03-30-2005, 05:24 AM   #4
AdmiralFreezbee
LQ Newbie
 
Registered: Mar 2005
Posts: 12

Original Poster
Rep: Reputation: 0
Thanks for your answer!
That sounds a little bit more encouraging than sinnermans answer.
I'm a bit confused. You say:
. As such you need to convince it that it is on the "master" disk, not the "slave".
But my disk IS on the slave so it isn't it the other way around.

And if I do this (what I will try in 1 minute) will LILO find something there since my old MBR was on my old hard disk that isn't in my pc anymore.
 
Old 03-30-2005, 05:57 AM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 15,962

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
The MBR is *always* on the primary (master) disk. Each disk may have a boot record in the first sector, but only ONE is given control by the BIOS. For that boot, it is *the* MBR.

In your case the code in the MBR launches LILO - the drive swapping directives are merely logical, and for the benefit of brain-dead software that is unable to discern that other (non primary) drives exist on your system.
Namely Windows.

After you update the lilo config, you'll have to rerun the lilo command I believe.
If you were using grub I could easily give you the updates for the config, but it's been too many years since I used lilo - I refuse to allow any distro to install it on my systems.
 
Old 03-30-2005, 06:27 AM   #6
AdmiralFreezbee
LQ Newbie
 
Registered: Mar 2005
Posts: 12

Original Poster
Rep: Reputation: 0
I read some information about LILO and I'm alot wiser but my problem isn't solved (yet).
Apparently my lilo.conf is right (I'm already using the map-drive an to 's). But when I run fdisk -l my second hard drive isn't bootable (there isn't a * next to it).

I have had a dual boot in the past so I'm assuming I have to do something extra, maybe adjusting jumpers?

Can I fix this?
 
Old 03-30-2005, 06:40 AM   #7
AdmiralFreezbee
LQ Newbie
 
Registered: Mar 2005
Posts: 12

Original Poster
Rep: Reputation: 0
I tried it once with grub
Without changing anything, restarting and selecting windows I get:
Code:
Booting Windows

root(hd1,0)
Filesystem type is fat, partition type 0xc
map (0x81) (0x80)
map (0x80) (0x81)
makeactive

chainloader +1

NTLDR is missing
Press any key to restart
 
Old 03-30-2005, 06:45 AM   #8
abisko00
Senior Member
 
Registered: Mar 2004
Location: Munich
Distribution: SuSE, Ubuntu
Posts: 3,513

Rep: Reputation: 58
I think your lilo.conf should contain something like this (as syg00 already mentioned):
Quote:
other=/dev/hdb1
label=Windows
map-drive = 0x81
to = 0x80
map-drive = 0x80
to = 0x81
The bios ID may need to be adjusted, I simply stole them from the Lilo-mini-HowTo. The bootflag can easily be set with cfdisk.

EDIT just read your last post. With grub try:
Code:
title windows
   root (hd1,0)
   makeactive
   chainloader +1
   map (hd0) (hd1)

   map (hd1) (hd0)

Last edited by abisko00; 03-30-2005 at 06:46 AM.
 
Old 03-30-2005, 07:08 AM   #9
AdmiralFreezbee
LQ Newbie
 
Registered: Mar 2005
Posts: 12

Original Poster
Rep: Reputation: 0
Hey,

Thanks for your suggestion, but I keep getting the same error. I managed to setting the bootflag on the hdb. Thanks for that!
 
Old 03-30-2005, 07:06 PM   #10
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 15,962

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
Try making the root command
Code:
rootnoverify (hd1,0)
and try putting the map commands before the chainload. Don't know if the latter matters, but makes more sense that way.
 
Old 03-31-2005, 12:21 AM   #11
bob 11
LQ Newbie
 
Registered: Dec 2004
Posts: 2

Rep: Reputation: 0
maybe im way off base but couldnt you just use delpart utility the new GUI version wipe out the old MBR and use a windows recovery console to rebiuld your mbrand then go from there idk i had a similier problem with dual oot and thats how i fixed it
 
Old 03-31-2005, 04:19 AM   #12
AdmiralFreezbee
LQ Newbie
 
Registered: Mar 2005
Posts: 12

Original Poster
Rep: Reputation: 0
Bob,

Thanks for the suggestion. I did that and now it's kinda solved. I tried fixmbr (and fixboot) many times with no luck. But after reading some information I found that I had to copy two files from the Windows XP rescue cd.
The main problem I think was that Windows just couldn't boot from a slave and when I tried fixmbr and fixboot nothing changed. When I swapped my two drives from master to slave everything worked.
So now everything is restored. I have just repartitioned my new drive. Copied some old files on it. I have just downloaded Fedora. Now writing to a dvd and then I can install everything

Thanks for all your help!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
broken MBR on dual-boot drive blastradius Ubuntu 4 08-18-2006 07:44 AM
MBR help dual boot xp and fc2 theconfused Fedora 7 09-03-2004 06:00 PM
MBR with WinXP and Linux Dual Boot Ruined...! truhuska Linux - Newbie 7 04-30-2004 12:49 AM
Dual-boot on two Hard Disks, MBR, etc admanb Linux - Newbie 4 02-06-2004 05:45 PM
Dual boot without touching the MBR? senectus Linux - Newbie 4 07-14-2003 10:17 AM

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

All times are GMT -5. The time now is 01:58 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration