[Bug 880925] Re: Grub2 destroying mbr for windows installations (Vista)
Bruce Pieterse
dev at otq.za.net
Sun Jun 10 10:18:03 UTC 2012
Problem no longer occurs with 1.99-21ubuntu3.1.
** Changed in: grub2 (Ubuntu)
Status: New => Incomplete
** Changed in: grub2 (Ubuntu)
Status: Incomplete => Invalid
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to grub2 in Ubuntu.
https://bugs.launchpad.net/bugs/880925
Title:
Grub2 destroying mbr for windows installations (Vista)
Status in “grub2” package in Ubuntu:
Invalid
Bug description:
I think I should provide some history for you to better diagnose the
problem.
I installed Ubuntu 10.10 then later reformatted and installed 11.04 on
/dev/sdb. I had a spare 250GB lying around and decided to put Vista
back on for odd Graphic Design jobs I get.
I installed Vista, but had to unplug my SATA cables for all my drives
in order for the SP2 update to install otherwise it would be in loop
of failing to install. SP2 installed fine and because of the past
history of having Ubuntu and Vista installed (no problem if it's on
the same drive), I would normally unplug my SATA cable for /dev/sda
and then boot up to Ubuntu, otherwise I would be forced to re-install
or use bootrec /fixmbr and bootrec /fixboot.
I finally decided to leave the SATA cable in and boot to Ubuntu, do a
update-grub to detect the Windows installation, and it did, however, I
would reboot and try and select Windows from the Grub menu only to be
met by a flashing cursor (no boot record for windows). So the
procedure started all over again, insert DVD, run chkdsk, bootrec
switches, restart. The repair option doesn't find a valid installation
until chkdsk is used, restarted and then going back into repair mode.
Yesterday, I tried to fix the problem and used chkdsk /F as well as
chkdsk /F /R /B C: to check for errors. Yup, there were tons of
indexing errors, and practically ALL THE FILES on the drive had to be
recovered (recovery orphan file boot.ini from $130 in directory 43455
etc). I Rebooted, Repair found a problem and I had to restart again.
Windows was recovered in order for me to do a bootrec again!
So everything was fine until I got a ntoskernal.exe error. I tried
reverse integrating SP2 into my SP1 DVD but the system repair option
still detects that the DVD is older than the OS installed (version
mismatch) and it is unable to replace my ntoskernal.exe. However,
installation on a virtual machine confirms that SP2 is installed using
the reverse integrated method and compiling with vlite (I had to use
PE tools to get this working).
Looks like I might have to re-install, but I have managed to pull my
data from the drive using a live cd and copy it over to one of my
other drives.
I am willing to create a video of this process as I think it is
critical to get this fixed and share it with the developers if I re-
install over the weekend.
Another thing I would like to add is that I keep getting "One or more
block devices are holding /dev/sda1" when trying to access the device
in nautilus. It's definitely not a raid device, lsof displays nothing
holding the device, there is no fstab entry for this device as well,
but gparted tells me that there is an error: NTFS is inconsistent with
11 cluster account mismatches. Um, I just ran chkdsk thrice before
giving up and booting back into Ubuntu.
As requested, please find the bootinfo script results below:
Boot Info Script 0.60 from 17 May 2011
============================= Boot Info Summary: ===============================
=> Windows is installed in the MBR of /dev/sda.
=> Grub2 (v1.99) is installed in the MBR of /dev/sdb and looks at sector 1 of
the same hard drive for core.img. core.img is at this location and looks
for (,msdos5)/boot/grub on this drive.
=> No boot loader is installed in the MBR of /dev/sdc.
=> No boot loader is installed in the MBR of /dev/sdd.
sda1:
__________________________________________________________________________
File system: ntfs
Boot sector type: Windows Vista/7
Boot sector info: No errors found in the Boot Parameter Block.
Mounting failed: fuse: mount failed: Device or resource busy
fuse: mount failed: Device or resource busy
sdb1:
__________________________________________________________________________
File system:
Boot sector type: -
Boot sector info:
Mounting failed: fuse: mount failed: Device or resource busy
fuse: mount failed: Device or resource busy
mount: unknown filesystem type ''
sdb2:
__________________________________________________________________________
File system: Extended Partition
Boot sector type: Unknown
Boot sector info:
sdb5:
__________________________________________________________________________
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
sdc1:
__________________________________________________________________________
File system: ext4
Boot sector type: -
Boot sector info:
Operating System:
Boot files:
sdd1:
__________________________________________________________________________
File system: ext4
Boot sector type: -
Boot sector info:
Operating System:
Boot files:
sdd2:
__________________________________________________________________________
File system: ntfs
Boot sector type: Windows Vista/7
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files:
============================ Drive/Partition Info:
=============================
Drive: sda
_____________________________________________________________________
Disk /dev/sda: 250.1 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders, total 488397168 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 * 2,048 488,394,751 488,392,704 7 NTFS /
exFAT / HPFS
Drive: sdb _____________________________________________________________________
Disk /dev/sdb: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders, total 312581808 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/sdb1 * 2,048 7,999,487 7,997,440 82 Linux swap / Solaris
/dev/sdb2 8,001,534 312,580,095 304,578,562 5 Extended
/dev/sdb5 8,001,536 312,580,095 304,578,560 83 Linux
Drive: sdc _____________________________________________________________________
Disk /dev/sdc: 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/sdc1 2,048 976,771,071 976,769,024 83 Linux
Drive: sdd _____________________________________________________________________
Disk /dev/sdd: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 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/sdd1 2,048 1,851,944,959 1,851,942,912 83 Linux
/dev/sdd2 1,851,944,960 1,953,523,711 101,578,752 7 NTFS / exFAT / HPFS
"blkid" output: ________________________________________________________________
Device UUID TYPE
LABEL
/dev/mapper/cryptswap1 f0e00a48-14e5-4b00-a8f3-2b318a960fa9 swap
/dev/sda1 20048CDA048CB3F6 ntfs
/dev/sdb5 1e4d8d3b-c40b-4dc5-a48e-f8eef4763c81 ext4
/dev/sdc1 b14adec9-7509-4918-85a5-c53b0d117c4e ext4
/dev/sdd1 15fb2ca4-4ea6-4fcd-8cf0-f6cdf77f5bf5 ext4 skye
/dev/sdd2 03F8559609BCBA0A ntfs skynet
========================= "ls -R /dev/mapper/" output:
=========================
/dev/mapper:
control
cryptswap1
================================ Mount points:
=================================
Device Mount_Point Type Options
/dev/sdb5 / ext4 (rw,errors=remount-ro,commit=0)
/dev/sdc1 /home ext4 (rw,commit=0)
/dev/sdd1 /media/skye ext4 (rw,errors=remount-ro,commit=0)
=========================== sdb5/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/sdb,msdos5)'
search --no-floppy --fs-uuid --set=root 1e4d8d3b-c40b-4dc5-a48e-f8eef4763c81
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/sdb,msdos5)'
search --no-floppy --fs-uuid --set=root 1e4d8d3b-c40b-4dc5-a48e-f8eef4763c81
set locale_dir=($root)/boot/grub/locale
set lang=en_ZA
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 ###
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-11-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
set gfxpayload=$linux_gfx_mode
insmod part_msdos
insmod ext2
set root='(/dev/sdb,msdos5)'
search --no-floppy --fs-uuid --set=root 1e4d8d3b-c40b-4dc5-a48e-f8eef4763c81
linux /boot/vmlinuz-2.6.38-11-generic root=UUID=1e4d8d3b-c40b-4dc5-a48e-f8eef4763c81 ro quiet splash vt.handoff=7
initrd /boot/initrd.img-2.6.38-11-generic
}
menuentry 'Ubuntu, with Linux 2.6.38-11-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/sdb,msdos5)'
search --no-floppy --fs-uuid --set=root 1e4d8d3b-c40b-4dc5-a48e-f8eef4763c81
echo 'Loading Linux 2.6.38-11-generic ...'
linux /boot/vmlinuz-2.6.38-11-generic root=UUID=1e4d8d3b-c40b-4dc5-a48e-f8eef4763c81 ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.38-11-generic
}
submenu "Previous Linux versions" {
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/sdb,msdos5)'
search --no-floppy --fs-uuid --set=root 1e4d8d3b-c40b-4dc5-a48e-f8eef4763c81
linux /boot/vmlinuz-2.6.38-10-generic root=UUID=1e4d8d3b-c40b-4dc5-a48e-f8eef4763c81 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/sdb,msdos5)'
search --no-floppy --fs-uuid --set=root 1e4d8d3b-c40b-4dc5-a48e-f8eef4763c81
echo 'Loading Linux 2.6.38-10-generic ...'
linux /boot/vmlinuz-2.6.38-10-generic root=UUID=1e4d8d3b-c40b-4dc5-a48e-f8eef4763c81 ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.38-10-generic
}
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/sdb,msdos5)'
search --no-floppy --fs-uuid --set=root 1e4d8d3b-c40b-4dc5-a48e-f8eef4763c81
linux /boot/vmlinuz-2.6.38-8-generic root=UUID=1e4d8d3b-c40b-4dc5-a48e-f8eef4763c81 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/sdb,msdos5)'
search --no-floppy --fs-uuid --set=root 1e4d8d3b-c40b-4dc5-a48e-f8eef4763c81
echo 'Loading Linux 2.6.38-8-generic ...'
linux /boot/vmlinuz-2.6.38-8-generic root=UUID=1e4d8d3b-c40b-4dc5-a48e-f8eef4763c81 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/sdb,msdos5)'
search --no-floppy --fs-uuid --set=root 1e4d8d3b-c40b-4dc5-a48e-f8eef4763c81
linux16 /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
insmod part_msdos
insmod ext2
set root='(/dev/sdb,msdos5)'
search --no-floppy --fs-uuid --set=root 1e4d8d3b-c40b-4dc5-a48e-f8eef4763c81
linux16 /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###
### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Windows Vista (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 20048CDA048CB3F6
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 ###
--------------------------------------------------------------------------------
=============================== sdb5/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/sda5 during installation
UUID=1e4d8d3b-c40b-4dc5-a48e-f8eef4763c81 / ext4 errors=remount-ro 0 1
# /home was on /dev/sdb1 during installation
UUID=b14adec9-7509-4918-85a5-c53b0d117c4e /home ext4 defaults 0 2
# swap was on /dev/sda1 during installation
#UUID=d38a06e4-f9dd-4733-835a-f3b18a1c937e none swap sw 0 0
/dev/mapper/cryptswap1 none swap sw 0 0
UUID=15fb2ca4-4ea6-4fcd-8cf0-f6cdf77f5bf5 /media/skye ext4 errors=remount-ro 0 2
--------------------------------------------------------------------------------
=================== sdb5: Location of files loaded by Grub:
====================
GiB - GB File
Fragment(s)
95.954025269 = 103.029850112 boot/grub/core.img 1
12.670200348 = 13.604524032 boot/grub/grub.cfg 1
13.791992188 = 14.809038848 boot/initrd.img-2.6.38-10-generic 2
6.629947662 = 7.118852096 boot/initrd.img-2.6.38-11-generic 3
4.106140137 = 4.408934400 boot/initrd.img-2.6.38-8-generic 1
5.358707428 = 5.753868288 boot/vmlinuz-2.6.38-10-generic 2
5.432926178 = 5.833560064 boot/vmlinuz-2.6.38-11-generic 2
95.947734833 = 103.023095808 boot/vmlinuz-2.6.38-8-generic 1
6.629947662 = 7.118852096 initrd.img 3
13.791992188 = 14.809038848 initrd.img.old 2
5.432926178 = 5.833560064 vmlinuz 2
5.358707428 = 5.753868288 vmlinuz.old 2
======================== Unknown MBRs/Boot Sectors/etc:
========================
Unknown BootLoader on sdb2
00000000 7a 69 56 5b 25 9b 1d c8 02 dd 38 c4 6c 18 3b ee |ziV[%.....8.l.;.|
00000010 a8 08 58 3a 16 4c d7 86 04 d3 0a 10 7b 74 a5 dc |..X:.L......{t..|
00000020 fb cd ec 39 94 e7 e8 24 73 a9 02 bd 12 27 e2 59 |...9...$s....'.Y|
00000030 97 a2 96 24 ff f9 dd 9e 72 c4 57 bb c6 ad dc 36 |...$....r.W....6|
00000040 83 c8 a3 8b bb bc 31 dc c9 40 59 24 1d 43 0f b3 |......1.. at Y$.C..|
00000050 b5 5b 89 70 c0 e0 bd 81 34 29 c1 ef e7 ed 15 2b |.[.p....4).....+|
00000060 d0 39 63 b1 b3 2b e1 fa 4f 60 bd 68 ac ad b9 63 |.9c..+..O`.h...c|
00000070 65 71 16 95 4a 56 b7 bf 7f 7c 27 93 e0 80 8b e2 |eq..JV...|'.....|
00000080 6c fd 5b fb bd d4 18 4f 58 04 23 06 d9 0f f7 1b |l.[....OX.#.....|
00000090 57 06 75 b8 cc 15 e2 1f 4c 44 1b fd a6 70 d1 3d |W.u.....LD...p.=|
000000a0 d2 87 ea 89 7e 84 cb 62 84 55 4b 67 7a 5c 56 fa |....~..b.UKgz\V.|
000000b0 10 c6 a4 19 89 fc d9 8f ce 99 1c af 07 09 fa 35 |...............5|
000000c0 bc 54 ab 35 7c ed 17 73 cd 11 16 71 b2 31 a7 fb |.T.5|..s...q.1..|
000000d0 96 a5 f7 e6 3a 02 c0 2e a1 65 a0 1f e3 d9 c4 77 |....:....e.....w|
000000e0 ff db 39 c9 ea be a9 e8 08 63 1f 23 27 3f 78 07 |..9......c.#'?x.|
000000f0 86 c8 ec 47 48 db 6f 80 2a 8d ed 52 2d 49 de 51 |...GH.o.*..R-I.Q|
00000100 e3 ba 2c cc f5 43 35 c6 10 5d 46 a1 ce 2f 49 5b |..,..C5..]F../I[|
00000110 c3 5d 7a 46 3b 94 94 5b 4f f7 3c 1d 57 13 a4 1c |.]zF;..[O.<.W...|
00000120 34 ca a9 f0 68 cd cd 25 5e a5 13 ce 8f 13 4a 1e |4...h..%^.....J.|
00000130 d9 f9 cc a9 f7 8c 22 5a d2 cd ce 9e 9c 37 ae af |......"Z.....7..|
00000140 66 9c 51 18 cc a4 2b d1 92 ea 07 fa 10 21 5a e2 |f.Q...+......!Z.|
00000150 0a aa c8 de d8 8b 3a c0 22 8e cf c9 92 7f 08 3d |......:."......=|
00000160 94 1d d4 ab 8a 66 02 f0 49 cd df c5 9f 3a ab 45 |.....f..I....:.E|
00000170 8b 7b a0 2f dc f1 4f dd 30 45 63 dd ed 2a 9a 64 |.{./..O.0Ec..*.d|
00000180 b5 96 7d f2 7d 78 c5 ed 04 e5 a8 23 bd 7d 0b cd |..}.}x.....#.}..|
00000190 d8 23 d5 ec e3 3c 56 f7 bd a0 bc 06 71 46 16 be |.#...<V.....qF..|
000001a0 7d e4 5c 9b 68 8f 9c 9b 34 55 47 99 38 a6 30 fd |}.\.h...4UG.8.0.|
000001b0 52 48 80 c5 2b e2 b6 39 4c fb ed 53 af 99 00 12 |RH..+..9L..S....|
000001c0 61 f2 83 fe ff ff 02 00 00 00 00 80 27 12 00 00 |a...........'...|
000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa |..............U.|
00000200
=============================== StdErr Messages: ===============================
unlzma: Decoder error
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/880925/+subscriptions
More information about the foundations-bugs
mailing list