PDA

View Full Version : [ubuntu] 10.04 boot loader is missing.



codecutter
June 21st, 2010, 02:54 AM
I recently upgraded to Ubuntu 10.04 and everything was working fine. Last week I was away from home and when I returned, my wife told me that she cannot boot in Ubuntu. We have used dual boot for Windows Vista and Ubuntu. Now only Windows was working. So I created a LiveCD from Ubuntu website and tried to boot.

I can boot using LiveCD. Then I tried to install grub. I forgot exact commands I found online, but something to do with /dev/hda1) and now everything is messed up. It does not show boot menu (to select OS) at all. It only shows grub> window. I believe that the OS on the computer is alright, just the boot option is gone. I do not know how to get back the grub. Any help will be appreciated.

When booting from LiveCD,df /boot shows filesystem as aufs (no idea what it is). If I go through File browser, I can see the windows files and my Ubuntu installation. So I believe OS is okay, just not the boot loader.

Any help to get the dual boot option will be appreciated.

Thanks.

wilee-nilee
June 21st, 2010, 03:02 AM
Post the bootscript in my signature in code tags if you can;)

codecutter
June 21st, 2010, 03:38 AM
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 #1 for /boot/grub.
=> Windows is installed in the MBR of /dev/sdb

sda1: __________________________________________________ _______________________

File system: vfat
Boot sector type: Dell Utility: Fat16
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files/dirs: /boot/grub/core.img /COMMAND.COM

sda2: __________________________________________________ _______________________

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

sda3: __________________________________________________ _______________________

File system: ntfs
Boot sector type: Windows Vista/7
Boot sector info: No errors found in the Boot Parameter Block.
Operating System: Windows Vista
Boot files/dirs: /bootmgr /Boot/BCD /Windows/System32/winload.exe
/wubildr.mbr /ubuntu/winboot/wubildr.mbr /wubildr
/ubuntu/winboot/wubildr /ubuntu/disks/root.disk
/ubuntu/disks/swap.disk

sda3/Wubi: __________________________________________________ _______________________

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

sdb1: __________________________________________________ _______________________

File system: vfat
Boot sector type: MSWIN4.1: Fat 32
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files/dirs: /boot.ini /ntldr /NTDETECT.COM

sdc: __________________________________________________ _______________________

File system: vfat
Boot sector type: Fat16
Boot sector info: According to the info in the boot sector, sdc has 0
sectors.
Operating System:
Boot files/dirs:

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

Drive: sda ___________________ __________________________________________________ ___

Disk /dev/sda: 250.0 GB, 250000000000 bytes
255 heads, 63 sectors/track, 30394 cylinders, total 488281250 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 63 112,454 112,392 de Dell Utility
/dev/sda2 112,640 21,084,159 20,971,520 7 HPFS/NTFS
/dev/sda3 * 21,084,160 488,278,015 467,193,856 7 HPFS/NTFS


Drive: sdb ___________________ __________________________________________________ ___

Disk /dev/sdb: 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 End Size Id System

/dev/sdb1 63 976,768,064 976,768,002 c W95 FAT32 (LBA)


blkid -c /dev/null: __________________________________________________ __________

Device UUID TYPE LABEL

/dev/loop0 squashfs
/dev/loop1 7d28f5c6-afda-4062-906b-901de179df0b ext4
/dev/sda1 07D8-080C vfat DellUtility
/dev/sda2 2E1402B214027CD9 ntfs RECOVERY
/dev/sda3 FCBE04F7BE04AC68 ntfs OS
/dev/sda: PTTYPE="dos"
/dev/sdb1 4CB2-296C vfat My Book
/dev/sdb: PTTYPE="dos"
/dev/sdc 34A5-FC4A vfat PHONE

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

Device Mount_Point Type Options

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


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


??GB: boot/grub/core.img

