PDA

View Full Version : [SOLVED] ubuntu 11.04 with win 7 -- A disk read error occured



weiyan
August 1st, 2011, 07:19 PM
Installed ubuntu 11.04 on a Amd 64 machine already have a win7. After installation completer, book into ubuntu is ok. When select win7 from boot menu, it occors:
"A disk read error occured. Press ctrl alt del to reboot."

Should there method to recover it besides reinstall win 7? Tried run win 7's boot recovery from installation CD, not success. Tried sudo update-grub, not ok.

Thanks.

This is the grub.cfg:


#
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by 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
set have_grubenv=true
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
}

function load_video {
insmod vbe
insmod vga
insmod video_bochs
insmod video_cirrus
}

insmod part_msdos
insmod ext2
set root='(/dev/sda,msdos6)'
search --no-floppy --fs-uuid --set=root 655b833b-731e-4f9d-a75f-bfef82242b3e
if loadfont /usr/share/grub/unicode.pf2 ; then
set gfxmode=auto
load_video
insmod gfxterm
fi
terminal_output gfxterm
insmod part_msdos
insmod ext2
set root='(/dev/sda,msdos6)'
search --no-floppy --fs-uuid --set=root 655b833b-731e-4f9d-a75f-bfef82242b3e
set locale_dir=($root)/boot/grub/locale
set lang=zh_HK
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
if background_color 44,0,30; then
clear
fi
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
if [ ${recordfail} != 1 ]; then
if [ -e ${prefix}/gfxblacklist.txt ]; then
if hwmatch ${prefix}/gfxblacklist.txt 3; then
if [ ${match} = 0 ]; then
set linux_gfx_mode=keep
else
set linux_gfx_mode=text
fi
else
set linux_gfx_mode=text
fi
else
set linux_gfx_mode=keep
fi
else
set linux_gfx_mode=text
fi
export linux_gfx_mode
if [ "$linux_gfx_mode" != "text" ]; then load_video; fi
menuentry 'Ubuntu, with Linux 2.6.38-10-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
set gfxpayload=$linux_gfx_mode
insmod part_msdos
insmod ext2
set root='(/dev/sda,msdos6)'
search --no-floppy --fs-uuid --set=root 655b833b-731e-4f9d-a75f-bfef82242b3e
linux /boot/vmlinuz-2.6.38-10-generic root=UUID=655b833b-731e-4f9d-a75f-bfef82242b3e ro quiet splash vt.handoff=7
initrd /boot/initrd.img-2.6.38-10-generic
}
menuentry 'Ubuntu, with Linux 2.6.38-10-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
set gfxpayload=$linux_gfx_mode
insmod part_msdos
insmod ext2
set root='(/dev/sda,msdos6)'
search --no-floppy --fs-uuid --set=root 655b833b-731e-4f9d-a75f-bfef82242b3e
echo 'Loading Linux 2.6.38-10-generic ...'
linux /boot/vmlinuz-2.6.38-10-generic root=UUID=655b833b-731e-4f9d-a75f-bfef82242b3e ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.38-10-generic
}
submenu "Previous Linux versions" {
menuentry 'Ubuntu, with Linux 2.6.38-8-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
set gfxpayload=$linux_gfx_mode
insmod part_msdos
insmod ext2
set root='(/dev/sda,msdos6)'
search --no-floppy --fs-uuid --set=root 655b833b-731e-4f9d-a75f-bfef82242b3e
linux /boot/vmlinuz-2.6.38-8-generic root=UUID=655b833b-731e-4f9d-a75f-bfef82242b3e ro quiet splash vt.handoff=7
initrd /boot/initrd.img-2.6.38-8-generic
}
menuentry 'Ubuntu, with Linux 2.6.38-8-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
set gfxpayload=$linux_gfx_mode
insmod part_msdos
insmod ext2
set root='(/dev/sda,msdos6)'
search --no-floppy --fs-uuid --set=root 655b833b-731e-4f9d-a75f-bfef82242b3e
echo 'Loading Linux 2.6.38-8-generic ...'
linux /boot/vmlinuz-2.6.38-8-generic root=UUID=655b833b-731e-4f9d-a75f-bfef82242b3e ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.38-8-generic
}
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
insmod part_msdos
insmod ext2
set root='(/dev/sda,msdos6)'
search --no-floppy --fs-uuid --set=root 655b833b-731e-4f9d-a75f-bfef82242b3e
linux16 /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
insmod part_msdos
insmod ext2
set root='(/dev/sda,msdos6)'
search --no-floppy --fs-uuid --set=root 655b833b-731e-4f9d-a75f-bfef82242b3e
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)" --class windows --class os {
insmod part_msdos
insmod ntfs
set root='(/dev/sda,msdos1)'
search --no-floppy --fs-uuid --set=root 9C2038B0203892EE
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 ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f $prefix/custom.cfg ]; then
source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###

