LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   SUSE / openSUSE (https://www.linuxquestions.org/questions/suse-opensuse-60/)
-   -   Grub problems after installing second hard disk and SuSE11.0 (https://www.linuxquestions.org/questions/suse-opensuse-60/grub-problems-after-installing-second-hard-disk-and-suse11-0-a-657950/)

HellesAngel 07-24-2008 08:03 AM

Grub problems after installing second hard disk and SuSE11.0
 
This should have been a simple upgrade but 2 days later I'm still fighthing. I hope someone can help. I have a computer that had Windows and SuSE10.0 on SATA disk sda, and I added a new SATA disk sdb and installed SuSE11.0 on this thinking it would be the easiest way to triple boot.

I think the important information for debugging is this:
Code:

hefty:/ # fdisk -l

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

  Device Boot      Start        End      Blocks  Id  System
/dev/sda1              1        3824    30716248+  7  HPFS/NTFS
/dev/sda2            3825        3955    1052257+  82  Linux swap / Solaris
/dev/sda3  *        3956      19456  124511782+  83  Linux

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

  Device Boot      Start        End      Blocks  Id  System
/dev/sdb1              1        2611    20972826  83  Linux
/dev/sdb2            2612      60801  467411175  83  Linux

Then for Grub:
Code:

hefty:/ # cat /boot/grub/device.map
(hd0)  /dev/sda
(hd1)  /dev/sdb

And
Code:

hefty:/ # cat /boot/grub/menu.lst
# Modified by YaST2. Last modification on Thu Jul 24 17:24:17 CEST 2008

color white/blue black/light-gray
default 0
timeout 8
gfxmenu (hd0,2)/boot/message

###Don't change this comment - YaST2 identifier: Original name: linux###
title SUSE LINUX 10.0
    root (hd0,2)
    kernel /boot/vmlinuz root=/dev/sda3 vga=0x31a selinux=0    resume=/dev/sda2  splash=silent showopts
    initrd /boot/initrd

###Don't change this comment - YaST2 identifier: Original name: openSUSE 11.0 (/dev/sdb1)###

title openSUSE 11.0 (/dev/sdb1)
    root (hd1,1)
    kernel (hd1,1)/boot/vmlinuz-2.6.25.5-1.1-default root=/dev/disk/by-id/scsi-SATA_SAMSUNG_HD502IJS13TJ1CQ301928-part1 vga=0x31a resume=/dev/sda2 splash=silent showopts

###Don't change this comment - YaST2 identifier: Original name: SUSE LINUX 10.0 (/dev/sda3) (/dev/sdb1)###

title SUSE LINUX 10.0 (/dev/sda3) (/dev/sdb1)
    rootnoverify (hd1,0)
    chainloader (hd0,2)+1

###Don't change this comment - YaST2 identifier: Original name: Windows (/dev/sdb1)###

title Windows (/dev/sdb1)
    rootnoverify (hd1,0)
    chainloader (hd0,0)+1

###Don't change this comment - YaST2 identifier: Original name: Failsafe -- openSUSE 11.0 (/dev/sdb1)###

title Failsafe -- openSUSE 11.0 (/dev/sdb1)
    kernel (hd1,0)/boot/vmlinuz-2.6.25.5-1.1-default root=/dev/disk/by-id/scsi-SATA_SAMSUNG_HD502IJS13TJ1CQ301928-part1 vga=0x31a showopts ide=nodma apm=off acpi=off noresume nosmp noapic maxcpus=0 edd=off x11failsafe
    initrd (hd1,0)/boot/initrd-2.6.25.5-1.1-default

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

###Don't change this comment - YaST2 identifier: Original name: failsafe###
title Failsafe -- SUSE LINUX 10.0
    root (hd0,2)
    kernel /boot/vmlinuz root=/dev/sda3 vga=normal showopts ide=nodma apm=off acpi=off noresume selinux=0 nosmp noapic maxcpus=0 edd=off  3
    initrd /boot/initrd

###Don't change this comment - YaST2 identifier: Original name: 2.6.13-15.18-smp###

title 2.6.13-15.18-smp
    root (hd0,2)
    kernel /boot/vmlinuz-2.6.13-15.18-smp root=/dev/sda3 vga=0x31a selinux=0 resume=/dev/sda2  splash=silent showopts
    initrd /boot/initrd-2.6.13-15.18-smp

The SuSE11.0 boot lines were merged by Yast from the installation of SuSE11 on sdb.

I've been through various stages of not booting, now at least my computer boots to the old 10.0 and Windows OK, but any attempt to boot to SuSE11.0 results in a Grub error 25 and the opportunity to reboot to something else.

The problem probably lies in either the way Grub is installed on sdb or in the magic (x,y) values in menu.lst, but I'm fumbling in the dark. Can anyone help? Thanks in advance.

df6269 07-24-2008 08:26 AM

Did you try following command on /dev/sdb1 --> openSUSE 11 right?
#grub-install

HellesAngel 07-24-2008 09:02 AM

Booted from the SuSE11 live CD that just brings up the Yast Boot Loader Settings page and then I'm not sure what to do next. I tried the Grub console but don't know what to do.

Meanwhile with some fiddling about with the boot command lines I've determined that Grub is not happy with anything on sdb and does not like 'root (hd1,0)' or any version of this command, returning an error 25 'Can't read disk' or similar. It seems something is missing there...

Thanks for the suggestion.

yancek 07-24-2008 12:28 PM

Are you able to boot opensuse 11 in failsafe mode? You have an entry for failsafe in the menu.lst with (hd1,0) while your regular opensuse has (hd1,1). At the grub prompt from opensuse 10.0, do "geometry (hd0) to get info the run the following commands consecutively: 'find /sbin/init' and then 'find /boot/vmlinuz' to see if these files are there. Leave the quotes off and there is a space after 'find'.

You could try commenting out the title entry for each stanza and rebooting to see which works and remove the incorrect entries. Put a hash mark (#)to the left of title.

HellesAngel 07-25-2008 05:46 AM

Thanks for the suggestions. None of the openSuSE 11.0 boots on sdb work, none at all, they don't get past Grub stage 1.5. The results (booted to SuSE10) are:

Code:

grub> geometry (hd0)
drive 0x80: C/H/S = 19457/255/63, The number of sectors = 312581808, /dev/sda
  Partition num: 0,  Filesystem type unknown, partition type 0x7
  Partition num: 1,  Filesystem type unknown, partition type 0x82
  Partition num: 2,  Filesystem type is reiserfs, partition type 0x83

grub> find /sbin/init
 (hd0,2)

grub> find /boot/vmlinuz
 (hd0,2)

grub> geometry (hd1)
drive 0x81: C/H/S = 60801/255/63, The number of sectors = 976773168, /dev/sdb
  Partition num: 0,  Filesystem type is ext2fs, partition type 0x83
  Partition num: 1,  Filesystem type is ext2fs, partition type 0x83

Is it right that sdb, with SuSE11.0 on it, is ext2fs on both partitions? There should also be an /sbin/init and /boot/vmlinuz on sdb but how to find where they are?

After an unsuccessful boot the computer returns to a grub menu which allows the entries to be edited and tried easily, however I've found nothing that works from the SuSE11 installation - each returns a grub error 25.

Thanks for your help.

yancek 07-25-2008 11:07 AM

You have two Linux partitions on sdb? My Opensuse (10.3) also shows as ext2fs when I run geometry command. You only have a vmlinuz and initrd file on the third partition of the first drive and you will be unable to boot the Opensuse 11.0 on the second drive without them. That is definitely part of the problem. When you do the 'find' command in Grub for /sbin/init and /boot/vmlinuz it should find these files on whatever number of drives/partitions you have.

Do you have anything on sdb2 or just formatted? The kernel/initrd files were not installed for some reason? Since you have nothing installed on sdb (right) the easiest thing to do would be to re-install 11.0 to sdb1.

Before doing that, you could try to see if the Opensuse 11 files are there.Log on to 10.0 as root, create a directory: mkdir /mnt/opensuse11,
then try to mount it (as root): mount -t ext2 /dev/sdb1 /mnt/opensuse11,
if this shows no errors run: cd /mnt/opensuse11, then: ls -l, see if there are any results. If you can see files, then your original install was mostly successful. However, without the initrd and vmlinuz files in the /boot directory, nothing will boot.

Luck!

HellesAngel 07-27-2008 03:23 AM

Thanks for the tips - I think the openSuSE11 installation was mostly successful, at least sdb1 has all the files it's supposed to have, including /boot/vmlinuz and /sbin/init. sdb2 also contains the same, the result of another install experiment I'd guess.

Code:

toby@hefty:~> su
Password:
hefty:/home/toby # mkdir /mnt/opensuse11
hefty:/home/toby # mount -t ext2 /dev/sdb1 /mnt/opensuse11
hefty:/home/toby # cd /mnt/opensuse11
hefty:/mnt/opensuse11 # ls boot/vmlinuz
boot/vmlinuz
hefty:/mnt/opensuse11 # ls sbin/init
sbin/init

The problem seems to be something in Grub, that it doesn't know that there's a bootable partition on sdb1, or that the partition isn't bootable for some reason.

What I'm thinking of now is deleting all partitions on sdb, removing sda (unplugging it), doing a full clean install on sdb as whatever drive it appears as, then putting sda back and merging the Grub configurations from the two. Is this likely to work or make things worse? Can you think of anything during the openSuSE11 install process that I should make sure to select?

It seems something isn't quite configured or installed correctly during Yast's best guess automatic installation from the live CD, but so far I have no idea what.

yancek 07-27-2008 12:47 PM

I'm not sure what you were doing with these commands "ls boot/vmlinuz" and "ls sbin/init". You need to do "ls /boot/ to see what files are in the /boot directory. Try running these commands again sequentially (as root):
toby@hefty:~> su
Password:
hefty:/home/toby # mkdir /mnt/opensuse11
hefty:/home/toby # mount -t ext2 /dev/sdb1 /mnt/opensuse11
hefty:/home/toby # cd /mnt/opensuse11
hefty:/home/toby # ls /boot/

See if you get results from this. Then run them again changing the 'sdb1' above to /sdb2' and see what results you get. This is to see if you have the vmlinuz and initrd files in the /boot directory, same as the geometry command in grub. I don't think they are there. Try these and let us know results. You should have this: vmlinuz-2.6.25.5-1.1-default, as well as an initrd file w/same numbers. These are listed in your menu.lst for 11.0 and it's strange they are not there when you do the 'find /boot/vmlinuz?

HellesAngel 07-28-2008 09:45 AM

Hi yancek, now you've confused me a little... If Opensuse11 is mounted on /mnt/opensuse11 then the command 'ls /boot/' will give me the contents of the local disk, not the disk mounted in /mnt/opensuse11.

Anyway, both appear to give the expected results:

Code:

toby@hefty:~> su
Password:
hefty:/home/toby # mkdir /mnt/opensuse11
hefty:/home/toby # mount -t ext2 /dev/sdb1 /mnt/opensuse11
hefty:/home/toby # cd /mnt/opensuse11
hefty:/mnt/opensuse11 # ls /boot/
.                        initrd-2.6.13-15.18-smp
..                      message
backup_mbr              symvers-2.6.13-15.18-i386-smp.gz
boot                    System.map-2.6.13-15.18-smp
config-2.6.13-15.18-smp  vmlinux-2.6.13-15.18-smp.gz
grub                    vmlinuz
initrd                  vmlinuz-2.6.13-15.18-smp
hefty:/mnt/opensuse11 # ls boot
.                            message
..                          symsets-2.6.25.5-1.1-default.tar.gz
backup_mbr                  symtypes-2.6.25.5-1.1-default.gz
boot                        symvers-2.6.25.5-1.1-default.gz
config-2.6.25.5-1.1-default  System.map-2.6.25.5-1.1-default
grub                        vmlinux-2.6.25.5-1.1-default.gz
initrd                      vmlinuz
initrd-2.6.25.5-1.1-default  vmlinuz-2.6.25.5-1.1-default
memtest.bin

I conclude that (hd1,0) (sdb1) contains the correct stuff, but Grub is not happy. I created a Supergrub boot CD and cannot get that to extract any sense from sdb1's content, always returning a 'disk read error'. Helpfully it doesn't say what part of the disk can't be read.

From Grub (running booted to SuSE10.0 from the sda2 partition), I'd expect different results from this:
Code:

grub> root (hd1,0)
 Filesystem type is ext2fs, partition type 0x83

grub> setup (hd1)
 Checking if "/boot/grub/stage1" exists... no
 Checking if "/grub/stage1" exists... no

Error 2: Bad file or directory type

grub> geometry (hd1)
drive 0x81: C/H/S = 60801/255/63, The number of sectors = 976773168, /dev/sdb
  Partition num: 0,  Filesystem type is ext2fs, partition type 0x83
  Partition num: 1,  Filesystem type is ext2fs, partition type 0x83

The setup command is clearly not understanding the contents of this disk, as the files are there. Could the disk be defect in some way?

From the configuration files, which I am now starting to understand a little more, everything looks good but I'm suspicious there's no mention of hd1 in /etc/grub.conf:
Code:

setup --stage2=/boot/grub/stage2 (hd0,2) (hd0,2)
setup --stage2=/boot/grub/stage2 (hd0) (hd0,2)
quit

Any further ideas?

yancek 07-28-2008 06:14 PM

My mistake. I forgot to ask you to use the forward slash (/) at the end of this command: hefty:/home/toby # cd /mnt/opensuse11, it should be:
hefty:/home/toby # cd /mnt/opensuse11/

I changed directories on my computer to my opensuse and ran the command:
ls boot, which showed my opensuse /boot files. So the results of the first command: hefty:/home/toby # cd /mnt/opensuse11
hefty:/mnt/opensuse11 # ls /boot/

show the /boot files for opensuse 10 (I think that's what you were running from?)

The results of the second command: hefty:/mnt/opensuse11 # ls boot

show the /boot files for opensuse 11.
What this means is that your initrd and vmlinuz (kernel) files are there on sdb1. If you are booting from Kubuntu or Opensuse 10, don't worry if the stage1 file is in Opensuse 11, doesn't matter.

You have three OS's on the computer but I'm not sure which you are booting from as you have changed? Although each distro will have the stage1, stage2, etc. files, these files are only used from one of the distros. If you are booting from Kubuntu you need the stanzas (entries) for each OS in the Kubuntu menu.lst, if you are booting from opensuse 10, you need correct entries in the opensuse 10 menu.lst.

Post back w/results.

HellesAngel 07-29-2008 02:11 AM

Many thanks for your continued support... I've been tracking a similar thread on another board where the guy having trouble gave up and used LILO.

From appearances it seems that when my computer boots it finds the Grub installed with SUSE10.0. The three installed OS are:
sda1 Windows 2000
sda3 SUSE Linux 10.0
sdb1 openSUSE Linux 11.0

Usually the PC boots to SuSE10.0 which I've been using for some years, other possibilities available to me now are the openSUSE11.0 live CD or the 'Super'Grub CD.

When booted to SUSE10.0 the /boot/grub/menu.lst contains:

Quote:

hefty:/home/toby # cat /boot/grub/menu.lst
# Modified by YaST2. Last modification on Sun Jul 27 21:35:46 CEST 2008

color white/blue black/light-gray
default 0
timeout 8
gfxmenu (hd0,2)/boot/message

###Don't change this comment - YaST2 identifier: Original name: linux###
title SUSE LINUX 10.0
root (hd0,2)
kernel /boot/vmlinuz root=/dev/sda3 vga=0x31a selinux=0 resume=/dev/sda2 splash=silent showopts hdc=ide-scsi hdd=ide-scsi
initrd /boot/initrd

###Don't change this comment - YaST2 identifier: Original name: openSUSE 11.0 (/ dev/sdb1)###

title openSUSE 11.0 (/dev/sdb1)
kernel (hd1,0)/boot/vmlinuz-2.6.25.5-1.1-default root=/dev/disk/by-id/scsi-S ATA_SAMSUNG_HD502IJS13TJ1CQ301928-part1 vga=0x31a resume=/dev/sda2 splash=silent showopts
initrd (hd1,0)/boot/initrd-2.6.25.5-1.1-default

###Don't change this comment - YaST2 identifier: Original name: Failsafe -- open SUSE 11.0 (/dev/sdb1)###

title Failsafe -- openSUSE 11.0 (/dev/sdb1)
kernel (hd1,0)/boot/vmlinuz-2.6.25.5-1.1-default root=/dev/disk/by-id/scsi-S ATA_SAMSUNG_HD502IJS13TJ1CQ301928-part1 vga=0x31a showopts ide=nodma apm=off acp i=off noresume nosmp noapic maxcpus=0 edd=off x11failsafe
initrd (hd1,0)/boot/initrd-2.6.25.5-1.1-default

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

###Don't change this comment - YaST2 identifier: Original name: failsafe###
title Failsafe -- SUSE LINUX 10.0
root (hd0,2)
kernel /boot/vmlinuz root=/dev/sda3 vga=normal showopts ide=nodma apm=off ac pi=off noresume selinux=0 nosmp noapic maxcpus=0 edd=off 3
initrd /boot/initrd

###Don't change this comment - YaST2 identifier: Original name: 2.6.13-15.18-smp ###

title 2.6.13-15.18-smp
root (hd0,2)
kernel /boot/vmlinuz-2.6.13-15.18-smp root=/dev/sda3 vga=0x31a selinux=0 resume=/dev/sda2 splash=silent showopts
initrd /boot/initrd-2.6.13-15.18-smp
Could it need a chainloader command of some sort? As I understand it this tells grub to move on to another boot loader to get an OS started but I don't understand it 100%.

When I select to boot openSUSE 11.0 the execution gets as far as the kernel command and returns an 'Error 25: Disk read error' which when I then play around with Grub is returned for every command to do with sdb1. I'm starting to conclude that Grub has issues with SATA disks, or something in my computer, and switching to LILO is the sensible solution.

Edit: For a risky experiment I used Yast to install LILO as boot loader and still the system wouldn't start from sdb1 so I reverted to Grub. Perhaps the next step is to unplug sda and install openSUSE 11.0 on 'sdb' when it's alone in the PC and see what happens. Equally defeatist would be to back up sda to sdb, create a new partition on sda and install openSUSE 11.0 there and then move home to sdb later.

aus9 07-29-2008 03:16 AM

ok I will jump in here to add to the confusion. If you want to try lilo go ahead....sob

I gather sdb linux opensuse was installed last?

can you remember if you installed its grub to mbr or the the root partition on sdb1?

2) leaping ahead....if you have a good live cd...you can redo grub into mbr and choose which menu to use....I suggest the one on sda

root (hd0,2)
setup (hd0)
....and if last line contains "succeeded"
quit

HellesAngel 07-29-2008 04:02 AM

That's correct. sdb is new and the idea was to use it with a clean install of openSUSE 11.0 until I had re-installed all applications from SUSE 10.0, then wipe the SUSE 10.0 installation.

I'm not sure if there's an MBR on sdb, but there's certainly one on sda as that's where the PC usually boots. The three commands you suggest work fine as you suggest, however running the same when booted to SUSE 10.0 on sdb:

Code:

grub> root (hd1,0)
 Filesystem type is ext2fs, partition type 0x83

grub> setup (hd1)
 Checking if "/boot/grub/stage1" exists... no
 Checking if "/grub/stage1" exists... no

Error 2: Bad file or directory type

which is odd because those files are actually on that disk in the locations specified. If I mount sdb1 as suggested earlier in this thread I can see those files.

HellesAngel 07-29-2008 04:11 AM

I had a look through your Grub troubleshooting pages... It seems that Grub can't make any sense of the content of sdb:

Code:

grub> root (hd1,0)
 Filesystem type is ext2fs, partition type 0x83

grub> root (hd0,2)
 Filesystem type is reiserfs, partition type 0x83

grub> find /boot/vmlinuz
 (hd0,2)

grub> root (hd1,0)
 Filesystem type is ext2fs, partition type 0x83

grub> find /boot/vmlinuz
 (hd0,2)

grub> find /boot/[PRESS TAB]
Error 2: Bad file or directory type

grub> find /boot/

Surely this can't always be so difficult?

aus9 07-29-2008 08:26 AM

hmmm

well it detects sdb1 as ext2

immediately after you typed root (hd1,0) can you try

kernel /boot/ (and press tab please)

I do not rule out the possibility its all grubs fault...heh heh but I do not use opensuse and maybe the installer has got confused?


All times are GMT -5. The time now is 02:28 PM.