PDA

View Full Version : [SOLVED] Grub rescue



jnfurst
March 9th, 2010, 12:10 AM
Hi everyone. I had Ubuntu dual booting with windows 7. Then I decided I wanted to make my Windows partition smaller and replace the change in size with a fat partition. Well I did this with Acronis Disk Director, but after the partitioning and the resulting restart my grub failed to load and got put into the grub rescue prompt and this where I need some help.

Here is the output from boot info script so that people can get idea of my partitions:


Boot Info Script 0.55 dated February 15th, 2010

============================= Boot Info Summary: ==============================

=> Grub 2 is installed in the MBR of /dev/sda and looks on the same drive in
partition #5 for /boot/grub.

sda1: __________________________________________________ _______________________

File system: ntfs
Boot sector type: Windows Vista/7
Boot sector info: No errors found in the Boot Parameter Block.
Operating System: Windows 7
Boot files/dirs: /bootmgr /boot/bcd /Windows/System32/winload.exe

sda2: __________________________________________________ _______________________

File system: Extended Partition
Boot sector type: -
Boot sector info:

sda5: __________________________________________________ _______________________

File system: vfat
Boot sector type: -
Boot sector info: According to the info in the boot sector, sda5 starts
at sector 63.
Operating System:
Boot files/dirs:

sda6: __________________________________________________ _______________________

File system: ext4
Boot sector type: -
Boot sector info:
Operating System: Ubuntu 9.10
Boot files/dirs: /boot/grub/grub.cfg /etc/fstab /boot/grub/core.img

sda7: __________________________________________________ _______________________

File system: swap
Boot sector type: -
Boot sector info:

=========================== Drive/Partition Info: =============================

Drive: sda ___________________ __________________________________________________ ___

Disk /dev/sda: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders, total 625142448 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x6f656a5a

Partition Boot Start End Size Id System

/dev/sda1 * 64 537,904,394 537,904,331 7 HPFS/NTFS
/dev/sda2 537,904,395 625,137,344 87,232,950 f W95 Ext d (LBA)
/dev/sda5 537,904,458 570,757,319 32,852,862 b W95 FAT32
/dev/sda6 570,757,383 622,791,854 52,034,472 83 Linux
/dev/sda7 622,791,918 625,137,344 2,345,427 82 Linux swap / Solaris


blkid -c /dev/null: __________________________________________________ __________

Device UUID TYPE LABEL

/dev/loop0 squashfs
/dev/sda1 5FEA2BD260AABD9E ntfs
/dev/sda5 C8FF-ACC5 vfat mac
/dev/sda6 cd85a0db-4c11-4e6c-90b3-4ff6dffbab92 ext4
/dev/sda7 08b3eefc-3679-462c-bf7c-cac0acb131ed swap

============================ "mount | grep ^/dev output: ===========================

Device Mount_Point Type Options

aufs / aufs (rw)
/dev/sr0 /cdrom iso9660 (rw)
/dev/loop0 /rofs squashfs (rw)