YesWeCan
August 1st, 2011, 09:05 PM
Hi there. Would you download and post the output of http://bootinfoscript.sourceforge.net/ ?
It will give a lot more detail.


Tried run win 7's boot recovery from installation CD, not success.
Would you say more about this?

weiyan
August 2nd, 2011, 12:08 AM
Hi there. Would you download and post the output of http://bootinfoscript.sourceforge.net/ ?
It will give a lot more detail.


Would you say more about this?

Thank you.

Insert the win7 installation disk and boot from it. In the after choosing language it go to a screen with "install now" in the center, at lower left corner, there is a recover option. In recover menu, click recover boot up problem. After a while, it reports recover success.

The output of boot_info_script:

Boot Info Script 0.60 from 17 May 2011


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

=> Grub2 (v1.99) is installed in the MBR of /dev/sda and looks at sector 1 of
the same hard drive for core.img. core.img is at this location and looks
for (,msdos6)/boot/grub on this drive.

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: /bootmgr /Boot/BCD /Windows/System32/winload.exe

sda2: __________________________________________________ ________________________

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

sda5: __________________________________________________ ________________________

File system: ntfs
Boot sector type: Windows XP
Boot sector info: According to the info in the boot sector, sda5 starts
at sector 63.
Operating System:
Boot files: /ubuntu/winboot/wubildr /ubuntu/winboot/wubildr.mbr

sda6: __________________________________________________ ________________________

File system: ext4
Boot sector type: -
Boot sector info:
Operating System: Ubuntu 11.04
Boot files: /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: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes

Partition Boot Start Sector End Sector # of Sectors Id System

/dev/sda1 * 63 209,760,704 209,760,642 7 NTFS / exFAT / HPFS
/dev/sda2 209,760,766 976,771,071 767,010,306 f W95 Extended (LBA)
/dev/sda5 209,760,768 603,042,129 393,281,362 7 NTFS / exFAT / HPFS
/dev/sda6 603,043,840 968,386,559 365,342,720 83 Linux
/dev/sda7 968,388,608 976,771,071 8,382,464 82 Linux swap / Solaris


"blkid" output: __________________________________________________ ______________

Device UUID TYPE LABEL

/dev/sda1 9C2038B0203892EE ntfs
/dev/sda5 9C2038B0203892EE ntfs
/dev/sda6 655b833b-731e-4f9d-a75f-bfef82242b3e ext4
/dev/sda7 c82f9708-919d-4916-9d0a-bae3a91d510b swap

================================ Mount points: =================================

Device Mount_Point Type Options

/dev/sda6 / ext4 (rw,errors=remount-ro,commit=0)


=========================== sda6/boot/grub/grub.cfg: ===========================

--------------------------------------------------------------------------------
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by 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
set have_grubenv=true
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
}

function load_video {
insmod vbe
insmod vga
insmod video_bochs
insmod video_cirrus
}

