PDA

View Full Version : Can't dualboot win7 and ubuntu.



Wechuks
July 4th, 2010, 04:30 PM
Hello there. I'm having a problem with dual booting win7 and ubuntu 10. I'll try to explain my situation as good as i can.

After buying a new laptop, I installed win7 64 bit on it. Since it came with FreeDOS OS, which were installed on another 50 GB partition, I decided to use that partition for something useful and installed Ubuntu 10.04 32 bit on it.

This is were the happy story ends, and the sad part comes. After installing Ubuntu, it boots itself, and shows no GRUB screen, where i could choose an OS... So basically I'm unable to configure/do something else with the GRUB so that it would show up at least... I'm ready to provide any information necessary.

Looking forward to any solutions to get my windows system back. I'm ready to give up Ubuntu if it's necessary, but I'd prefer to keep both OS's.

Thanks in advance.

darkod
July 4th, 2010, 04:44 PM
Lets see more details. Follow the boot info script link in my signature and run the script, post the content of the results file as explained. It will show more details about the boot process.

krishnandu.sarkar
July 4th, 2010, 04:45 PM
Try keeping pressed <shift> on boot screen(after the BIOS screen goes) to show the GRUB.

Wechuks
July 4th, 2010, 04:51 PM
just did bootinfo, results here.


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.

sda1: __________________________________________________ _______________________

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

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

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

/dev/sda1 63 122,832,989 122,832,927 83 Linux
/dev/sda2 122,833,051 976,751,999 853,918,949 f W95 Ext d (LBA)
/dev/sda5 * 122,833,053 976,751,999 853,918,947 7 HPFS/NTFS


blkid -c /dev/null: __________________________________________________ __________

Device UUID TYPE LABEL

/dev/sda1 0b664849-6698-411e-9c6c-fca84105ddf2 ext4
/dev/sda2: PTTYPE="dos"
/dev/sda5 AA8093C880939981 ntfs
/dev/sda: PTTYPE="dos"

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

Device Mount_Point Type Options

/dev/sda1 / ext4 (rw,errors=remount-ro)
/dev/sda5 /media/AA8093C880939981 fuseblk (rw,nosuid,nodev,allow_other,blksize=4096,default_ permissions)


=========================== sda1/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 ###
insmod part_msdos
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 ext2
set root='(hd0,1)'
search --no-floppy --fs-uuid --set 0b664849-6698-411e-9c6c-fca84105ddf2
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 ext2
set root='(hd0,1)'
search --no-floppy --fs-uuid --set 0b664849-6698-411e-9c6c-fca84105ddf2
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 ###
menuentry 'Ubuntu, with Linux 2.6.32-21-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd0,1)'
search --no-floppy --fs-uuid --set 0b664849-6698-411e-9c6c-fca84105ddf2
linux /boot/vmlinuz-2.6.32-21-generic root=UUID=0b664849-6698-411e-9c6c-fca84105ddf2 ro quiet splash
initrd /boot/initrd.img-2.6.32-21-generic
}
menuentry 'Ubuntu, with Linux 2.6.32-21-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd0,1)'
search --no-floppy --fs-uuid --set 0b664849-6698-411e-9c6c-fca84105ddf2
echo 'Loading Linux 2.6.32-21-generic ...'
linux /boot/vmlinuz-2.6.32-21-generic root=UUID=0b664849-6698-411e-9c6c-fca84105ddf2 ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.32-21-generic
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
insmod ext2
set root='(hd0,1)'
search --no-floppy --fs-uuid --set 0b664849-6698-411e-9c6c-fca84105ddf2
linux16 /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
insmod ext2
set root='(hd0,1)'
search --no-floppy --fs-uuid --set 0b664849-6698-411e-9c6c-fca84105ddf2
linux16 /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
if [ ${timeout} != -1 ]; then
if keystatus; then
if keystatus --shift; then
set timeout=-1
else
set timeout=0
fi
else
if sleep --interruptible 3 ; then
set timeout=0
fi
fi
fi
### 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 ###

=============================== sda1/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/sda1 during installation
UUID=0b664849-6698-411e-9c6c-fca84105ddf2 / ext4 errors=remount-ro 0 1

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


5.1GB: boot/grub/core.img
47.4GB: boot/grub/grub.cfg
5.2GB: boot/initrd.img-2.6.32-21-generic
5.1GB: boot/vmlinuz-2.6.32-21-generic
5.2GB: initrd.img
5.1GB: vmlinuz


Trying the shift thing as well now.