=========================== sda6/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 /boot/grub/grubenv ]; then
have_grubenv=true
load_env
fi
set default="6"
if [ ${prev_saved_entry} ]; then
saved_entry=${prev_saved_entry}
save_env saved_entry
prev_saved_entry=
save_env prev_saved_entry
fi
insmod ext2
set root=(hd0,5)
search --no-floppy --fs-uuid --set cd85a0db-4c11-4e6c-90b3-4ff6dffbab92
if loadfont /usr/share/grub/unicode.pf2 ; then
set gfxmode=1024x768
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 [ ${recordfail} = 1 ]; then
set timeout=-1
else
set timeout=5
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/white
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
menuentry "Ubuntu, Linux 2.6.31-20-generic" {
recordfail=1
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
set quiet=1
insmod ext2
set root=(hd0,5)
search --no-floppy --fs-uuid --set cd85a0db-4c11-4e6c-90b3-4ff6dffbab92
linux /boot/vmlinuz-2.6.31-20-generic root=UUID=cd85a0db-4c11-4e6c-90b3-4ff6dffbab92 ro vga=792 splash quiet quiet splash
initrd /boot/initrd.img-2.6.31-20-generic
}
menuentry "Ubuntu, Linux 2.6.31-20-generic (recovery mode)" {
recordfail=1
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
insmod ext2
set root=(hd0,5)
search --no-floppy --fs-uuid --set cd85a0db-4c11-4e6c-90b3-4ff6dffbab92
linux /boot/vmlinuz-2.6.31-20-generic root=UUID=cd85a0db-4c11-4e6c-90b3-4ff6dffbab92 ro single vga=792 splash quiet
initrd /boot/initrd.img-2.6.31-20-generic
}
menuentry "Ubuntu, Linux 2.6.31-14-generic" {
recordfail=1
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
set quiet=1
insmod ext2
set root=(hd0,5)
search --no-floppy --fs-uuid --set cd85a0db-4c11-4e6c-90b3-4ff6dffbab92
linux /boot/vmlinuz-2.6.31-14-generic root=UUID=cd85a0db-4c11-4e6c-90b3-4ff6dffbab92 ro vga=792 splash quiet quiet splash
initrd /boot/initrd.img-2.6.31-14-generic
}
menuentry "Ubuntu, Linux 2.6.31-14-generic (recovery mode)" {
recordfail=1
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
insmod ext2
set root=(hd0,5)
search --no-floppy --fs-uuid --set cd85a0db-4c11-4e6c-90b3-4ff6dffbab92
linux /boot/vmlinuz-2.6.31-14-generic root=UUID=cd85a0db-4c11-4e6c-90b3-4ff6dffbab92 ro single vga=792 splash quiet
initrd /boot/initrd.img-2.6.31-14-generic
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
linux16 /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
linux16 /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Windows 7 (loader) (on /dev/sda1)" {
insmod ntfs
set root=(hd0,1)
search --no-floppy --fs-uuid --set 5fea2bd260aabd9e
chainloader +1
}
### 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 ###

=============================== sda6/etc/fstab: ===============================

# /etc/fstab: static file system information.
#
# Use 'blkid -o value -s UUID' to print the universally unique identifier
# for a device; this may be used with UUID= as a more robust way to name
# devices that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
# / was on /dev/sda5 during installation
UUID=cd85a0db-4c11-4e6c-90b3-4ff6dffbab92 / ext4 errors=remount-ro 0 1
# swap was on /dev/sda6 during installation
UUID=08b3eefc-3679-462c-bf7c-cac0acb131ed none swap sw 0 0
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0

=================== sda6: Location of files loaded by Grub: ===================


295.9GB: boot/grub/core.img
294.9GB: boot/grub/grub.cfg
293.7GB: boot/initrd.img-2.6.31-14-generic
293.4GB: boot/initrd.img-2.6.31-20-generic
292.9GB: boot/vmlinuz-2.6.31-14-generic
293.0GB: boot/vmlinuz-2.6.31-20-generic
293.4GB: initrd.img
293.7GB: initrd.img.old
293.0GB: vmlinuz
292.9GB: vmlinuz.old

any help would really be appreciated!

jnfurst
March 9th, 2010, 12:55 AM
little update..

I have been able to boot into my Ubuntu install by using the following commands with my setup:



set prefix=(hd0,6)/boot/grub
set root=(hd0,6)
insmod /boot/grub/linux.mod
linux /vmlinuz root=/dev/sda6 ro
initrd /initrd.img
boot


Now I have to figure out how to repair grub so I don't have run these commands? Any idea how to do that?

oldfred
March 9th, 2010, 01:23 AM
You added a partition and now the numbering is off. You can reinstall grub2 with this if you are booted into your system.

reinstall from working system - first find Ununtu drive:
sudo fdisk -l
if it's "/dev/sda" then just run:
sudo grub-install /dev/sda
If that returns any errors run:
sudo grub-install --recheck /dev/sda
Then:
sudo update-grub