insmod part_msdos
insmod ext2
set root='(/dev/sda,msdos6)'
search --no-floppy --fs-uuid --set=root 655b833b-731e-4f9d-a75f-bfef82242b3e
if loadfont /usr/share/grub/unicode.pf2 ; then
set gfxmode=1024x768
load_video
insmod gfxterm
fi
terminal_output gfxterm
insmod part_msdos
insmod ext2
set root='(/dev/sda,msdos6)'
search --no-floppy --fs-uuid --set=root 655b833b-731e-4f9d-a75f-bfef82242b3e
set locale_dir=($root)/boot/grub/locale
set lang=zh_HK
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
if background_color 44,0,30; then
clear
fi
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
if [ ${recordfail} != 1 ]; then
if [ -e ${prefix}/gfxblacklist.txt ]; then
if hwmatch ${prefix}/gfxblacklist.txt 3; then
if [ ${match} = 0 ]; then
set linux_gfx_mode=keep
else
set linux_gfx_mode=text
fi
else
set linux_gfx_mode=text
fi
else
set linux_gfx_mode=keep
fi
else
set linux_gfx_mode=text
fi
export linux_gfx_mode
if [ "$linux_gfx_mode" != "text" ]; then load_video; fi
menuentry 'Ubuntu, with Linux 2.6.38-10-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
set gfxpayload=$linux_gfx_mode
insmod part_msdos
insmod ext2
set root='(/dev/sda,msdos6)'
search --no-floppy --fs-uuid --set=root 655b833b-731e-4f9d-a75f-bfef82242b3e
linux /boot/vmlinuz-2.6.38-10-generic root=UUID=655b833b-731e-4f9d-a75f-bfef82242b3e ro vga=773 quiet splash vt.handoff=7
initrd /boot/initrd.img-2.6.38-10-generic
}
menuentry 'Ubuntu, with Linux 2.6.38-10-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
set gfxpayload=$linux_gfx_mode
insmod part_msdos
insmod ext2
set root='(/dev/sda,msdos6)'
search --no-floppy --fs-uuid --set=root 655b833b-731e-4f9d-a75f-bfef82242b3e
echo 'Loading Linux 2.6.38-10-generic ...'
linux /boot/vmlinuz-2.6.38-10-generic root=UUID=655b833b-731e-4f9d-a75f-bfef82242b3e ro single vga=773
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.38-10-generic
}
submenu "Previous Linux versions" {
menuentry 'Ubuntu, with Linux 2.6.38-8-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
set gfxpayload=$linux_gfx_mode
insmod part_msdos
insmod ext2
set root='(/dev/sda,msdos6)'
search --no-floppy --fs-uuid --set=root 655b833b-731e-4f9d-a75f-bfef82242b3e
linux /boot/vmlinuz-2.6.38-8-generic root=UUID=655b833b-731e-4f9d-a75f-bfef82242b3e ro vga=773 quiet splash vt.handoff=7
initrd /boot/initrd.img-2.6.38-8-generic
}
menuentry 'Ubuntu, with Linux 2.6.38-8-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
set gfxpayload=$linux_gfx_mode
insmod part_msdos
insmod ext2
set root='(/dev/sda,msdos6)'
search --no-floppy --fs-uuid --set=root 655b833b-731e-4f9d-a75f-bfef82242b3e
echo 'Loading Linux 2.6.38-8-generic ...'
linux /boot/vmlinuz-2.6.38-8-generic root=UUID=655b833b-731e-4f9d-a75f-bfef82242b3e ro single vga=773
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.38-8-generic
}
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
insmod part_msdos
insmod ext2
set root='(/dev/sda,msdos6)'
search --no-floppy --fs-uuid --set=root 655b833b-731e-4f9d-a75f-bfef82242b3e
linux16 /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
insmod part_msdos
insmod ext2
set root='(/dev/sda,msdos6)'
search --no-floppy --fs-uuid --set=root 655b833b-731e-4f9d-a75f-bfef82242b3e
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)" --class windows --class os {
insmod part_msdos
insmod ntfs
set root='(/dev/sda,msdos1)'
search --no-floppy --fs-uuid --set=root 9C2038B0203892EE
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 ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f $prefix/custom.cfg ]; then
source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_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 nodev,noexec,nosuid 0 0
# / was on /dev/sda6 during installation
UUID=655b833b-731e-4f9d-a75f-bfef82242b3e / ext4 errors=remount-ro 0 1
# swap was on /dev/sda7 during installation
UUID=c82f9708-919d-4916-9d0a-bae3a91d510b none swap sw 0 0
--------------------------------------------------------------------------------

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