======================== sda3/Wubi/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 $prefix/grubenv ]; then
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
}
insmod ntfs
set root='(hd0,3)'
search --no-floppy --fs-uuid --set fcbe04f7be04ac68
loopback loop0 /ubuntu/disks/root.disk
set root=(loop0)
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
insmod ntfs
set root='(hd0,3)'
search --no-floppy --fs-uuid --set fcbe04f7be04ac68
loopback loop0 /ubuntu/disks/root.disk
set root=(loop0)
set locale_dir=($root)/boot/grub/locale
set lang=en
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 ###
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/10_lupin ###
menuentry "Ubuntu, Linux 2.6.32-22-generic" {
insmod ntfs
set root='(hd0,3)'
search --no-floppy --fs-uuid --set fcbe04f7be04ac68
loopback loop0 /ubuntu/disks/root.disk
set root=(loop0)
linux /boot/vmlinuz-2.6.32-22-generic root=/dev/sda3 loop=/ubuntu/disks/root.disk ro quiet splash
initrd /boot/initrd.img-2.6.32-22-generic
}
menuentry "Ubuntu, Linux 2.6.32-22-generic (recovery mode)" {
insmod ntfs
set root='(hd0,3)'
search --no-floppy --fs-uuid --set fcbe04f7be04ac68
loopback loop0 /ubuntu/disks/root.disk
set root=(loop0)
linux /boot/vmlinuz-2.6.32-22-generic root=/dev/sda3 loop=/ubuntu/disks/root.disk ro single
initrd /boot/initrd.img-2.6.32-22-generic
}
menuentry "Ubuntu, Linux 2.6.31-21-generic" {
insmod ntfs
set root='(hd0,3)'
search --no-floppy --fs-uuid --set fcbe04f7be04ac68
loopback loop0 /ubuntu/disks/root.disk
set root=(loop0)
linux /boot/vmlinuz-2.6.31-21-generic root=/dev/sda3 loop=/ubuntu/disks/root.disk ro quiet splash
initrd /boot/initrd.img-2.6.31-21-generic
}
menuentry "Ubuntu, Linux 2.6.31-21-generic (recovery mode)" {
insmod ntfs
set root='(hd0,3)'
search --no-floppy --fs-uuid --set fcbe04f7be04ac68
loopback loop0 /ubuntu/disks/root.disk
set root=(loop0)
linux /boot/vmlinuz-2.6.31-21-generic root=/dev/sda3 loop=/ubuntu/disks/root.disk ro single
initrd /boot/initrd.img-2.6.31-21-generic
}
### END /etc/grub.d/10_lupin ###