presence1960
March 9th, 2010, 01:43 AM
Hi everyone. I had Ubuntu dual booting with windows 7. Then I decided I wanted to make my Windows partition smaller and replace the change in size with a fat partition. Well I did this with Acronis Disk Director, but after the partitioning and the resulting restart my grub failed to load and got put into the grub rescue prompt and this where I need some help.

Here is the output from boot info script so that people can get idea of my partitions:


Boot Info Script 0.55 dated February 15th, 2010

============================= Boot Info Summary: ==============================

=> Grub 2 is installed in the MBR of /dev/sda and looks on the same drive in
partition #5 for /boot/grub.

sda1: __________________________________________________ _______________________

File system: ntfs
Boot sector type: Windows Vista/7
Boot sector info: No errors found in the Boot Parameter Block.
Operating System: Windows 7
Boot files/dirs: /bootmgr /boot/bcd /Windows/System32/winload.exe

sda2: __________________________________________________ _______________________

File system: Extended Partition
Boot sector type: -
Boot sector info:

sda5: __________________________________________________ _______________________

File system: vfat
Boot sector type: -
Boot sector info: According to the info in the boot sector, sda5 starts
at sector 63.
Operating System:
Boot files/dirs:

sda6: __________________________________________________ _______________________

File system: ext4
Boot sector type: -
Boot sector info:
Operating System: Ubuntu 9.10
Boot files/dirs: /boot/grub/grub.cfg /etc/fstab /boot/grub/core.img

sda7: __________________________________________________ _______________________

File system: swap
Boot sector type: -
Boot sector info:

=========================== Drive/Partition Info: =============================

Drive: sda ___________________ __________________________________________________ ___

Disk /dev/sda: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders, total 625142448 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x6f656a5a

Partition Boot Start End Size Id System

/dev/sda1 * 64 537,904,394 537,904,331 7 HPFS/NTFS
/dev/sda2 537,904,395 625,137,344 87,232,950 f W95 Ext d (LBA)
/dev/sda5 537,904,458 570,757,319 32,852,862 b W95 FAT32
/dev/sda6 570,757,383 622,791,854 52,034,472 83 Linux
/dev/sda7 622,791,918 625,137,344 2,345,427 82 Linux swap / Solaris


blkid -c /dev/null: __________________________________________________ __________

Device UUID TYPE LABEL

/dev/loop0 squashfs
/dev/sda1 5FEA2BD260AABD9E ntfs
/dev/sda5 C8FF-ACC5 vfat mac
/dev/sda6 cd85a0db-4c11-4e6c-90b3-4ff6dffbab92 ext4
/dev/sda7 08b3eefc-3679-462c-bf7c-cac0acb131ed swap

============================ "mount | grep ^/dev output: ===========================

Device Mount_Point Type Options

aufs / aufs (rw)
/dev/sr0 /cdrom iso9660 (rw)
/dev/loop0 /rofs squashfs (rw)


