LinuxQuestions.org
Review your favorite Linux distribution.
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 01-07-2007, 12:34 AM   #1
Mohrravvian
LQ Newbie
 
Registered: Jan 2007
Location: USA
Distribution: openSuSE 10.2
Posts: 13

Rep: Reputation: 0
Unhappy help > problem with boot loader


Hi there. I am new to Linux [], I recently installed Suse 10.2 on my machine, but it will not boot correctly. I installed it as a dual-boot with XP Professional, but when I start it up XP fires up as if Linux is not there. I can use the install CD to get Linux to start via the "Boot installed system" option, and linux runs just fine, but the only thing that will boot by default is XP.

My system is set up as follows:

SATA drive with XP, NTFS file system
IDE drive with Linux partition, swap partition, FAT partition, NTFS partition

I tried switching the boot order in the BIOS to choose the IDE drive first, that did not change anything (XP still boots up as though linux doesn't exist). Then I tried to force the BIOS to choose the IDE as the boot source (through the choose boot location option), and it said no boot information was on that drive.

In YaST, the "Boot Loader Settings" has GRUB as the boot loader type and "Boot Loader Location" is "Custom Boot Partition /dev/hda", which is my IDE drive.

I would like to fix this as booting from the CD takes 3 times as long as necessary and is a big pain.

Any help on this would be greatly appreciated! I'm just starting in Linux but already I'm impressed.

Thanks in advance!

Mohrravvian
 
Old 01-07-2007, 01:44 AM   #2
penguiniator
Member
 
Registered: Feb 2004
Location: Olympia, WA
Distribution: SolydK
Posts: 442
Blog Entries: 3

Rep: Reputation: 60
Go back into YaST and into the boot loader module. There should be a button labeled Other (at least, in 10.1 there is). It is a drop down menu with several options. One of them is "Restore MBR of Hard Disk". Click that option. Then click the Finish button in the boot loader dialog. This should restore the Grub boot loader and allow you to choose Linux or Windows when booting.
 
Old 01-07-2007, 01:50 AM   #3
penguiniator
Member
 
Registered: Feb 2004
Location: Olympia, WA
Distribution: SolydK
Posts: 442
Blog Entries: 3

Rep: Reputation: 60
On second thought, if you installed Windows after installing Linux, there will not be a Windows option in your Grub Menu. In that case, follow the same instructions as above, except choose the "Propose new configuration" option to have it look for your Windows installation and configure a grub entry for you. After doing that have YaST restore the MBR of your hard disk.
 
Old 01-07-2007, 03:12 PM   #4
Mohrravvian
LQ Newbie
 
Registered: Jan 2007
Location: USA
Distribution: openSuSE 10.2
Posts: 13

Original Poster
Rep: Reputation: 0
Hi. Thanks for the advice! I tried what you said, and it didn't work. I tried some other options as well. (Also, FYI, I installed Linux into a system where XP was already installed). A got a recommendation to try disconnecting the SATA drive, then redo the boot config and see if it would get the IDE to boot at all. I did that, and then I got this message:

ISOLINUX: DISK ERROR 01, AX=0201, DRIVE 80

Anyone know what this means? Any help would be appreciated!

I also tried doing the "repair system" option from the boot CD, redoing the boot loader that way... no change.

Thanks for the help, hopefully someone will know what this means!

Mohrravvian
 
Old 01-07-2007, 03:50 PM   #5
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
I got a feeling your Sata is in front of the booting queue and placing Grub in second disk hda would be a waste of time.

To check it ----------------

While in Suse, as you can boot it up by installation CD, invoke a Grub shell and check the partitions of 1st disk (hd0) and 2nd disk (hd1) by the geometry command
Code:
sudo grub
geometry (hd0)
geometry (hd1)
If Windows xp is in the 1st disk (hd0) it must have a partition type No 0x7.

Linux on the other hand has Type 0x83 and the swap will have 0x82.

The cure -------------

Once you are satisfied that (hd0) holds XP and Suse is in (hd1), assuming its /boot is in the 1st partition then you can put Suse's Grub in the MBR by
Code:
root (hd1,0)
setup (hd0)
quit
On a reboot you shall see Grub booting Suse and Windows.
 
Old 01-07-2007, 05:28 PM   #6
Mohrravvian
LQ Newbie
 
Registered: Jan 2007
Location: USA
Distribution: openSuSE 10.2
Posts: 13

Original Poster
Rep: Reputation: 0
OK. I ran the "sudo grub" and "geometry" command. I still have my SATA drive disconnected, so my IDE drive comes up as hd0. This is what it said:

grub> geometry (hd0)
drive 0x80: C/H/S = 30394/255/63, The number of sectors = 488281250, /dev/hda
Partition num: 0, Filesystem type unknown, partition type 0x7
Partition num: 4, Filesystem type is fat, partition type 0xc
Partition num: 5, Filesystem type is reiserfs, partition type 0x83
Partition num: 6, Filesystem type unknown, partition type 0x82

I have a couple of questions regarding the second set of commands that you suggested:

root (hd1,0) (What does this command do?)
setup (hd0) (What does this command do?)

The reason I ask is that the NTFS portion of the IDE drive has all of my files, music, documents, etc, which I don't want to jeopadize at all. The SATA drive only has Windows system files and programs, all personal data is stored on the IDE drive in the NTFS partition (which is partition num: 0 above).

I just want to make sure that this won't damage, corrupt or otherwise mess up my NTFS partition on my IDE drive, as I do not want to lose that data. If you could explain a little further, I'd really appreciate it.

Also, what if I wanted to keep the SATA drive disconnected, and just get the IDE drive to boot right now? How would I do that?

Thanks for the help!

Mohrravvian
 
Old 01-07-2007, 05:55 PM   #7
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
Booting is the simplest thing on earth as far as Grub is concerned.

You specify the partition where the kernel is held. Grub just goes there, loads up the kernel to pass the control over and buggers off for its long lunch break.

The "root" points out the partition where /boot is and Grub's files are always inisde the subdirectory /boot/grub. Thus "root (hd1,0)" mean the root of the Linux is in the 1st partition of the 2nd disk as Grub counts from 0.

The command "Setup (hd0)" instructs Grub to set itself up in the whole of disk (hd0) and that means the MBR, basically to "source" all the necessary files from the root directory already specified by the previous root statement.

You cannot remove or alter the disk order now because the Linux has a record of how it was installed. You should put back the Sata disk in the order when Linux and Windows were installed.

If your XP was the 1st disk and Linux the 2nd disk then you can fire up the Linux manually in a Grub prompt by (requires two disks present)
Code:
root (hd1,4)
configfile /boot/grub/menu.lst
because you last post confirms only one Linux partition in hda5.

Similarly in the Grub prompt to fire up Windows, assuming it is in the first partition, would require commands
Code:
root (hd0,0)
chainloader +1
boot
You will not be able to damage your partitions as long you do not write on them, format them or resize them. You should keep a copy of the partition table too as a complete destruction of it will NOT touch any of the data inside. However to rebuild the partition table you need a record of it. In that respect the output of "fdisk -l" is something you should keep a copy of.
 
Old 01-07-2007, 06:23 PM   #8
pusrob
Member
 
Registered: Jan 2006
Distribution: Gentoo
Posts: 505

Rep: Reputation: 36
Hello Mohrravvian!

The "root (hd1,0)" command specifies the system partition for grub. If you check your menu.lst file in /boot/grub/ , you will see. The hd1,0 means, that the system (Linux) is on the second HDD, and there on the first partition. When you removed the SATA drive, your second disc became the first one, so grub doesn't know what to boot on your second hard drive (which now doesn't exist). So try typing root (hd0,0). Boot up SuSE with CD, check the menu.lst file, copy the commands to a paper (3 lines, starts with "hd1,0" ends with "boot"). Restart comp, wait until grub menu shows up, press button "c"
on the keyboard (grub command line shows up), type in the commands written out to the paper (type the correct hd0,0!), and it should now boot.
If you don't install GRUB to SATA:
If you reconnect your SATA drive, and you installed grub to the PATA dive, than you will need another bootloader, like GAG. You can find it on the UBCD (ultimate boot cd, http://www.ultimatebootcd.com/). Download iso (basic or full), boot from it, search for gag, config it, install). GAG is very great, becouse it can be configured any time, without the UBCD. The config (Setup) is always accessible when GAG shows up, so you can change it any time.
If you install GRUB to SATA:
config it to the right drives (in menu.lst). For Win XP you can try these commands (I have XP on FAT32, so I'm not sure, it is worth a try):
Quote:
rootnoverify (hd0,0)
chainloader +1
boot
This is for win on first HDD, first partition. Correct as needed!
NOTICE!: You should do these to your own risk! If you find it too difficult, try something else. I have the two bootloader solution (GAG+GRUB) here at home, and it works.

Last edited by pusrob; 01-07-2007 at 06:25 PM.
 
Old 01-07-2007, 08:37 PM   #9
Mohrravvian
LQ Newbie
 
Registered: Jan 2007
Location: USA
Distribution: openSuSE 10.2
Posts: 13

Original Poster
Rep: Reputation: 0
saikee,

Thank you for the help. I am still a little confused though (sorry!), I have a question. Maybe you can confirm if I have this right:

To fix the entire thing, I need to do the following:

Plug the SATA drive back in.
Boot into Linux via the CD
From Konsole, run:
sudo grub
root (hd1,4)
configfile /boot/grub/menu.lst
setup (hd0)

root (hd0,0)
chainloader +1
boot
quit

This assumes that the SATA is hd0 and the IDE drive is hd1. It also assumes that windows XP is on the first partition on the SATA drive (this is correct).

Is this the right order and method to fix the issue? Sorry to have to keep asking, but I am very new to linux! Thanks again for the help!

Mohrravvian

Last edited by Mohrravvian; 01-07-2007 at 08:42 PM.
 
Old 01-08-2007, 02:26 AM   #10
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
I could be confusing you with the commands to boot up Suse and Windows manually in order to demonstrate how easy it is to boot.

In your case you can boot to Suse by CD, right?

ALl you need is to restore Grub in the MBR. My post #5 is therefore still applicable but now your Suse partition has been confirmed in partition 5 (Grub's convention as it includes partition 0 too). Therefore the root of Suse is at (hd1,5).

To "source" the Grub information and install Grub in the whole of the 1st disk (hd0), which is the MBR, while you are inside Suse should be
Code:
root (hd1,5)
setup (hd0)
quit
Grub should then check if stage1, stage1.5 and stage2 available and report success. Therefore you will have no need for the installation CD for booting.

Last edited by saikee; 01-08-2007 at 02:28 AM.
 
Old 01-09-2007, 08:43 PM   #11
Mohrravvian
LQ Newbie
 
Registered: Jan 2007
Location: USA
Distribution: openSuSE 10.2
Posts: 13

Original Poster
Rep: Reputation: 0
GRUB READ ERROR

That's the message I'm getting now... XP doesn't boot and GRUB doesn't load either.

What I found was that the SATA drive (with XP), once reconnected, was placed at hd1, instead of hd0. So, I altered your root command from (hd1,5) to (hd0,5), because linux is on hd0.

So, anyway, I'm not sure what is wrong... My menu.lst file looks like this:

PHP Code:
# Modified by YaST2. Last modification on Tue Jan  9 21:36:06 EST 2007
default 0
timeout 8
gfxmenu 
(hd0,5)/boot/message

###Don't change this comment - YaST2 identifier: Original name: linux###
title openSUSE 10.2
    root 
(hd0,5)
    
kernel /boot/vmlinuz root=/dev/hda6 vga=0x31a resume=/dev/hda7 splash=silent showopts
    initrd 
/boot/initrd

###Don't change this comment - YaST2 identifier: Original name: windows###
title Windows
    rootnoverify 
(hd0,0)
    
chainloader (hd1,0)+1

###Don't change this comment - YaST2 identifier: Original name: failsafe###
title Failsafe -- openSUSE 10.2
    root 
(hd0,5)
    
kernel /boot/vmlinuz-2.6.18.2-34-default root=/dev/hda6 vga=normal showopts ide=nodma apm=off acpi=off noresume nosmp noapic maxcpus=0 edd=off 3
    initrd 
/boot/initrd-2.6.18.2-34-default 
The grub.conf is:

PHP Code:
setup --stage2=/boot/grub/stage2 (hd0) (hd0,5)
quit 
The geometry for the 2 drives is as such:

PHP Code:
grubgeometry (hd0)
drive 0x80C/H/30394/255/63The number of sectors 488281250, /dev/hda
   Partition num
0,  Filesystem type unknownpartition type 0x7
   Partition num
4,  Filesystem type is fatpartition type 0xc
   Partition num
5,  Filesystem type is reiserfspartition type 0x83
   Partition num
6,  Filesystem type unknownpartition type 0x82

grub
geometry (hd1)
drive 0x81C/H/30401/255/63The number of sectors 488397168, /dev/sda
   Partition num
0,  Filesystem type unknownpartition type 0x7 
I'm not sure what to do now... is this fixable?

Thanks for the help....

Mohrravvian
 
Old 01-10-2007, 02:53 AM   #12
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
I know how to fix your Grub but not too sure about your hand.

Here is what you need to fire up the two systems

(1) Chop off the hand that did the plugging and unplugging of the hard disks so that the disk order cannot confuse the two operating systems. I can now assume the Sata disk is fixed in the 2nd position of the booting queue.

(2) Boot up Suse by CD or the way you know how

(3) Edited the menu.lst with the bits marked red as follow
Code:
# Modified by YaST2. Last modification on Tue Jan  9 21:36:06 EST 2007
default 0
timeout 8
#gfxmenu (hd0,5)/boot/message

###Don't change this comment - YaST2 identifier: Original name: linux###
title openSUSE 10.2
    root (hd0,5)
    kernel /boot/vmlinuz root=/dev/hda6 vga=0x31a resume=/dev/hda7 splash=silent showopts
    initrd /boot/initrd

###Don't change this comment - YaST2 identifier: Original name: windows###
title Windows
    rootnoverify (hd1,0)
    makeactive
    map (hd0) (hd1)
    map (hd1) (hd0)
    chainloader +1

###Don't change this comment - YaST2 identifier: Original name: failsafe###
title Failsafe -- openSUSE 10.2
    root (hd0,5)
    kernel /boot/vmlinuz-2.6.18.2-34-default root=/dev/hda6 vga=normal showopts ide=nodma apm=off acpi=off noresume nosmp noapic maxcpus=0 edd=off 3
    initrd /boot/initrd-2.6.18.2-34-default
The first # is optional but I suggest you do it as it will give you a Grub prompt, for using Grub without Suse booted if you still have a problem. You can always delete it later to restore the graphic at the boot screen.

Learn to use the two map statements that cause you a hand. It is Grub that makes your hand redundant.

(4) Save the file and issue the follow command in terminal
Code:
grub-install /dev/hda
(5) Try to boot both systems on a reboot. If OK then get a doctor to attend the chopped off hand.
 
Old 01-10-2007, 04:30 AM   #13
jpaulson
LQ Newbie
 
Registered: Dec 2006
Distribution: Fedora
Posts: 9

Rep: Reputation: 0
Similar but slightly different problem

HI, I don't want to hijack or confuse this thread so I could move this question to a new thread. But I have a very similar problem.

Summary
My system has XP on the master disk and Fedora FC6 on the slave to which I have added Suse 10.1 and have now found that Suse appears to have modified the MBR on the master ( Windows ) disk as well as on the slave.

Objective
I want (need) to return the MBR on the Windows disk to its virgin state.

History
To my original XP system I installed FC6 on the slave and found that this failed to boot since FC6 appeared to have left the MBR (Windows hd0) untouched and Windows booted every time. I was happy to use the spoofing technique described by saikee in JustLinux and here to solve the problem. Briefly......Place the /boot directory of FC6 in a partition in the first cylinders of the slave disk. In the BIOS, promote the slave disk ahead of the master as first boot device. To regain access to XP I used the remap technique ( map hd0 to hd1 and vice versa ).
I then installed Suse 10.1 in a previously unused section of the slave. This gave me Suse but the Windows option did not work so I added the remap thing into menu.lst to fix that. I also had to add the instructions to find and boot FC6, everything worked so far.

The Problem
When I reset the BIOS boot order to master first and slave second I found that XP or Suse will no longer boot directly (Grub error 15). Also if I disconnect the original master drive and use the second slave disk as a master drive it won't boot to up (Grub error 13). It appears to me that Suse has set up the slave as the primary boot device and also modified the MBR of the windows drive.

Now I have ended up with two Linux distros across a whole bag of partitions on the slave which I want to rebuild from scratch inside another chassis and want to get the master (XP) disk back to its virgin state.

Can u elp please?
JP
ps. Yes I know! too many hands and too many fingers.
 
Old 01-10-2007, 05:28 AM   #14
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
jpaulson.

I think you are better off with a separate thread if following doesn't work out.

When you have the two systems of XP & FC6 you arranged the FC6 disk as the first in the booting queue. The MBR is therefore in the slave disk housing FC6. XP was installed in the first disk and it could boot as the 2nd disk only because you use Grub to swap the disk on-the-fly with the two map statements every time XP was selected. The disk order reverts back to FC6 disk being the first bootable on exit of XP. Everything works fine.

In the installation of Suse you could have installed Suse the normal way but tell the installer to keep its boot loader "in the root partition". This way you would be able to boot Suse from the Fedora. If the root partition of Suse is in say hda6 then these 3 lines inside Fedora's /boot/grub/grub.conf will firs it up
Code:
title my Suse in hda6 known to Grub as (hd0,5)
root (hd0,5)
chainloader +1
I believe you might have allowed Suse's installer to take over the MBR of your slave which was the first bootable disk and things got confused if you ignore the disk order to boot any of them, like unplugging the disks. May be I should recommend the hand chopped off too?

My suggestion for the cure--------------------------------------------

Go back to the original position of having the slave as the first bootable disk. You can use any Linux, either from a boot up Suse or any Live CD, to restore FC6's boot loader into the MBR (Task B4 or B5 of the last link in my signature refer).

You then edit FC6's Grub to include Suse for booting as suggested above.

If you understand what has gone wrong you are already half way there.

Good Luck.
 
Old 01-10-2007, 07:14 PM   #15
Mohrravvian
LQ Newbie
 
Registered: Jan 2007
Location: USA
Distribution: openSuSE 10.2
Posts: 13

Original Poster
Rep: Reputation: 0
saikee...

Well, I executed the commands you suggested. It appeared to work well in SuSE (the grub-install command said "no errors"), but then it still said "GRUB read error" when I rebooted, and I had to use the CD again to get back to SuSE.

Any thoughts?

I did notice that after the reboot, the menu.lst file is not the same as how i saved it. The windows section looks like this:

Code:
###Don't change this comment - YaST2 identifier: Original name: windows###
title Windows
    rootnoverify (hd0,0)
    makeactive
    map (hd0) (hd1)
    map (hd1) (hd0)
    chainloader (hd1,0)+1
However, what I entered was exactly what you wrote in your previous post:

Code:
###Don't change this comment - YaST2 identifier: Original name: windows###
title Windows
    rootnoverify (hd1,0)
    makeactive
    map (hd0) (hd1)
    map (hd1) (hd0)
    chainloader +1
So, it seems to have included some of the code you gave me, but rewritten some of it. I am not sure if YaST did this, or what happened. But, I would think that would only affect how windows boots, and not prevent GRUB from starting.

So, I am not sure what the problem is... hopefully you can make sense of it! Thanks again.

Mohrravvian
 
  


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
Problem with Boot up loader blackman890 Mandriva 1 04-09-2005 07:12 PM
problem with boot loader makaveli0129 Mandriva 1 11-01-2004 11:20 PM
boot loader Problem sashhoney Linux - Newbie 0 07-24-2003 02:33 AM
boot loader problem rzee Linux - Newbie 12 02-14-2003 11:49 AM
boot loader problem.. rzee Linux - General 1 02-13-2003 01:43 PM

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

All times are GMT -5. The time now is 06:07 PM.

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