GiB - GB File Fragment(s)

455.688289642 = 489.291575296 boot/grub/core.img 1
307.696628571 = 330.386739200 boot/grub/grub.cfg 1
290.433166504 = 311.850237952 boot/initrd.img-2.6.38-10-generic 1
289.447273254 = 310.791643136 boot/initrd.img-2.6.38-8-generic 2
289.546211243 = 310.897876992 boot/vmlinuz-2.6.38-10-generic 1
455.686527252 = 489.289682944 boot/vmlinuz-2.6.38-8-generic 1
290.433166504 = 311.850237952 initrd.img 1
289.447273254 = 310.791643136 initrd.img.old 2
289.546211243 = 310.897876992 vmlinuz 1
455.686527252 = 489.289682944 vmlinuz.old 1

=============================== StdErr Messages: ===============================

unlzma: Decoder error

YesWeCan
August 2nd, 2011, 12:16 AM
You have two partitions with the same UUID. Have you cloned a partition?

weiyan
August 2nd, 2011, 12:37 AM
You have two partitions with the same UUID. Have you cloned a partition?
Thank you for your prompt reply.

I didn't know how to clone a partition. During the installation, just follow what the ubuntu installation suggested.

I see, sda1 and sda5 are partitions created during win7 installation. sda1 is about 100gb the win root system in it. sda5 originally has nearly 400gb, shrink down and shared about half with ubuntu.

Does the need to change uuid of sda5?

YesWeCan
August 2nd, 2011, 01:13 AM
I'm guessing the trouble is that Grub looks for the Windows OS you select using UUID and it finds two partitions with the same UUID and reports a disk error.

So I suppose you have two choices:
1) Change grub.cfg so it looks for Win7 by an identifier other than UUID. For example ID, label, path (see /dev/disk/)
2) Change the UUID of one of the partitions.

I don't know how to do 1). It is probably simple. But if you edit grub.cfg then whenever you run update-grub in the future it will be overwritten. So to do this properly you need to add a file to /etc/grub.d or modify 30_os-prober or something similar. I do not know exactly what is needed but there is some info here: https://help.ubuntu.com/community/Grub2
This is a safe way to work around the problem.

Doing 2) is a better in a way because each partition should have a unique UUID but the procedure is dangerous and I don't know whether it will affect Windows at all. You might want to change sda5.

On way to change the UUID of NTFS partition sda5 to a random number:

sudo dd if=/dev/urandom of=/dev/sda5 bs=8 count=1 seek=9

Be careful: this is a dangerous command because if you mistype anything you could make the partition unreadable.

As a precaution, first read the UUID using dd and check it gets the right number:

sudo dd if=/dev/sda5 bs=8 count=1 skip=9 | hexdump -C

The UUID will come out in 8 bytes in reverse order.

So if your vital data in sda5 is not backed up, you should think twice about changing the UUID by this method. I am not aware of other methods but you might want to do some research.

YesWeCan
August 2nd, 2011, 01:18 AM
For anyone interested, this details the Windows boot sector formats: http://technet.microsoft.com/en-us/library/cc976796.aspx

weiyan
August 2nd, 2011, 02:03 AM
YesWeCan,

Thank you. We solved this problem.

http://ubuntuforums.org/showthread.php?t=869801&page=2
From above thread, found this command:

sudo dd if=/dev/urandom of=/dev/sda5 bs=8 count=1 seek=9Then

sudo bash ./boot_info_script.sh outfileto check is the uuid changed.

then:

sudo update-grubReboot, and select the ugly win7, after running some diagnostic, the win7 back again.
:popcorn:

YesWeCan
August 2nd, 2011, 02:05 AM
Well done. :)
Don't forget to mark this as solved in thread tools.