LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Problem with boot record / grub (https://www.linuxquestions.org/questions/linux-newbie-8/problem-with-boot-record-grub-588587/)

rrandrews 10-01-2007 05:34 AM

Problem with boot record / grub
 
I recently installed openSUSE 10.3 on a system that was using Kubuntu and it's boot loader. openSUSE is installed on a different partition. Now I can't for the life of me get rid of the Kubuntu boot loader. I've tried using yast->bootloader in suse (I can boot the installation using an option on the install disc), uninstalling grub from kubuntu, uninstalling/reinstalling grub from suse, using the boot recovery tools on the suse disc, and using the command "bo dd if=/dev/zero of=/dev/HD count=1 bs=512".

None of these attempts have had any effect on the boot loader. This is driving me insane!

saikee 10-01-2007 05:44 AM

There is only 2 main boot loaders in Linux; Grub and Lilo.

Both Suse and Kubuntu use Grub as the standard boot loader. Thus by getting rid of Kubuntu Grub you get the same version 0.97 back in Suse, with the exception of the splash image.

A boot loader cannot be uninstalled because it is not part of a filing system. You overwrite one with another.

In any Linux with Grub you can instruct its boot loader to take over the MBR of the boot disk, say device sda by a terminal command in root console
Code:

grub-install /dev/sda
For Lilo the equivalent is
Code:

lilo -b /dev/sda
You can have 100 Linux but only one MBR. Therefore it is your right to allow any distro's boot loader to take control of the MBR by the above commands.

rrandrews 10-01-2007 05:59 AM

I'm sorry, I didn't make the problem clear.

openSUSE doesn't show up on the loader that Kubuntu installed. Prior to installing Kubuntu, I had openSUSE and Vista running fine with grub from the opensuse installation. After installing Kubuntu (same partition as suse), the boot loader was changed. Now it only has three selectionsh, all new: Kubuntu, Kubuntu repair mode, and memtest.

When I installed opensuse 10.3, I installed it on a different physical drive. After installing, the boot options remained untouched.

Anyway, system's running at automated repair thing now and I'm stuck waiting on an fsck. I'll try your suggestion when it finishes. Thanks!

saikee 10-01-2007 06:10 AM

There are loads of tips in the last link of my signature.

If you know which partition Suse is residing you can boot it now manually with Kubuntu's Grub because by pressing "c" key at the booting Kubuntu's Grub screen you get a Grub prompt, which Suse's version conceals.

Say your Suse is installed in the 5th partition (or the partition where /boot is held) it will boot in a Grub prompt by command
Code:

root (hd0,4)
configfile /boot/grub/menu.lst

To make it boot automatically in Kubuntu you just edit the Kubuntu's /boot/grub/menu.lst with the addition of the above manual command prefixing it first with a title line indicating the name of the distro, something like
Code:

title Dude say my Suse in 5th partition of 1st disk known to Grub as (hd0,4)
root (hd0,4)
configfile /boot/grub/menu.lst

Adjust the partition number to suit your circumstance. If you still have a problem post here the output of
Code:

fdisk -l
The above work for any distro that has Grub!!!!!!!!!!!!!!!!

rrandrews 10-01-2007 06:13 AM

edit: didn't see latest post

rrandrews 10-01-2007 06:34 AM

Code:

root (hd0, 0)
configfile /boot/grub/menu.lst

pulled up the openSUSE boot menu but I couldn't load anything--I got "Error 17: Cannot mount selected partition." :confused:

Here is the result of fdisk -l:

Code:

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000d84b6

  Device Boot      Start        End      Blocks  Id  System
/dev/sda1              1        2611    20972826  83  Linux
/dev/sda2  *        2612      60801  467411175  83  Linux

Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000a2a39

  Device Boot      Start        End      Blocks  Id  System
/dev/sdb1  *          1      60801  488384001    7  HPFS/NTFS

Disk /dev/sdc: 400.0 GB, 400088457216 bytes
255 heads, 63 sectors/track, 48641 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x76ebeff0

  Device Boot      Start        End      Blocks  Id  System
/dev/sdc1              1      47889  384668361  83  Linux
/dev/sdc2  *      47890      48641    6040440    5  Extended
/dev/sdc5          47890      48641    6040408+  82  Linux swap / Solaris

sda is the openSUSE installation, sdc is Kubuntu.

saikee 10-01-2007 06:35 AM

Let's be frank about this.

With Kubuntu's Grub pressing the "c" key at the Grub screen can drop you into a Grub prompt.

In a Grub prompt there is no installed Dos, Windows, Linux, BSD, Darwin and Solaris that cannot be booted manually!!!!!!!!!!!

The manual instruction you boot in a Grub prompt is the commands you need in menu.lst, with the exception "title" statement is needed in menu.lst.

Suse's menu.lst has a "gfxmenu" statement that coneals the Grub prompt. You can claim Grub prompt back by disabling the gfxmenu statement by putting a "#" in front of it.
------------------------------------------------------------------------
In your case with sda, sdb & sdc

You may have told the bios to boot the disk in an order at variant with sda, sdb and sdc. So the right thing to do is to ask Grub to tell you what it sees, by Grub prompt command
Code:

geometry (hd0)
geometry (hd1)
geometry (hd2)

From the above you will find out if (hd0) is sda or not, or asking Grub to tell you which partition/disk has menu.lst
Code:

find menu.lst
Having find the two partitions, which should be Suse and Kubunu, then you can boot either of them with the manual commands already given to you.

If you have a problem then post the 3 geometry statements output here. You can activate a Grub shell in Linux to issue the same 3 goemetry statements to post their output here. The command in a Linux root console is simply
Code:

grub
A Grub prompt is the Grub at a state "before" an operating system is booted.

A Grub shell is Grub you obtain "after" a Linux has been booted. You can't use a Grub shell to boot a system but Grub is available to carry out various tasks.

rrandrews 10-01-2007 07:41 AM

Ok, I figured it out. Or I fixed it anyway. GRUB was using the menu from hd2, I did
Code:

root (hd0, 0)
setup (hd0)

which, I guess, set it to use the drive I wanted. Also, openSUSE and the boot manager in yast was using hd1 instead of hd0 when creating the menu.lst for some reason.

Everything seems to be working OK now. Thanks!

saikee 10-01-2007 07:55 AM

Yast is a nice hardware handling program in Suse. No other Linux use Yast. Its boot loader is still Grub.

The Grub commands in your post #8 means you told Grub to "source" its Grub file from the 1st partition of the 1st disk or (hd0,0), as Grub counts from zero, and install itself in the whole of the 1st disk (hd0) which is the MBR.

It pays to understand the command if you multi-boot. In multi-boot you just boot to a partition as far as a Linux boot loader is concerned.


All times are GMT -5. The time now is 05:37 AM.