### BEGIN /etc/grub.d/20_memtest86+ ###
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Windows Recovery Environment (loader) (on /dev/sda3)" {
insmod ntfs
set root='(hd0,3)'
search --no-floppy --fs-uuid --set fcbe04f7be04ac68
drivemap -s (hd0) ${root}
chainloader +1
}
menuentry "Microsoft Windows XP Home Edition (on /dev/sdb1)" {
insmod fat
set root='(hd1,1)'
search --no-floppy --fs-uuid --set 4cb2-296c
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 ###

============================= sda3/Wubi/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
/host/ubuntu/disks/root.disk / ext4 loop,errors=remount-ro 0 1
/host/ubuntu/disks/swap.disk none swap loop,sw 0 0
/dev/scd1 /media/cdrom1 udf,iso9660 user,noauto,exec,utf8 0 0

================= sda3/Wubi: Location of files loaded by Grub: =================


.7GB: boot/grub/grub.cfg
10.3GB: boot/initrd.img-2.6.31-21-generic
8.3GB: boot/initrd.img-2.6.32-22-generic
7.5GB: boot/vmlinuz-2.6.31-21-generic
8.0GB: boot/vmlinuz-2.6.32-22-generic
8.3GB: initrd.img
10.3GB: initrd.img.old
8.0GB: vmlinuz
7.5GB: vmlinuz.old

================================ sdb1/boot.ini: ================================

[boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(2)\WINDOW S
[operating systems]
multi(0)disk(0)rdisk(0)partition(2)\WINDOWS="Microsoft Windows XP Home Edition" /noexecute=optin /fastdetect

wilee-nilee
June 21st, 2010, 03:48 AM
sda1: __________________________________________________ _______________________

File system: vfat
Boot sector type: Dell Utility: Fat16
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files/dirs: /boot/grub/core.img /COMMAND.COM

This is the base of your problem. I'm not real familiar with wubi, but even on a true dual boot grub would only go to sda.

This is not a true dual boot it is a pseudo virtual which means that Ubuntu is not in a partition on its own with its own grub boot but in a file in Windows.

I also see the boot flag on the wubi rather then on the sda1 where it probably should be.

You will need a wubi person for help, and the script was important to get the information needed to fix this problem.

codecutter
June 21st, 2010, 03:57 AM
You are right. Ubuntu is installed in a directory under Windows environemnt. Other than that information, I am a complete newbie in Ubuntu, but I am trying to learn. Thanks for your help. I will wait for some advice in Wubi area.

wilee-nilee
June 21st, 2010, 04:16 AM
You are right. Ubuntu is installed in a directory under Windows environment. Other than that information, I am a complete newbie in Ubuntu, but I am trying to learn. Thanks for your help. I will wait for some advice in Wubi area.

So you might consider a real dual boot as if it was this would be a easy fix. As it is the fix has to be done with the MS bootloader and then make sure Ubuntu can boot then from it. The other advantage of a true dual boot is that the master boot record where the boot is, is easy to reload with grub or the MS bootloader if you wanted to change distros' or remove one.

codecutter
June 21st, 2010, 04:31 AM
Well, at this point, I just want the Windows to start somehow, even if Ubuntu does not start. Unfortunately I don't even get the OS selection screen, so cannot start windows.

Maybe later, I will check the pros and cons of making it a real dual boot.

oldfred
June 21st, 2010, 05:07 AM
I do not use wubi.

But you followed the instructions to repair a full install. A wubi install is just a file inside the windows partition and relies on the window boot loader to work.

You first need to restore the windows boot loader. You can run fixMBR from a windows repair disk or from Ubuntu liveCD.

Restore basic windows boot loader - universe enabled
sudo apt-get install lilo
sudo lilo -M /dev/sda mbr
May show error messages about the rest of lilo missing, ignore, we just want MBR

https://wiki.ubuntu.com/WubiGuide
https://help.ubuntu.com/community/Wubi
The Windows-based Ubuntu Installer (Wubi) allows you to install and uninstall Ubuntu from within Microsoft Windows. It lets a Microsoft Windows user try Ubuntu without risking any data loss due to disk formatting or partitioning.

http://howsoftwareisbuilt.com/2009/03/12/interview-with-agostino-russo-wubi-ubuntu/
Agostino: Wubi actually wasn’t designed to do long-term installations. The main aim was really to let people try out Ubuntu with confidence. Normally, users that start with Wubi tend to upgrade to a full installation to a dedicated partition at the next release cycle.

If you had problems before that you were trying to fix, none of this will help that. But it should let you get back into windows.

codecutter
June 21st, 2010, 05:44 AM
oldfred,
Thanks a lot. It worked and I could log in to Windows.

I did not know Wubi is supposed to be a temporary solution and it would be preferred to install Ubuntu in a separate partition. I will do more research and install Ubuntu in a separate partition. My only question: will it transfer my current Ubuntu installation? I have a lot of stuff already which I don't want to lose.

Ideally I would like to just get rid of windows, but my wife and kids want to use windows. Well, hopefully one day, I will be able to convert them to Linux. :p

Once again, thanks for your time.

wilee-nilee
June 21st, 2010, 06:26 AM
oldfred,
Thanks a lot. It worked and I could log in to Windows.

I did not know Wubi is supposed to be a temporary solution and it would be preferred to install Ubuntu in a separate partition. I will do more research and install Ubuntu in a separate partition. My only question: will it transfer my current Ubuntu installation? I have a lot of stuff already which I don't want to lose.

Ideally I would like to just get rid of windows, but my wife and kids want to use windows. Well, hopefully one day, I will be able to convert them to Linux. :p

Once again, thanks for your time.

No the install in a new partition will not automatically transfer. I suspect that you can do the install and transfer media from the Ubuntu file in windows though, but you will have to shrink windows before installing the new partition, and always back up stuff before doing anything.

But the best thing to do really is to have it all saved to a external HD including your MS stuff, so no matter what, your backed up and all you have to do is install a fresh OS nothing lost if there are problems.

Some people will suggest having a separate home partition, from the Ubuntu install to save things, but windows wont read a ext4 partition so if you wanted to have access by either OS a shared ntfs partition or external is what I would do. The separate home though will save your setup so that if you upgrade Ubuntu to the next distro you can leave home set and just upgrade the partition that has the OS in it.

oldfred
June 21st, 2010, 04:48 PM
I had to plan ahead on converting spouse from XP to Linux. I first switched to thunderbird & firefox. Then only used openoffice. When I was working I still needed windows apps but for home use only used the windows versions of the open apps. Then when converteding to Linux the change was minimal. If your kids want games you may have to dual boot for a long time but with a shared NTFS data partition you will find it easier to use both and have data easily available whichever your have booted.

I save this. Some have used the LVPM process, but it has not been updated for the new versions and does not install grub2 correctly. If you try it assume some repairs and a reinstall of grub2.
Old conversion LVPM, see Alternative Instructions
http://ubuntuforums.org/showthread.php?t=438591
1. Create 3 new partitions with the Partition Manager : a 10-20 GB (ext3 or ext4 format) partition to use as root (/), a ~2 GB (equal to RAM size) (swap format) partition to use as swap, and make the rest a (ext3 or ext4 format) partition to use as /home.
2. Boot back into the Wubi-generated Ubuntu install, mount the new partition that will be used as /home in the dedicated-partition install to /media/disk, and copy the contents of the current /home recursively over to the new partition:
rsync -avx /home/ /media/disk
Additionally, if you want to avoid the hassle of manually reinstalling all the packages you currently have installed, run:
dpkg --get-selections > selections.dpkg
That'll generate a list of packages you have installed (back up that list to somewhere safe); after reinstalling the system, just open Synaptic, go file > read markings, select that file that was generated (selections.dpkg), press apply, and it'll reinstall all the software you have on your current system ).
Repair LVPM conversion:
http://ubuntuforums.org/showthread.php?t=1501751