PDA

View Full Version : [SOLVED] grub error: no such disk



mirth18
December 22nd, 2009, 10:46 PM
Hello all,

I originally had a single boot windows XP install. I then partitioned the drive and dual booted windows 7 RC to test it out. I ended up not liking it, and just formated the windows 7 partition. This left me with the windows 7 bootloader booting into windows XP.

Recently I wanted to install ubuntu. I grabbed 9.10, shrunk the extra partition a bit to add a swap partition and installed. First boot works great.. grub is there and shows all boot options. Then when I boot into windows, i go to the windows 7 bootloader, which then I boot into windows XP, all works fine. The very next reboot I get:


GRUB loading.
error: no such disk
grub rescue>I booted back into the live disk and reinstalled grub pointing at the /dev/sda2 and get back to square one, but anytime I boot into windows xp things go bad the next reboot. Can anyone help?

I have included my boot info:


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

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

File system: ntfs
Boot sector type: Windows Vista
Boot sector info: No errors found in the Boot Parameter Block.
Operating System: Windows XP
Boot files/dirs: /boot.ini /bootmgr /Boot/BCD /ntldr /ntdetect.com

sda2: __________________________________________________ _______________________

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

sda3: __________________________________________________ _______________________

File system: ntfs
Boot sector type: Windows XP
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files/dirs: /BOOT.INI /NTLDR /NTDETECT.COM

sda4: __________________________________________________ _______________________

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

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

Drive: sda ___________________ __________________________________________________ ___

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders, total 312581808 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x95aa95aa

Partition Boot Start End Size Id System

/dev/sda1 * 63 168,570,044 168,569,982 7 HPFS/NTFS
/dev/sda2 168,570,045 290,407,004 121,836,960 83 Linux
/dev/sda3 291,644,010 312,576,704 20,932,695 7 HPFS/NTFS
/dev/sda4 290,407,005 291,644,009 1,237,005 82 Linux swap / Solaris


blkid -c /dev/null: __________________________________________________ __________

/dev/loop0: TYPE="squashfs"
/dev/sda1: UUID="7ED98D8F38C0EE66" TYPE="ntfs"
/dev/sda2: UUID="0d08ba5d-73cd-4d5a-a2b4-bf0adec8b583" TYPE="ext4"
/dev/sda3: UUID="FAFC5F30FC5EE703" LABEL="HP_RECOVERY" TYPE="ntfs"
/dev/sda4: UUID="cd427a88-2c3a-4987-8ee0-0936afb0c8d2" TYPE="swap"

=============================== "mount" output: ===============================

aufs on / type aufs (rw)
none on /proc type proc (rw,noexec,nosuid,nodev)
none on /sys type sysfs (rw,noexec,nosuid,nodev)
udev on /dev type tmpfs (rw,mode=0755)
/dev/sr0 on /cdrom type iso9660 (rw)
/dev/loop0 on /rofs type squashfs (rw)
none on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
none on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
none on /dev/shm type tmpfs (rw,nosuid,nodev)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev)
none on /var/run type tmpfs (rw,nosuid,mode=0755)
none on /var/lock type tmpfs (rw,noexec,nosuid,nodev)
none on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)
gvfs-fuse-daemon on /home/ubuntu/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=ubuntu)


================================ sda1/boot.ini: ================================

