Grub doesn't show new installation and can't boot old one

Help with issues regarding installation of Debian
Post Reply
Message
Author
zac
Posts: 48
Joined: 2010-02-19 00:35

Grub doesn't show new installation and can't boot old one

#1 Post by zac »

Hi everyone!

Once upon a time I used dual boot with Lenny and windows. Yesterday I nuked my Windows XP from the disk and installed Squeeze on that partition. I chose the option 'bootable flag on' during the installation process. Is that alright? The installations went fine!

However, grub didn't show the new system in the menu at start up. It was just the same, with the windows option and everything. Windows wouldn't boot, of course: incompatible file system (it wasn't Squeeze). I booted into Lenny and ran grub-update. Rebooted and now I can't even boot into my old system. I'm using a live cd. Grub still keeps showing Lenny and Windows at the menu, although there's no windows installed anymore. When I try to boot Lenny, I get this message:

Error:22 no such partition.

I'm quite sure there's something wrong the the menu.lst at /boot/grub
Here it is:

Code: Select all

title           Debian GNU/Linux, kernel 2.6.26-1-686
root            (hd0,6)
kernel          /boot/vmlinuz-2.6.26-1-686 root=/dev/hda7 ro quiet
initrd          /boot/initrd.img-2.6.26-1-686

title           Debian GNU/Linux, kernel 2.6.26-1-686 (single-user mode)
root            (hd0,6)
kernel          /boot/vmlinuz-2.6.26-1-686 root=/dev/hda7 ro single
initrd          /boot/initrd.img-2.6.26-1-686

### END DEBIAN AUTOMAGIC KERNELS LIST

# This is a divider, added to separate the menu items below from the Debian
# ones.
title           Other operating systems:
root


# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/hda1
title           Microsoft Windows XP Professional
root            (hd0,3)
savedefault
makeactive
chainloader     +1

Can anyone give me a hand in sorting this out? It doesn't seem to be too complicated, but I have no experience with editing this file. I did a little research in the forum and on the web, but still couldn't find a solution.

Thank you very much in advance!
Zac.

zac
Posts: 48
Joined: 2010-02-19 00:35

Re: Grub doesn't show new installation and can't boot old one

#2 Post by zac »

Ok, folks, I'm still trying to solve this.
After studying my partitions, I changed the menu.lst to the following configuration...

Code: Select all

## ## End Default Options ##

title           Debian GNU/Linux, kernel 2.6.26-1-686
root            (hd0,1)
kernel          /boot/vmlinuz-2.6.26-1-686 root=/dev/sda3 ro quiet
initrd          /boot/initrd.img-2.6.26-1-686

title           Debian GNU/Linux, kernel 2.6.26-1-686 (single-user mode)
root            (hd0,1)
kernel          /boot/vmlinuz-2.6.26-1-686 root=/dev/sda3 ro single
initrd          /boot/initrd.img-2.6.26-1-686

### END DEBIAN AUTOMAGIC KERNELS LIST

# This is a divider, added to separate the menu items below from the Debian
# ones.
title           Other operating systems:
root


# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda4
title           Debian (Squeeze)  GNU/Linux, kernel 2.6.32-trunk-686
root            (hd0,0)
kernel          media/squeeze/boot/vmlinuz-2.6.32-trunk-686 root=/dev/sda4 rw q$
initrd          media/squeeze/boot/initrd.img-2.6.32-trunk-686

Now, when I try to boot Lenny, I get another error message, saying something like: "can't mount device"

I think this is better than "no such partition". But I still can't mount it.

When I was installing my new squeeze in a separate partition, I was in doubt when setting the mount point. I thought if I set it as ' / ' it would interfere with my current Lenny system. So I tried to set it as /media/squeeze but got a message saying "no root mount point". So I thought, well, I must set it as ' / '. And that's what I did. My question is... even when installed in a separate partition, is it alright to set the mount point for the SECOND LINUX system as ' / ' ? If not, how should I proceed?

But the most important for me now is to be able to boot my old Lenny system!
Please, could anyone help with this?
I've tried many configurations for the menu.lst, but none of them worked.

Is it certain that the problem is related to grub, or is it the way I installed the new system?
What about the option 'bootable flag', which I set to 'on'.
Any problems with that.
The new system is the only one with the boot flag.

Thank you very much for you time!!
Z.

User avatar
nadir
Posts: 5964
Joined: 2009-10-05 22:06
Location: away

Re: Grub doesn't show new installation and can't boot old one

#3 Post by nadir »

for me it sounds like during installation of squeeze grub of lenny has been overwritten (but for some reason its menu is still getting shown).

to get an overview what is where check this from a live:

Code: Select all

fdisk -l
mount 
and gui: gparted (perhaps send a screenshot, but the output of commands should be enough)
you may wanna post the results here.

you need to make up your mind which grub you want to repair (either use the one of lenny or the one of squeeze, but stick with it, just for the easiness).

i'm a bit spare on time: check for how-to's to repair grub (there are different ways: you boot from the debian-installation cd and go for rescue, you do it like in the other thread (with chroot), remove and re-install it or run some grub-commands, etc).

as said: post the output of the commands, so its more easy to understand whts going on.
"I am not fine with it, so there is nothing for me to do but stand aside." M.D.

zac
Posts: 48
Joined: 2010-02-19 00:35

Re: Grub doesn't show new installation and can't boot old one

#4 Post by zac »

Hi nadir, I`m really sorry to disturb you again...

Here's the output of the commands:

Code: Select all

debian:/home/user# fdisk -l

Disk /dev/hda: 41.1 GB, 41110142976 bytes
255 heads, 63 sectors/track, 4998 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xd86bd86b

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1               1        4998    40146403+  83  Linux

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

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1           11602       19457    63103320   83  Linux
/dev/sda2           11474       11601     1028160   82  Linux swap / Solaris
/dev/sda3            3787       11473    61745827+  83  Linux
/dev/sda4   *           1        3786    30411013+  83  Linux

Partition table entries are not in disk order
debian:/home/user# mount
aufs on / type aufs (rw)
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
procbususb on /proc/bus/usb type usbfs (rw)
udev on /dev type tmpfs (rw,mode=0755)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)
/dev/hdb on /live/image type iso9660 (ro,noatime)
tmpfs on /live/cow type tmpfs (rw,noatime,mode=755)
tmpfs on /live type tmpfs (rw)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev)
debian:/home/user#
I think you're right. I was in doubt if I should install that grub again, and in the end I did it. It quite probably overwrote the grub of Lenny.

I'd prefer to stick to the grub of Lenny, as this is my main system.
I'll try to find out how to do this with chroot.

Thank you once more!

User avatar
nadir
Posts: 5964
Joined: 2009-10-05 22:06
Location: away

Re: Grub doesn't show new installation and can't boot old one

#5 Post by nadir »

try this:

Code: Select all

title           Debian GNU/Linux, kernel 2.6.26-1-686
root            (hd0,0)
kernel          /boot/vmlinuz-2.6.26-1-686 root=/dev/sda1 ro quiet
initrd          /boot/initrd.img-2.6.26-1-686

title           Debian GNU/Linux, kernel 2.6.26-1-686 (single-user mode)
root            (hd0,0)
kernel          /boot/vmlinuz-2.6.26-1-686 root=/dev/sda1 ro single
initrd          /boot/initrd.img-2.6.26-1-686

### END DEBIAN AUTOMAGIC KERNELS LIST

title           Debian (Squeeze)  GNU/Linux, kernel 2.6.32-trunk-686
root            (hd0,3)
kernel          media/squeeze/boot/vmlinuz-2.6.32-trunk-686 root=/dev/sda4 rw quiet
initrd          media/squeeze/boot/initrd.img-2.6.32-trunk-686
if that doesnt work try to replace > root (hd0,0) with > root (hd1,0)
if that doesnt work you may try to replace root=/dev/sda4 with root=/dev/hda4 in the line which starts with "kernel"
and the possible mixtures.
if that fails too check /boot/grub/device.map

if running grub2 its a bit different.

when booting grub1 you may hit e to edit the line which is highlighted. try to edit, hit b to boot and if that doesnt work hit e to edit again (its not easy to explain, but pretty straight forward, at least in grub1).

perhaps something of that will work, for me it looks that way, but i'm rather tired than awake. good luck.

ps: im searching for a link and will add it in a sec.
Last edited by nadir on 2010-03-09 20:43, edited 1 time in total.
"I am not fine with it, so there is nothing for me to do but stand aside." M.D.

User avatar
nadir
Posts: 5964
Joined: 2009-10-05 22:06
Location: away

Re: Grub doesn't show new installation and can't boot old one

#6 Post by nadir »

"I am not fine with it, so there is nothing for me to do but stand aside." M.D.

zac
Posts: 48
Joined: 2010-02-19 00:35

Re: Grub doesn't show new installation and can't boot old one

#7 Post by zac »

Thank you so much nadir!
I'll do my best here! Don't worry.You've already helped me a great deal!
You've been very nice!
Thanks!!

zac
Posts: 48
Joined: 2010-02-19 00:35

Re: Grub doesn't show new installation (SOLVED)

#8 Post by zac »

Finally!!
Thank you SO much once more nadir!
You saved me again!
I edited the menu.lst manually using that technique you taught me (hitting 'e' to edit the line at the menu; hitting 'b' to boot from it)
I tried all the combinations I could think of... not a very clever method, but I finally got it sorted!
Now both systems are booting!!!
Phew!
There it is!

Code: Select all

title           Debian GNU/Linux, kernel 2.6.26-1-686
root            (hd0,2)
kernel          /boot/vmlinuz-2.6.26-1-686 root=/dev/sda3 ro quiet
initrd          /boot/initrd.img-2.6.26-1-686

title           Debian GNU/Linux, kernel 2.6.26-1-686 (single-user mode)
root            (hd0,2)
kernel          /boot/vmlinuz-2.6.26-1-686 root=/dev/sda3 ro single
initrd          /boot/initrd.img-2.6.26-1-686

### END DEBIAN AUTOMAGIC KERNELS LIST

# This is a divider, added to separate the menu items below from the Debian
# ones.
title           Other operating systems:
root


# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda4
title           Debian (Squeeze)  GNU/Linux, kernel 2.6.32-trunk-686
root            (hd0,3)
kernel          /boot/vmlinuz-2.6.32-trunk-686 root=/dev/sda4 ro quiet
initrd          /boot/initrd.img-2.6.32-trunk-686
I know, it was completely wrong before! A great mess!
Well...
Thank you, thank you, thank you, thank you for your all your attention and help (despite being so tired!).
See you!
8)

User avatar
nadir
Posts: 5964
Joined: 2009-10-05 22:06
Location: away

Re: Grub doesn't show new installation and can't boot old one

#9 Post by nadir »

:oops:

that aside: i have given a hint (and half wrong it was...), but you did the hard part. congratulations. :-)
see us.
"I am not fine with it, so there is nothing for me to do but stand aside." M.D.

Post Reply