PDA

View Full Version : [lubuntu] Ubuntu 11.04 lost in dual boot after updating win 7



gpetrov
May 3rd, 2011, 08:19 PM
I was using dual boot (windows 7 and ubuntu 10.10) and it was going well. Couple of days ago I updated to Ubuntu 11.04 and everything was OK. Yesterday I cought some virus in windows, installed Microsoft security essentials which asked to update Windows.
After update, dual boot is gone. It boots to windows directly with no option to choose between OS.

Any help is appreciated!

Boot Info Script 0.55 dated February 15th, 2010

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

=> Windows is installed in the MBR of /dev/sda

sda1: __________________________________________________ _______________________

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

sda2: __________________________________________________ _______________________

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

sda3: __________________________________________________ _______________________

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

sda5: __________________________________________________ _______________________

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

sda6: __________________________________________________ _______________________

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

sda4: __________________________________________________ _______________________

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

=========================== 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 End Size Id System

/dev/sda1 * 2,048 206,847 204,800 7 HPFS/NTFS
/dev/sda2 206,848 81,922,047 81,715,200 7 HPFS/NTFS
/dev/sda3 81,924,094 206,921,727 124,997,634 5 Extended
/dev/sda5 81,924,096 89,735,167 7,811,072 82 Linux swap / Solaris
/dev/sda6 89,737,216 206,921,727 117,184,512 83 Linux
/dev/sda4 206,933,265 488,392,064 281,458,800 7 HPFS/NTFS


blkid -c /dev/null: __________________________________________________ __________

Device UUID TYPE LABEL

/dev/loop0 squashfs
/dev/sda1 A6D48207D481DA47 ntfs System Reserved
/dev/sda2 BAE08F9BE08F5D0F ntfs
/dev/sda3: PTTYPE="dos"
/dev/sda4 4754F4704E8353F5 ntfs D
/dev/sda5 daf31244-eeb8-4b29-9b2e-5d638b33c1ec swap
/dev/sda6 453db53e-eed2-430e-a9f7-d07f47a0a646 ext4
/dev/sda: PTTYPE="dos"

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

Device Mount_Point Type Options

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


=========================== 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="5"
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 453db53e-eed2-430e-a9f7-d07f47a0a646
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 453db53e-eed2-430e-a9f7-d07f47a0a646
set locale_dir=($root)/boot/grub/locale
set lang=en_US
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-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 453db53e-eed2-430e-a9f7-d07f47a0a646
linux /boot/vmlinuz-2.6.38-8-generic root=UUID=453db53e-eed2-430e-a9f7-d07f47a0a646 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 453db53e-eed2-430e-a9f7-d07f47a0a646
echo 'Loading Linux 2.6.38-8-generic ...'
linux /boot/vmlinuz-2.6.38-8-generic root=UUID=453db53e-eed2-430e-a9f7-d07f47a0a646 ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.38-8-generic
}
submenu "Previous Linux versions" {
menuentry 'Ubuntu, with Linux 2.6.35-25-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 453db53e-eed2-430e-a9f7-d07f47a0a646
linux /boot/vmlinuz-2.6.35-25-generic root=UUID=453db53e-eed2-430e-a9f7-d07f47a0a646 ro quiet splash vt.handoff=7
initrd /boot/initrd.img-2.6.35-25-generic
}
menuentry 'Ubuntu, with Linux 2.6.35-25-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 453db53e-eed2-430e-a9f7-d07f47a0a646
echo 'Loading Linux 2.6.35-25-generic ...'
linux /boot/vmlinuz-2.6.35-25-generic root=UUID=453db53e-eed2-430e-a9f7-d07f47a0a646 ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.35-25-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 453db53e-eed2-430e-a9f7-d07f47a0a646
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 453db53e-eed2-430e-a9f7-d07f47a0a646
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 A6D48207D481DA47
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=453db53e-eed2-430e-a9f7-d07f47a0a646 / ext4 errors=remount-ro 0 1
# swap was on /dev/sda5 during installation
UUID=daf31244-eeb8-4b29-9b2e-5d638b33c1ec none swap sw 0 0

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


