Grub dual boot error

I resized my windows c drive to make another drive which also has Open SUSE 11.4 dual booting which was working fine.

After reboot I get missing operating system so I boot the live Opensuse DVD and the windows and Linux is still there so I tried the boot configure tool in YAST but get the error because of partitioning the boot loader cannot be installed properly

Can I make a boot floppy somehow? I now have a grub menu when it boot sup but do not know what to do now any help very much appreciated

Thanks

This is normal. You need to edit /boot/grub/menu.lst since partition numbers have changed as you inserted another partition. If you moved the Linux partition containing Grub stage2, you need to reinstall Grub as well. For now, run the following command in a terminal from live CD, post its output here and we might be able to tell you how to proceed.

fdisk -l

linux:/home/linux # fdisk -l

Disk /dev/sda: 250.1 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders, total 488397168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000ce079

Device Boot Start End Blocks Id System
/dev/sda1 63 95202441 47601189+ 7 HPFS/NTFS/exFAT
/dev/sda2 160071680 164280319 2104320 82 Linux swap / Solaris
/dev/sda3 * 164280320 488396799 162058240 83 Linux
/dev/sda4 95217377 160071679 32427151+ f W95 Ext’d (LBA)
/dev/sda5 95217379 143428319 24105470+ 7 HPFS/NTFS/exFAT
/dev/sda6 143429632 156925951 6748160 83 Linux
/dev/sda7 156928000 160071679 1571840 82 Linux swap / Solaris

Partition table entries are not in disk order
linux:/home/linux #

OK. Now, which of sda3 or sda6 is your openSUSE root partition?
Do you have more than one Linux distro installed?
Why do you have 2 swap partitions? This is not needed (even if you have 5 Linux distros).
In a terminal, please mount sda3 (assuming it is openSUSE /) and show us the Grub boot menu:


su -l
mount /dev/sda3 /mnt
cat /mnt/boot/grub/menu.lst

Also show us /etc/fstab:


cat /mnt/etc/fstab

  • Please post the output whithin CODE tags.

linux@linux:~> cat /mnt/etc/fstab
/dev/disk/by-id/ata-HDT722525DLA380_VDS41DT4F8B65J-part3 swap swap defaults 0 0
/dev/disk/by-id/ata-HDT722525DLA380_VDS41DT4F8B65J-part4 / ext4 acl,user_xattr 1 1
/dev/disk/by-id/ata-HDT722525DLA380_VDS41DT4F8B65J-part1 /windows/C ntfs-3g users,gid=users,fmask=133,dmask=022,locale=en_GB.UTF-8 0 0
/dev/disk/by-id/ata-HDT722525DLA380_VDS41DT4F8B65J-part5 /windows/D ntfs-3g users,gid=users,fmask=133,dmask=022,locale=en_GB.UTF-8 0 0
proc /proc proc defaults 0 0
sysfs /sys sysfs noauto 0 0
debugfs /sys/kernel/debug debugfs noauto 0 0
devpts /dev/pts devpts mode=0620,gid=5 0 0
linux@linux:~>

I only have XP and Opensuse 11.4

OK, open /mnt/etc/fstab with kwrite or gedit (depending on the live system you’re running, kde or gnome)

kdesu /usr/bin/kwrite /mnt/etc/fstab

or

gnomesu /usr/bin/gedit /mnt/etc/fstab

and replace the content of the file with:

/dev/disk/by-id/ata-HDT722525DLA380_VDS41DT4F8B65J-part**2** swap swap defaults 0 0
/dev/disk/by-id/ata-HDT722525DLA380_VDS41DT4F8B65J-part**3** / ext4 acl,user_xattr 1 1
/dev/disk/by-id/ata-HDT722525DLA380_VDS41DT4F8B65J-part1 /windows/C ntfs-3g users,gid=users,fmask=133,dmask=022,locale=en_GB.UTF-8 0 0
/dev/disk/by-id/ata-HDT722525DLA380_VDS41DT4F8B65J-part5 /windows/D ntfs-3g users,gid=users,fmask=133,dmask=022,locale=en_GB.UTF-8 0 0
proc /proc proc defaults 0 0
sysfs /sys sysfs noauto 0 0
debugfs /sys/kernel/debug debugfs noauto 0 0
devpts /dev/pts devpts mode=0620,gid=5 0 0

