PDA

View Full Version : [ubuntu] Problems with GRUB || Startup Disk Creator doesn't work right



rbaleksandar
May 11th, 2010, 03:01 PM
Hi, guys.

First, I'll describe the GRUB-problem, because it's much more important for me to get it fixed (since I have only Ubuntu on my laptop).

History repeats itself...

Yesterday I decided to try another distro in a dual-boot with Ubuntu 10.04. And I messed things up. :D While installing the other distro, I changed the mount point of the new system to / (because I thought that's what I should do). Well, after rebooting I was able to start only the newly installed distro. When trying to start my Ubuntu, I got an error (forgot what exactly it was :(). Nevertheless I decide to delete the partition where the newly installed distro was. This was my second mistake. :D It wiped out the GRUB loader and started getting one of the best errors of all time - Error 22. Since then I looked all over the Internet (figuratively speaking of course :D) and banged my head in the wall ever since (my IQ has probably dropped with 30-40 points). One of the many tutorials/documentations/etc. that I read was https://help.ubuntu.com/community/RecoveringUbuntuAfterInstallingWindows .

I followed every step for the installation of the GRUB Loader. Finally I managed to get the "lovely" minimal BASH-like line working (which is a sign that I succeeded in installing it). Although I was able to do that, I still can't boot my Ubuntu. When I enter

grub> boot
I get

Starting up...
Error 8: Kernel must be loaded before booting

Now I looked here and there but I couldn't find a solution that is simple enough for me to understand.

RELEVANT INFO:
- using the LiveCD I am able to mount and work (browse/edit/etc.) with my Ubuntu filesystem-partition (by me it's in (hd0,0));
- I use GRUB2 (I can find grub.cfg but not menu.lst so...)
- question: is it possible to install the GRUB in both the MBR and the filesystem-partition? I have a strange feeling that I might have done it; :D
- after a couple of re-installations I tried (again) grub-install /dev/sda1 but it returned Could not find device for /boot: Not found or not a block device.

NOTE: Since the partitions are fine, I really don't want to format anything for this is my main and only OS right now.




EDIT:
Additional info, which I think might help:


grub> cat (hd0,0)/boot/grub/grub.cfg
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by /usr/sbin/grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
load_env
fi
set default="0"
if [ ${prev_saved_entry} ]; then
set saved_entry=${prev_saved_entry}
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi

function savedefault {
if [ -z ${boot_once} ]; then
### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
load_env
fi
set default="0"
if [ ${prev_saved_entry} ]; then
set saved_entry=${prev_saved_entry}
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi

function savedefault {
if [ -z ${boot_once} ]; then
saved_entry=${chosen}
save_env saved_entry
fi
}

function recordfail {
set recordfail=1
if [ -n ${have_grubenv} ]; then if [ -z ${boot_once} ]; then save_env recordfail; fi; fi
}
insmod ext2
set root='(hd0,1)'
search --no-floppy --fs-uuid --set b9414ba2-b17e-49e7-8164-78b0cc29358c
if loadfont /usr/share/grub/unicode.pf2 ; then
set gfxmode=640x480
insmod gfxterm
insmod vbe
if terminal_output gfxterm ; then true ; else
# For backward compatibility with versions of terminal.mod that don't
# understand terminal_output
terminal gfxterm
fi
fi
if [ -n ${have_grubenv} ]; then if [ -z ${boot_once} ]; then save_env recordfail; fi; fi
}
insmod ext2
set root='(hd0,1)'
search --no-floppy --fs-uuid --set b9414ba2-b17e-49e7-8164-78b0cc29358c
if loadfont /usr/share/grub/unicode.pf2 ; then
set gfxmode=640x480
insmod gfxterm
insmod vbe
if terminal_output gfxterm ; then true ; else
# For backward compatibility with versions of terminal.mod that don't
# understand terminal_output
terminal gfxterm
fi
fi
insmod ext2
set root='(hd0,0)'
search --no-floppy --fs-uuid --set b9414ba2-b17e-49e7-8164-78b0cc29358c
set locale_dir=($root)/boot/grub/locale
set lang=en
insmod gettext
if [ ${recordfail} = 1 ]; then
set timeout=-1
else
set timeout=10
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Ubuntu, with Linux 2.6.32-22-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set timeout=-1
else
set timeout=10
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Ubuntu, with Linux 2.6.32-22-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd0,0)'
search --no-floppy --fs-uuid --set b9414ba2-b17e-49e7-8164-78b0cc29358c
linux /boot/vmlinuz-2.6.32-22-generic root=UUID=b9414ba2-b17e-49e7-8164-78b0cc29358c ro quiet splash
initrd /boot/initrd.img-2.6.32-22-generic
}
menuentry 'Ubuntu, with Linux 2.6.32-22-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd0,0)'
search --no-floppy --fs-uuid --set b9414ba2-b17e-49e7-8164-78b0cc29358c
echo 'Loading Linux 2.6.32-22-generic ...'
linux /boot/vmlinuz-2.6.32-22-generic root=UUID=b9414ba2-b17e-49e7-8164-78b0cc29358c ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.32-22-generic
}
menuentry 'Ubuntu, with Linux 2.6.32-21-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd0,0)'
search --no-floppy --fs-uuid --set b9414ba2-b17e-49e7-8164-78b0cc29358c
linux /boot/vmlinuz-2.6.32-21-generic root=UUID=b9414ba2-b17e-49e7-8164-78b0cc29358c ro quiet splash
initrd /boot/initrd.img-2.6.32-21-generic
insmod ext2
set root='(hd0,0)'
search --no-floppy --fs-uuid --set b9414ba2-b17e-49e7-8164-78b0cc29358c
echo 'Loading Linux 2.6.32-22-generic ...'
linux /boot/vmlinuz-2.6.32-22-generic root=UUID=b9414ba2-b17e-49e7-8164-78b0cc29358c ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.32-22-generic
}
menuentry 'Ubuntu, with Linux 2.6.32-21-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd0,0)'
search --no-floppy --fs-uuid --set b9414ba2-b17e-49e7-8164-78b0cc29358c
linux /boot/vmlinuz-2.6.32-21-generic root=UUID=b9414ba2-b17e-49e7-8164-78b0cc29358c ro quiet splash
initrd /boot/initrd.img-2.6.32-21-generic
}
menuentry 'Ubuntu, with Linux 2.6.32-21-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd0,0)'
search --no-floppy --fs-uuid --set b9414ba2-b17e-49e7-8164-78b0cc29358c
echo 'Loading Linux 2.6.32-21-generic ...'
linux /boot/vmlinuz-2.6.32-21-generic root=UUID=b9414ba2-b17e-49e7-8164-78b0cc29358c ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.32-21-generic
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
insmod ext2
set root='(hd0,0)'
search --no-floppy --fs-uuid --set b9414ba2-b17e-49e7-8164-78b0cc29358c
linux16 /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
insmod ext2
linux /boot/vmlinuz-2.6.32-21-generic root=UUID=b9414ba2-b17e-49e7-8164-78b0cc29358c ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.32-21-generic
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
insmod ext2
set root='(hd0,0)'
search --no-floppy --fs-uuid --set b9414ba2-b17e-49e7-8164-78b0cc29358c
linux16 /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
insmod ext2
set root='(hd0,0)'
search --no-floppy --fs-uuid --set b9414ba2-b17e-49e7-8164-78b0cc29358c
linux16 /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
if [ ${timeout} != -1 ]; then
if keystatus; then
if keystatus --shift; then
set timeout=-1
else
set timeout=0
fi
else
if sleep --interruptible 3 ; then
set timeout=0
fi
fi
fi
### END /etc/grub.d/30_os-prober ###
### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
insmod ext2
set root='(hd0,0)'
search --no-floppy --fs-uuid --set b9414ba2-b17e-49e7-8164-78b0cc29358c
linux16 /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
insmod ext2
set root='(hd0,0)'
search --no-floppy --fs-uuid --set b9414ba2-b17e-49e7-8164-78b0cc29358c
linux16 /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
if [ ${timeout} != -1 ]; then
if keystatus; then
if keystatus --shift; then
set timeout=-1
else
set timeout=0
fi
else
if sleep --interruptible 3 ; then
set timeout=0
fi
fi
fi
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###