68.2GB: boot/grub/core.img
68.4GB: boot/grub/grub.cfg
46.6GB: boot/initrd.img-2.6.35-25-generic
49.5GB: boot/initrd.img-2.6.38-8-generic
68.6GB: boot/vmlinuz-2.6.35-25-generic
48.4GB: boot/vmlinuz-2.6.38-8-generic
49.5GB: initrd.img
46.6GB: initrd.img.old
48.4GB: vmlinuz
68.6GB: vmlinuz.old

lboorse2
May 3rd, 2011, 08:27 PM
Interesting. When I was trying to clear an Ubuntu installation from a dual boot, I couldn't get it to boot to Windows without going through Grub for the life of me.

That said, you should be able to boot from the LiveCD, open a terminal and run the command "sudo update-grub". That should search for all installations/partitions, and rebuild the grub menu.

Give that a try and let us know what happens.

gpetrov
May 3rd, 2011, 08:30 PM
Update grub gives me some error

ubuntu@ubuntu:~$ sudo update-grub
/usr/sbin/grub-probe: error: cannot stat `aufs'.

deltacomp
May 3rd, 2011, 08:34 PM
Hello, I think you may need to reinstall/update grub? Boot into a live CD, mount the Ubuntu partition by gioing to places, selecting the ubuntu partition. Then try to update grub:

sudo update-grub2

If you think you need to reinstall grub follow this guide.

https://help.ubuntu.com/community/RecoveringUbuntuAfterInstallingWindows

coffeecat
May 3rd, 2011, 08:35 PM
Curious. Microsoft Security Essentials has reinstalled Windows code to the mbr, overwriting the grub code. Which is - uh - helpful of it.

You need to reinstall grub to the mbr, but you must use a Natty/11.04 live CD, not the Maverick/10.10 one. Maverick uses grub version 1.98 and Natty 1.99. There are significant developments in 1.99 such that you need the same version grub code in the mbr as in your root partition.

Boot up the Natty live CD and choose "try Ubuntu" to get to the desktop. Open a terminal, and:


sudo mount /dev/sda6 /mnt
sudo grub-install --boot-directory=/mnt/boot /dev/sdaPlease note that the --boot-directory switch is new in Natty and is to be preferred, in case someone tries to tell you that should be --root-directory.

Once you've done that you should see your grub menu again.

There is no point in running update-grub from the live CD, unless you chroot into your permanent installation. You probably don't need to run it anyway, because your grub.cfg looks OK.

deltacomp
May 3rd, 2011, 08:37 PM
Interesting. When I was trying to clear an Ubuntu installation from a dual boot, I couldn't get it to boot to Windows without going through Grub for the life of me.

That said, you should be able to boot from the LiveCD, open a terminal and run the command "sudo update-grub". That should search for all installations/partitions, and rebuild the grub menu.

Give that a try and let us know what happens.

Pretty sure that Ubuntu 11.04 will be using grub2, so I think the command needs a 2 at the end.

"sudo update-grub2"

gpetrov
May 3rd, 2011, 08:46 PM
It worked thanks to Coffeecat!:)
Everything is fine now!

Thanks a lot guys, problem solved in minutes, that can happen only within Linux community

coffeecat
May 3rd, 2011, 09:05 PM
@gpetrov, I'm glad it's working. :) I'll remember that about Security Essentials if I ever need it.


Pretty sure that Ubuntu 11.04 will be using grub2, so I think the command needs a 2 at the end.

"sudo update-grub2"

/usr/sbin/update-grub2 is a symlink to /usr/sbin/update-grub in systems with grub2 installed, so it doesn't matter which you run. Except in this case it was not the appropriate command to run. The script update-grub refreshes grub.cfg. The OP needed grub-install to re-install grub to the mbr and embedding area.