EDIT: I saw the bootscreen with shift indeed. Unfortunately no win7 there, but it's a progress at least.

krishnandu.sarkar
July 4th, 2010, 04:58 PM
Ok then try sudo update-grub

Wechuks
July 4th, 2010, 04:59 PM
Done. Here are the results.



Generating grub.cfg ...
Found linux image: /boot/vmlinuz-2.6.32-21-generic
Found initrd image: /boot/initrd.img-2.6.32-21-generic
Found memtest86+ image: /boot/memtest86+.bin
done

krishnandu.sarkar
July 4th, 2010, 05:01 PM
Hmm.....No menu entry for Windows 7. :(

darkod
July 4th, 2010, 05:03 PM
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: Windows 7
Boot files/dirs: /Windows/System32/winload.exe

You are missing the win7 boot files. What you didn't notice is that probably the boot files were installed onto the FreeDOS partition because they have to be on primary partition, and you installed win7 on a logical partition. Then when you installed ubuntu over the FreeDOS, it wiped the boot files.

Also, you don't have a swap partition for ubuntu, which is not the end of the world, but in some situations it will work better with it.

Always install windows on a primary partition, it has limitations to be on logical partitions.

Bottom line: If you still haven't started putting too much data and programs on either OS, just redo everything but this time plan your partitions first. You don't just start installing an OS without a plan.

If you are willing to do this, I can give you few pointers.

Otherwise, trying to save this will be only trouble. You don't have any primary ntfs partition to put the boot files there. And no easy way to make one.

Wechuks
July 4th, 2010, 05:13 PM
Looks like i'm f***ed. Or maybe - I really f***ed up here.

Redoing means loosing all data on both OSs?

also, how much trouble there is to save win7 data? nothing on Ubuntu yet, thanks god.

darkod
July 4th, 2010, 05:20 PM
1. Getting the win7 data is easy. You don't even have to boot it. Boot ubuntu and look in Places, your win7 partition should be there. Clicking on it will mount it and you can open it and copy anything you want on ext hdd for example.

2. If there is nothing on ubuntu yet, we can try and save this, although you would end up in "weird" setup. But it should work.

The line of thought is:
- using Gparted from ubuntu live mode, delete the ubuntu partition /dev/sda1 (note: this will make the computer temporarily unbootable)
- into that unallocated space, create 100MB ntfs primary partition, and set the boot flag on it, leave the rest of the space as unallocated
- run the win7 dvd and the repair process to fix the boot files which should place them on the 100MB /dev/sda1 then
- check that win7 is booting fine

Then continue with:
- start the ubuntu installer again, use manual partitioning and create primary ext4 / partition with mount point /
- also create primary 2-3GB swap partition, or if you plan to hibernate regularly 1.5 x RAM size
- finish this new ubuntu install

That should work.

Wechuks
July 4th, 2010, 05:25 PM
Going to do this.

Unfortunately, I can't run Ubuntu live from Cd, and it won't allow me to delete the partition from installed OS. can the creation of 100MB NTFS Partition be done on Ubuntu install?

Wechuks
July 4th, 2010, 05:48 PM
EDIT: I'm an idiot. delete this post.

darkod
July 4th, 2010, 06:00 PM
It can be done on ubuntu install but I was hoping to make win7 fully bootable first, and then install ubuntu. If you install ubuntu first, repairing win7 will overwrite grub2 again, so you have to reinstall grub2 also. It's just getting too much, although not impossible.

You should always be able to run live mode, it helps a lot with these kind of repair situations. Did you manage to run it?

Wechuks
July 4th, 2010, 06:30 PM
Yes, and i did all the steps in order you gave them.

There are boot folder in the 120MB partition

Hower still no windows in grub.

darkod
July 4th, 2010, 06:42 PM
Hold on, I wasn't talking about a linux /boot partition if that's what you created during the ubuntu install.

Did you run the win7 repair process with the dvd? Did it manage to boot win7 before you installed ubuntu again?

Run the script again and post the results if you are not sure what is what.

Wechuks
July 4th, 2010, 07:04 PM
actualy i didnt tried runing win7 b4 installing ubuntu again. my bad.



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 #4 for /boot/grub.

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: /Boot/BCD

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

sda3: __________________________________________________ _______________________

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

sda4: __________________________________________________ _______________________

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

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

/dev/sda1 * 63 240,974 240,912 7 HPFS/NTFS
/dev/sda2 122,833,051 976,751,999 853,918,949 f W95 Ext d (LBA)
/dev/sda5 122,833,053 976,751,999 853,918,947 7 HPFS/NTFS
/dev/sda3 241,664 4,202,495 3,960,832 82 Linux swap / Solaris
/dev/sda4 4,202,496 122,830,847 118,628,352 83 Linux


blkid -c /dev/null: __________________________________________________ __________

Device UUID TYPE LABEL

/dev/sda1 4D02EF0A595364B3 ntfs
/dev/sda2: PTTYPE="dos"
/dev/sda3 9cf30e54-2648-48a4-8ef4-6dddd3400af1 swap
/dev/sda4 32e562e2-d5a0-4810-95f6-2441d51f65aa ext4
/dev/sda5 AA8093C880939981 ntfs
/dev/sda: PTTYPE="dos"

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

Device Mount_Point Type Options

/dev/sda4 / ext4 (rw,errors=remount-ro)
/dev/sda1 /media/4D02EF0A595364B3 fuseblk (rw,nosuid,nodev,allow_other,blksize=4096,default_ permissions)


=========================== sda4/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 ext2
set root='(hd0,4)'
search --no-floppy --fs-uuid --set 32e562e2-d5a0-4810-95f6-2441d51f65aa
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 ext2
set root='(hd0,4)'
search --no-floppy --fs-uuid --set 32e562e2-d5a0-4810-95f6-2441d51f65aa
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 ###
menuentry 'Ubuntu, with Linux 2.6.32-21-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd0,4)'
search --no-floppy --fs-uuid --set 32e562e2-d5a0-4810-95f6-2441d51f65aa
linux /boot/vmlinuz-2.6.32-21-generic root=UUID=32e562e2-d5a0-4810-95f6-2441d51f65aa ro quiet splash
initrd /boot/initrd.img-2.6.32-21-generic
}
menuentry 'Ubuntu, with Linux 2.6.32-21-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd0,4)'
search --no-floppy --fs-uuid --set 32e562e2-d5a0-4810-95f6-2441d51f65aa
echo 'Loading Linux 2.6.32-21-generic ...'
linux /boot/vmlinuz-2.6.32-21-generic root=UUID=32e562e2-d5a0-4810-95f6-2441d51f65aa ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.32-21-generic
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
insmod ext2
set root='(hd0,4)'
search --no-floppy --fs-uuid --set 32e562e2-d5a0-4810-95f6-2441d51f65aa
linux16 /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
insmod ext2
set root='(hd0,4)'
search --no-floppy --fs-uuid --set 32e562e2-d5a0-4810-95f6-2441d51f65aa
linux16 /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
if [ ${timeout} != -1 ]; then
if keystatus; then
if keystatus --shift; then
set timeout=-1
else
set timeout=0
fi
else
if sleep --interruptible 3 ; then
set timeout=0
fi
fi
fi
### 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 ###