I highligted the changes I have made in red.

May we see the file /mnt/boot/grub/menu.lst too?

Further I will have to ask you what’s in sda6. In that a /home partition? But show us your boot menu first, as it is more important.

Not sure whats in that partition

How do I get the boot menu up

Thanks for all your help I am learning a lot here.

We’ll check later.

sudo cat /mnt/boot/grub/menu.lst

or


su -l
cat /mnt/boot/grub/menu.lst

You need to be root (administrator) to see this file. So you have to use either sudo before the command or login in a terminal as root with the command su -l.

linux:~ # su -l
linux:~ # cat /mnt/boot/grub/menu.lst
cat: /mnt/boot/grub/menu.lst: No such file or directory
linux:~ #

Did you reboot in the meantime?
Of course you need to have the partition sda3 mounted:

su -l
mount /dev/sda3 /mnt
cat /mnt/boot/grub/menu.lst

You should be able to start firefox from livecd and post here.

linux@linux:~> su -l
linux:~ # mount /dev/sda3 /mnt
linux:~ # cat /mnt/boot/grub/menu.lst

Modified by YaST2. Last modification on Tue Apr 5 05:35:54 BST 2011

THIS FILE WILL BE PARTIALLY OVERWRITTEN by perl-Bootloader

Configure custom boot parameters for updated kernels in /etc/sysconfig/bootloader

default 4
timeout 8
##YaST - generic_mbr
gfxmenu (hd0,3)/boot/message
##YaST - activate

###Don’t change this comment - YaST2 identifier: Original name: linux###
title Desktop – openSUSE 11.4 - 2.6.37.1-1.2
root (hd0,3)
kernel /boot/vmlinuz-2.6.37.1-1.2-desktop root=/dev/disk/by-id/ata-HDT722525DLA380_VDS41DT4F8B65J-part4 resume=/dev/disk/by-id/ata-HDT722525DLA380_VDS41DT4F8B65J-part3 splash=silent quiet showopts vga=0x314
initrd /boot/initrd-2.6.37.1-1.2-desktop

###Don’t change this comment - YaST2 identifier: Original name: failsafe###
title Failsafe – openSUSE 11.4 - 2.6.37.1-1.2 (desktop)
root (hd0,3)
kernel /boot/vmlinuz-2.6.37.1-1.2-desktop root=/dev/disk/by-id/ata-HDT722525DLA380_VDS41DT4F8B65J-part4 showopts apm=off noresume nosmp maxcpus=0 edd=off powersaved=off nohz=off highres=off processor.max_cstate=1 nomodeset x11failsafe vga=0x314
initrd /boot/initrd-2.6.37.1-1.2-desktop

###Don’t change this comment - YaST2 identifier: Original name: linux###
title openSUSE 11.4 - 2.6.37.1-1.2
root (hd0,3)
kernel /boot/vmlinuz-2.6.37.1-1.2-pae root=/dev/disk/by-id/ata-HDT722525DLA380_VDS41DT4F8B65J-part4 resume=/dev/disk/by-id/ata-HDT722525DLA380_VDS41DT4F8B65J-part3 splash=silent quiet showopts vga=0x314
initrd /boot/initrd-2.6.37.1-1.2-pae

###Don’t change this comment - YaST2 identifier: Original name: failsafe###
title Failsafe – openSUSE 11.4 - 2.6.37.1-1.2 (pae)
root (hd0,3)
kernel /boot/vmlinuz-2.6.37.1-1.2-pae root=/dev/disk/by-id/ata-HDT722525DLA380_VDS41DT4F8B65J-part4 showopts apm=off noresume nosmp maxcpus=0 edd=off powersaved=off nohz=off highres=off processor.max_cstate=1 nomodeset x11failsafe vga=0x314
initrd /boot/initrd-2.6.37.1-1.2-pae