And another one:


root@ubuntu:/boot# sudo grub-install /dev/sda1
Searching for GRUB installation directory ... found: /boot/grub
grub-probe: error: cannot find a device for /boot/grub (is /dev mounted?).
[: 494: =: unexpected operator
The file /boot/grub/stage2 not read correctly.


And df /boot:


Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda1 1030104 87248 942856 9% /


EDIT2:
Ok, so I discovered that GRUB "kills" the boot-process when stage2 comes. I tried booting from GRUB's BASH-like line using 3 methods:
1)Direct booting:


grub> boot

2)Booting by calling a chainloader


grub> chainloader +1
grub> boot

3)Booting by calling the grub.cfg


grub> configfile (hd0,0)/boot/grub/grub.cfg


The grub-prompt displayed "Loading stage2..." and returned to default (all commands cleared from the screen and the description about using the TAB-key on the top of the screen). I looked in the grub-folder and both stage1 AND stage2 are present. :(

================================================== ========================
================================================== ========================
And here comes problem number 2:
The Startup Disk Creator creates a bootable Ubuntu on my USB stick. But when I want to start a live-session (this is from the menu, where you choose a language and whether you want to try the OS out or install it). It just freezes. That's not the case when using the DVD-RW, where I have Ubuntu burned on. I haven't had such a problem with 9.10, which I installed with the very same USB stick.



Looking forward to some geekish conversation. :P
Cheers,
rbaleksandar