=========================== sda6/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 /boot/grub/grubenv ]; then
have_grubenv=true
load_env
fi
set default="6"
if [ ${prev_saved_entry} ]; then
saved_entry=${prev_saved_entry}
save_env saved_entry
prev_saved_entry=
save_env prev_saved_entry
fi
insmod ext2
set root=(hd0,5)
search --no-floppy --fs-uuid --set cd85a0db-4c11-4e6c-90b3-4ff6dffbab92
if loadfont /usr/share/grub/unicode.pf2 ; then
set gfxmode=1024x768
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 [ ${recordfail} = 1 ]; then
set timeout=-1
else
set timeout=5
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/white
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
menuentry "Ubuntu, Linux 2.6.31-20-generic" {
recordfail=1
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
set quiet=1
insmod ext2
set root=(hd0,5)
search --no-floppy --fs-uuid --set cd85a0db-4c11-4e6c-90b3-4ff6dffbab92
linux /boot/vmlinuz-2.6.31-20-generic root=UUID=cd85a0db-4c11-4e6c-90b3-4ff6dffbab92 ro vga=792 splash quiet quiet splash
initrd /boot/initrd.img-2.6.31-20-generic
}
menuentry "Ubuntu, Linux 2.6.31-20-generic (recovery mode)" {
recordfail=1
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
insmod ext2
set root=(hd0,5)
search --no-floppy --fs-uuid --set cd85a0db-4c11-4e6c-90b3-4ff6dffbab92
linux /boot/vmlinuz-2.6.31-20-generic root=UUID=cd85a0db-4c11-4e6c-90b3-4ff6dffbab92 ro single vga=792 splash quiet
initrd /boot/initrd.img-2.6.31-20-generic
}
menuentry "Ubuntu, Linux 2.6.31-14-generic" {
recordfail=1
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
set quiet=1
insmod ext2
set root=(hd0,5)
search --no-floppy --fs-uuid --set cd85a0db-4c11-4e6c-90b3-4ff6dffbab92
linux /boot/vmlinuz-2.6.31-14-generic root=UUID=cd85a0db-4c11-4e6c-90b3-4ff6dffbab92 ro vga=792 splash quiet quiet splash
initrd /boot/initrd.img-2.6.31-14-generic
}
menuentry "Ubuntu, Linux 2.6.31-14-generic (recovery mode)" {
recordfail=1
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
insmod ext2
set root=(hd0,5)
search --no-floppy --fs-uuid --set cd85a0db-4c11-4e6c-90b3-4ff6dffbab92
linux /boot/vmlinuz-2.6.31-14-generic root=UUID=cd85a0db-4c11-4e6c-90b3-4ff6dffbab92 ro single vga=792 splash quiet
initrd /boot/initrd.img-2.6.31-14-generic
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
linux16 /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
linux16 /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Windows 7 (loader) (on /dev/sda1)" {
insmod ntfs
set root=(hd0,1)
search --no-floppy --fs-uuid --set 5fea2bd260aabd9e
chainloader +1
}
### 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 ###

=============================== sda6/etc/fstab: ===============================

# /etc/fstab: static file system information.
#
# Use 'blkid -o value -s UUID' to print the universally unique identifier
# for a device; this may be used with UUID= as a more robust way to name
# devices that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
# / was on /dev/sda5 during installation
UUID=cd85a0db-4c11-4e6c-90b3-4ff6dffbab92 / ext4 errors=remount-ro 0 1
# swap was on /dev/sda6 during installation
UUID=08b3eefc-3679-462c-bf7c-cac0acb131ed none swap sw 0 0
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0

=================== sda6: Location of files loaded by Grub: ===================


295.9GB: boot/grub/core.img
294.9GB: boot/grub/grub.cfg
293.7GB: boot/initrd.img-2.6.31-14-generic
293.4GB: boot/initrd.img-2.6.31-20-generic
292.9GB: boot/vmlinuz-2.6.31-14-generic
293.0GB: boot/vmlinuz-2.6.31-20-generic
293.4GB: initrd.img
293.7GB: initrd.img.old
293.0GB: vmlinuz
292.9GB: vmlinuz.old

any help would really be appreciated!


=> Grub 2 is installed in the MBR of /dev/sda and looks on the same drive in
partition #5 for /boot/grub.

Your GRUB is looking to the wrong partition. Ubuntu 9.10 is on sda6. You can boot from the Live CD, choose "try ubuntu without any changes", when the desktop loads open a terminal and run
sudo mount /dev/sda6 /mntthis will mount your / partition. Next in terminal run
sudo grub-install --root-directory=/mnt/ /dev/sdaReboot without Live CD and you should be good to go.

jnfurst
March 9th, 2010, 01:49 AM
thank you both! It was fixed with

sudo grub-install --recheck /dev/sda
Then:
sudo update-grub

Thanks again!

presence1960
March 9th, 2010, 01:58 AM
thank you both! It was fixed with

sudo grub-install --recheck /dev/sda
Then:
sudo update-grub

Thanks again!

Great!! Now you know 2 ways to fix GRUB 2. The method you used is when you can boot into ubuntu. The method I suggested is for when you can not boot into ubuntu.

FYI here is a link to good info on GRUB 2: https://help.ubuntu.com/community/Grub2