###Don’t change this comment - YaST2 identifier: Original name: linux###
title openSUSE 11.4
root (hd0,3)
kernel /boot/vmlinuz-2.6.37.1-1.2-default root=/dev/disk/by-id/ata-HDT722525DLA380_VDS41DT4F8B65J-part4 resume=/dev/disk/by-id/ata-HDT722525DLA380_VDS41DT4F8B65J-part3 splash=silent quiet showopts vga=0x314
initrd /boot/initrd-2.6.37.1-1.2-default

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

###Don’t change this comment - YaST2 identifier: Original name: floppy###
title Floppy
rootnoverify (fd0)
chainloader +1

###Don’t change this comment - YaST2 identifier: Original name: failsafe###
title Failsafe – openSUSE 11.4
root (hd0,3)
kernel /boot/vmlinuz-2.6.37.1-1.2-default root=/dev/disk/by-id/ata-HDT722525DLA380_VDS41DT4F8B65J-part4 showopts apm=off noresume nosmp maxcpus=0 edd=off powersaved=off nohz=off highres=off processor.max_cstate=1 nomodeset x11failsafe vga=0x314
initrd /boot/initrd-2.6.37.1-1.2-default
linux:~ #

I have rebooted but stil get the black screen with

GRUB>_

If sda3 is not mounted anymore (because you did reboot), open a root terminal and remount it:


su -l
mount /dev/sda3 /mnt

Then type carefully (copy/paste!) these two commands:


su -l
cp /mnt/boot/grub/menu.lst{,.bad}
sed -i 's|(hd0,3)|(hd0,2)|;s|part3|part2|;s|part4|part3|' /mnt/boot/grub/menu.lst
  • you don’t need to type su -l
    each time in a terminal, only the first time before you start your work as root.
  • If you are afraid of this command, here’s what it does in this order:
  • replace (hd0,3) with (hd0,2)
  • replace part3 with part2
  • replace part4 with part3
    • Alternatively you can open /mnt/boot/grub/menu.lst in kwrite (kdesu /usr/bin/kwrite) and apply these changes manually. But if cou can copy/paste into a terminal, the sed command should be ok.
    • Once this is done, reboot from hard disk. If you still don’t see the Grub menu, we’ll reinstall Grub in sda3. But check first if changing the menu solves the problem.

I copied and pasted the commands rebooted but still the same

Can you please show us /mnt/boot/grub/menu.lst again:

su -l
mount /dev/sda3 /mnt
cat /mnt/boot/grub/menu.lst

Please put the code in CODE tags! Use

**[noparse]

[/noparse]**
content of file
**

**


linux@linux:~> su -l
linux:~ # mount /dev/sda3 /mnt
mount: /dev/sda3 already mounted or /mnt busy
mount: according to mtab, /dev/sda3 is already mounted on /mnt
linux:~ # cat /mnt/boot/grub/menu.lst
# Modified by YaST2. Last modification on Tue Apr  5 05:35:54 BST 2011
# THIS FILE WILL BE PARTIALLY OVERWRITTEN by perl-Bootloader
# Configure custom boot parameters for updated kernels in /etc/sysconfig/bootloader

default 4
timeout 8
##YaST - generic_mbr
gfxmenu (hd0,2)/boot/message
##YaST - activate

###Don't change this comment - YaST2 identifier: Original name: linux###
title Desktop -- openSUSE 11.4 - 2.6.37.1-1.2
    root (hd0,2)
    kernel /boot/vmlinuz-2.6.37.1-1.2-desktop root=/dev/disk/by-id/ata-HDT722525DLA380_VDS41DT4F8B65J-part2 resume=/dev/disk/by-id/ata-HDT722525DLA380_VDS41DT4F8B65J-part2 splash=silent quiet showopts vga=0x314
    initrd /boot/initrd-2.6.37.1-1.2-desktop