;
;Warning: Boot.ini is used on Windows XP and earlier operating systems.
;Warning: Use BCDEDIT.exe to modify Windows Vista boot options.
;
[boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOW S
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /NOEXECUTE=OPTIN /FASTDETECT

=========================== sda2/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="0"
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,2)
search --no-floppy --fs-uuid --set 0d08ba5d-73cd-4d5a-a2b4-bf0adec8b583
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 [ ${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/white
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
menuentry "Ubuntu, Linux 2.6.31-16-generic" {
recordfail=1
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
set quiet=1
insmod ext2
set root=(hd0,2)
search --no-floppy --fs-uuid --set 0d08ba5d-73cd-4d5a-a2b4-bf0adec8b583
linux /boot/vmlinuz-2.6.31-16-generic root=UUID=0d08ba5d-73cd-4d5a-a2b4-bf0adec8b583 ro quiet splash
initrd /boot/initrd.img-2.6.31-16-generic
}
menuentry "Ubuntu, Linux 2.6.31-16-generic (recovery mode)" {
recordfail=1
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
insmod ext2
set root=(hd0,2)
search --no-floppy --fs-uuid --set 0d08ba5d-73cd-4d5a-a2b4-bf0adec8b583
linux /boot/vmlinuz-2.6.31-16-generic root=UUID=0d08ba5d-73cd-4d5a-a2b4-bf0adec8b583 ro single
initrd /boot/initrd.img-2.6.31-16-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,2)
search --no-floppy --fs-uuid --set 0d08ba5d-73cd-4d5a-a2b4-bf0adec8b583
linux /boot/vmlinuz-2.6.31-14-generic root=UUID=0d08ba5d-73cd-4d5a-a2b4-bf0adec8b583 ro 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,2)
search --no-floppy --fs-uuid --set 0d08ba5d-73cd-4d5a-a2b4-bf0adec8b583
linux /boot/vmlinuz-2.6.31-14-generic root=UUID=0d08ba5d-73cd-4d5a-a2b4-bf0adec8b583 ro single
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 7ed98d8f38c0ee66
chainloader +1
}
menuentry "Windows NT/2000/XP (on /dev/sda3)" {
insmod ntfs
set root=(hd0,3)
search --no-floppy --fs-uuid --set fafc5f30fc5ee703
drivemap -s (hd0) ${root}
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 ###

=============================== sda2/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/sda2 during installation
UUID=0d08ba5d-73cd-4d5a-a2b4-bf0adec8b583 / ext4 errors=remount-ro 0 1
# swap was on /dev/sda4 during installation
UUID=cd427a88-2c3a-4987-8ee0-0936afb0c8d2 none swap sw 0 0
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0

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


86.3GB: boot/grub/grub.cfg
86.3GB: boot/initrd.img-2.6.31-14-generic
86.3GB: boot/initrd.img-2.6.31-16-generic
86.3GB: boot/vmlinuz-2.6.31-14-generic
86.3GB: boot/vmlinuz-2.6.31-16-generic
86.3GB: initrd.img
86.3GB: initrd.img.old
86.3GB: vmlinuz
86.3GB: vmlinuz.old

================================ sda3/BOOT.INI: ================================

[boot loader]
timeout=0
default=C:\CMDCONS\BOOTSECT.DAT
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /fastdetect
C:\CMDCONS\BOOTSECT.DAT="Microsoft Windows Recovery Console" /cmdcons

mirth18
December 22nd, 2009, 10:50 PM
FYI: /dev/sda3 is some sort of recovery partition...

meierfra.
December 23rd, 2009, 04:01 AM
It seems that some Windows program is overwriting parts of the Grub 2 code in the extended MBR. I suggest to install Grub 2 to the Ubuntu boot sector, install a windows type MBR and put the boot flag onto the Ubuntu partition.

If you currently can boot into Ubuntu do:


sudo apt-get install lilo
sudo grub-install -f /dev/sda2
sudo lilo -M /dev/sda mbr
sudo lilo -A /dev/sda 2

If you can't boot into Ubuntu, boot from the Ubuntu Live CD and do


sudo mount /dev/sda2 /mnt
sudo apt-get install lilo
sudo grub-install -f --recheck --root-directory=/mnt /dev/sda2
sudo lilo -M /dev/sda mbr
sudo lilo -A /dev/sda 2



Installing grub to a boot sector has one disadvantage: You will have to reinstall grub after kernel updates.
Alternatively, you could try to disable the program in XP which causes the problem. See this bug report (https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/441941)for some clues.
Or you could install legacy grub (http://ubuntuforums.org/showthread.php?t=1298932) instead of Grub 2.

But try my first suggestion first. It's quick and easy, and if it won't fix your problem, the other methods probably won't work either.

oldfred
December 23rd, 2009, 07:00 AM
Since it is an HP, the problem may be HP's recovery tools. These are some of the issues reported and programs causing issues:

HP ProtectTools and Dell Recovery Tool write into MBR
https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/441941
Dell Media direct issues with MBR
http://ubuntuforums.org/showthread.php?t=923576
http://ubuntuforums.org/showthread.php?t=1344828
http://ubuntuforums.org/showthread.php?p=8433673
Found out today after numerous searches the issue. I found the answer here -- I had heard dynamic disk partioning may be the cause (which I don't have) or virus software (which I removed). I have a Compaq netbook -- HP product. Turns out they have HP Recovery tools that will overwrite parts of the MBR. The thing is, I uninstalled every single piece of their recovery software, sync software, etc, cuz I didn't want any of that crap. I went into services, and lo-and -behold -- there was the hpqwmiex service running. So I disabled it, did the update-grub thing again, logged into Windows then back into Ubuntu, and all is well!
Another windows issue that caused grub2 issues.
Looks like I found the culprit. It was Norton Ghost running in the background, that I had just recently installed. I disabled it during startup through msconfig and no more trouble. Thanks for the links!

mirth18
December 23rd, 2009, 08:09 PM
Downgrading to grub1 did the trick for me.

Follow these instructions as detailed in the grub2 bug report comments:
https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/441941/comments/21


sudo apt-get purge grub-pc
sudo rm /boot/grub/*
sudo apt-get install grub
sudo update-grub
sudo grub-install /dev/sda (replace sda with your boot device!)
Add a section in /boot/grub/menu.lst:
title Windows XP
root (hd0,0)
makeactive
chainloader +1

meierfra.
December 23rd, 2009, 08:35 PM
Great. Did you try my first suggestion?

mirth18
December 23rd, 2009, 10:39 PM
Great. Did you try my first suggestion?

No I didn't try your first suggestion, from the bug reports it seemed pretty clear that grub2 and many of the windows "rescue partition" type programs have issues. legacy grub seems to be working out great so far.

meierfra.
December 23rd, 2009, 10:48 PM
It seemed pretty clear that grub2 and many of the windows "rescue partition" type programs have issues.

But only if Grub 2 is installed in the MBR. Installing Grub 2 to the boot sector (as I suggested) avoids whose problems.



No I didn't try your first suggestion,
That's fine. Legacy grub, since its works, is the best option in your case. I just wanted sure that my first suggestion did not fail for some reason.

Have fun with XP and Ubuntu.