=============================== sda4/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/sda4 during installation
UUID=32e562e2-d5a0-4810-95f6-2441d51f65aa / ext4 errors=remount-ro 0 1
# swap was on /dev/sda3 during installation
UUID=9cf30e54-2648-48a4-8ef4-6dddd3400af1 none swap sw 0 0

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


60.2GB: boot/grub/core.img
45.2GB: boot/grub/grub.cfg
60.2GB: boot/initrd.img-2.6.32-21-generic
2.3GB: boot/vmlinuz-2.6.32-21-generic
60.2GB: initrd.img
2.3GB: vmlinuz

darkod
July 4th, 2010, 07:16 PM
You are still missing one file on sda1, /bootmgr. Sometimes it takes three passes of the repair process to fix all of it. Don't ask why, windows. :)

The file is not there, so it still doesn't get detected. But this is progress.

You can try running the repair process three more times, and try to see if win7 will boot. That will destroy grub2 on the MBR but it's easy to install it back.

Once win7 is booting fine, to reinstall grub2 back just boot in ubuntu live mode and execute:

sudo mount /dev/sda4 /mnt
sudo grub-install --root-directory=/mnt/ /dev/sda

After booting ubuntu run:

sudo update-grub

to find the new win7 boot files. It still won't exist in the boot menu the first time you boot ubuntu but that's normal.

Wechuks
July 4th, 2010, 08:29 PM
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-2.6.32-21-generic
Found initrd image: /boot/initrd.img-2.6.32-21-generic
Found memtest86+ image: /boot/memtest86+.bin
Found Windows 7 (loader) on /dev/sda1
done


Thanks. A lot.

darkod
July 4th, 2010, 08:35 PM
No problem. You got it sorted out. :)