###Don't change this comment - YaST2 identifier: Original name: failsafe###
title Failsafe -- openSUSE 11.4 - 2.6.37.1-1.2 (desktop)
    root (hd0,2)
    kernel /boot/vmlinuz-2.6.37.1-1.2-desktop root=/dev/disk/by-id/ata-HDT722525DLA380_VDS41DT4F8B65J-part2 showopts apm=off noresume nosmp maxcpus=0 edd=off powersaved=off nohz=off highres=off processor.max_cstate=1 nomodeset x11failsafe vga=0x314
    initrd /boot/initrd-2.6.37.1-1.2-desktop


###Don't change this comment - YaST2 identifier: Original name: linux###
title openSUSE 11.4 - 2.6.37.1-1.2
    root (hd0,2)
    kernel /boot/vmlinuz-2.6.37.1-1.2-pae root=/dev/disk/by-id/ata-HDT722525DLA380_VDS41DT4F8B65J-part2 resume=/dev/disk/by-id/ata-HDT722525DLA380_VDS41DT4F8B65J-part2 splash=silent quiet showopts vga=0x314
    initrd /boot/initrd-2.6.37.1-1.2-pae


###Don't change this comment - YaST2 identifier: Original name: failsafe###
title Failsafe -- openSUSE 11.4 - 2.6.37.1-1.2 (pae)
    root (hd0,2)
    kernel /boot/vmlinuz-2.6.37.1-1.2-pae root=/dev/disk/by-id/ata-HDT722525DLA380_VDS41DT4F8B65J-part2 showopts apm=off noresume nosmp maxcpus=0 edd=off powersaved=off nohz=off highres=off processor.max_cstate=1 nomodeset x11failsafe vga=0x314
    initrd /boot/initrd-2.6.37.1-1.2-pae


###Don't change this comment - YaST2 identifier: Original name: linux###
title openSUSE 11.4
    root (hd0,2)
    kernel /boot/vmlinuz-2.6.37.1-1.2-default root=/dev/disk/by-id/ata-HDT722525DLA380_VDS41DT4F8B65J-part2 resume=/dev/disk/by-id/ata-HDT722525DLA380_VDS41DT4F8B65J-part2 splash=silent quiet showopts vga=0x314
    initrd /boot/initrd-2.6.37.1-1.2-default


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


###Don't change this comment - YaST2 identifier: Original name: floppy###
title Floppy
    rootnoverify (fd0)
    chainloader +1


###Don't change this comment - YaST2 identifier: Original name: failsafe###
title Failsafe -- openSUSE 11.4
    root (hd0,2)
    kernel /boot/vmlinuz-2.6.37.1-1.2-default root=/dev/disk/by-id/ata-HDT722525DLA380_VDS41DT4F8B65J-part2 showopts apm=off noresume nosmp maxcpus=0 edd=off powersaved=off nohz=off highres=off processor.max_cstate=1 nomodeset x11failsafe vga=0x314
    initrd /boot/initrd-2.6.37.1-1.2-default
linux:~ # content of file^C
linux:~ # ^C
linux:~ # 

/dev/sda1            63      95202441    47601189+    7  HPFS/NTFS/exFAT
/dev/sda2     160071680      64280319     2104320    82  Linux swap / Solaris
/dev/sda3 *   164280320     488396799   162058240    83  Linux
/dev/sda4      95217377     160071679    32427151+    f  W95 Ext'd (LBA)
/dev/sda5      95217379      43428319    24105470+    7  HPFS/NTFS/exFAT
/dev/sda6     143429632     156925951     6748160    83  Linux
/dev/sda7     156928000     160071679     1571840    82  Linux swap / Solaris

Here are your partitions in a more readable form.
The extended partition is actually the second one from the start of the disk. I’m afraid it’s going to be fun again… :frowning:

You might have executed the command I gave you twice. The first part2 everywhere should be part3. Please correct this manually