1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Ubuntu 10.04 upgrade - Cant dual boot Windows 7

Discussion in 'Linux and Unix' started by 05026652, May 5, 2010.

Thread Status:
Not open for further replies.
Advertisement
  1. 05026652

    05026652 Thread Starter

    Joined:
    May 5, 2010
    Messages:
    17
    Hey there,

    Well certainly a rookie mistake made on my part here. I have a dual boot machine with Ubuntu and Win 7 installed. Yesterday I had a little play with my ubuntu install and upgraded to 10.04 Lucid Lynx. All was well until I went to boot into windows. When I select this option, the screen goes black, as ready to load then a little cursor is found in the top right hand corner flashing constantly. It looks similiar boot style to the Ubuntu OS.

    Any idea what has gone on?

    I can access my two HD drives in Ubuntu so data loss isnt a problem.

    Any ideas would be great. If you want any more information let me know

    Thanks
     
  2. saikee

    saikee

    Joined:
    Jun 11, 2004
    Messages:
    3,888
    Post here Ubuntu's /boot/grub/grub.cfg and the output of
    Code:
    fdisk -l
    Have you alered the disk order recently and confirm which one boots first?
     
  3. 05026652

    05026652 Thread Starter

    Joined:
    May 5, 2010
    Messages:
    17
    Ubuntu boot\grub\grub.cfg

    Code:
    #
    # 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,5)'
    search --no-floppy --fs-uuid --set bf80e28e-d819-46d9-aea1-6b164a98c5e9
    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,5)'
    search --no-floppy --fs-uuid --set bf80e28e-d819-46d9-aea1-6b164a98c5e9
    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,5)'
        search --no-floppy --fs-uuid --set bf80e28e-d819-46d9-aea1-6b164a98c5e9
        linux    /boot/vmlinuz-2.6.32-21-generic root=UUID=bf80e28e-d819-46d9-aea1-6b164a98c5e9 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,5)'
        search --no-floppy --fs-uuid --set bf80e28e-d819-46d9-aea1-6b164a98c5e9
        echo    'Loading Linux 2.6.32-21-generic ...'
        linux    /boot/vmlinuz-2.6.32-21-generic root=UUID=bf80e28e-d819-46d9-aea1-6b164a98c5e9 ro single 
        echo    'Loading initial ramdisk ...'
        initrd    /boot/initrd.img-2.6.32-21-generic
    }
    menuentry 'Ubuntu, with Linux 2.6.31-20-generic' --class ubuntu --class gnu-linux --class gnu --class os {
        recordfail
        insmod ext2
        set root='(hd0,5)'
        search --no-floppy --fs-uuid --set bf80e28e-d819-46d9-aea1-6b164a98c5e9
        linux    /boot/vmlinuz-2.6.31-20-generic root=UUID=bf80e28e-d819-46d9-aea1-6b164a98c5e9 ro   quiet splash
        initrd    /boot/initrd.img-2.6.31-20-generic
    }
    menuentry 'Ubuntu, with Linux 2.6.31-20-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
        recordfail
        insmod ext2
        set root='(hd0,5)'
        search --no-floppy --fs-uuid --set bf80e28e-d819-46d9-aea1-6b164a98c5e9
        echo    'Loading Linux 2.6.31-20-generic ...'
        linux    /boot/vmlinuz-2.6.31-20-generic root=UUID=bf80e28e-d819-46d9-aea1-6b164a98c5e9 ro single 
        echo    'Loading initial ramdisk ...'
        initrd    /boot/initrd.img-2.6.31-20-generic
    }
    ### END /etc/grub.d/10_linux ###
    
    ### BEGIN /etc/grub.d/20_memtest86+ ###
    menuentry "Memory test (memtest86+)" {
        insmod ext2
        set root='(hd0,5)'
        search --no-floppy --fs-uuid --set bf80e28e-d819-46d9-aea1-6b164a98c5e9
        linux16    /boot/memtest86+.bin
    }
    menuentry "Memory test (memtest86+, serial console 115200)" {
        insmod ext2
        set root='(hd0,5)'
        search --no-floppy --fs-uuid --set bf80e28e-d819-46d9-aea1-6b164a98c5e9
        linux16    /boot/memtest86+.bin console=ttyS0,115200n8
    }
    ### END /etc/grub.d/20_memtest86+ ###
    
    ### BEGIN /etc/grub.d/30_os-prober ###
    menuentry "Dell Utility Partition (on /dev/sda1)" {
        insmod fat
        set root='(hd0,1)'
        search --no-floppy --fs-uuid --set 07d6-0c14
        drivemap -s (hd0) ${root}
        chainloader +1
    }
    menuentry "Windows 7 (loader) (on /dev/sda2)" {
        insmod ntfs
        set root='(hd0,2)'
        search --no-floppy --fs-uuid --set c0b05f46b05f41d8
        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 ###
    
    

    I tried using the fdisk -l in terminal but nothing happened? Sorry I am a newb at the ubuntu etc.

    I haven't altered the disk order, and on boot screen Ubuntu boots first.

    I hope that made sense, thanks for the reply :D.
     
  4. saikee

    saikee

    Joined:
    Jun 11, 2004
    Messages:
    3,888
    This entry tells us your Ubuntu is in the 5th partition of the first disk (hd0)
    Code:
    menuentry '[COLOR="Purple"]Ubuntu, with Linux 2.6.32-21-generic[/COLOR]' --class ubuntu --class gnu-linux --class gnu --class os {
        recordfail
        insmod ext2
    [COLOR="Purple"]    set root='(hd0,5)'[/COLOR]
        search --no-floppy --fs-uuid --set bf80e28e-d819-46d9-aea1-6b164a98c5e9
        linux    /boot/vmlinuz-2.6.32-21-generic root=UUID=bf80e28e-d819-46d9-aea1-6b164a98c5e9 ro   quiet splash
        initrd    /boot/initrd.img-2.6.32-21-generic
    }
    These two entries tells us that you have a manufacturer driver/utility partition in the 1st partition and a Win7 on the 2nd partition of the same hard disk (hd0)
    Code:
    menuentry "[COLOR="Blue"]Dell Utility Partition[/COLOR] (on /dev/sda1)" {
        insmod fat
    [COLOR="Blue"]    set root='(hd0,1)'[/COLOR]
        search --no-floppy --fs-uuid --set 07d6-0c14
        drivemap -s (hd0) ${root}
        chainloader +1
    }
    menuentry "[COLOR="Red"]Windows 7[/COLOR] (loader) (on /dev/sda2)" {
        insmod ntfs
    [COLOR="Red"]    set root='(hd0,2)'[/COLOR]
        search --no-floppy --fs-uuid --set c0b05f46b05f41d8
        chainloader +1
    }
    
    Only your "fdisk -l" output can confirm if the above information is correct, as you have insisted that you have two hard
    drives whereas the bootloader thinks everything in one disk!

    In Ubuntu, or any other Linux, operating a system-related command requires root privilege, which corresponds to the Admin right of Win7, and you need to be in root (or run as Administrator). To do this in Ubuntu you type
    Code:
    sudo su
    and supply the normal user password.

    You will find "fdisk -l" responding differently.

    In your fdisk -l output the Win7 should boot if it is in /dev/sda2, has a partition type No. 7 and has a "*" indicating it has been marked active.
     
  5. 05026652

    05026652 Thread Starter

    Joined:
    May 5, 2010
    Messages:
    17
    Fdisk -l Output

    Code:
    Disk /dev/sda: 250.0 GB, 250000000000 bytes
    255 heads, 63 sectors/track, 30394 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0xe686f016
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1               1           8       64228+  de  Dell Utility
    /dev/sda2   *           9       15341   123162322+   7  HPFS/NTFS
    /dev/sda3           15342       29787   116037495    f  W95 Ext'd (LBA)
    /dev/sda4           29788       30393     4867695   db  CP/M / CTOS / ...
    /dev/sda5           15342       29787   116037463+  83  Linux
    
    Disk /dev/sdb: 250.0 GB, 250000000000 bytes
    255 heads, 63 sectors/track, 30394 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x00000081
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sdb3   *           1       30394   244139773+   7  HPFS/NTFS
    
    
    Thanks
     
  6. saikee

    saikee

    Joined:
    Jun 11, 2004
    Messages:
    3,888
    You have two NTFS partitions. One in /dev/sda2 of about 120Gb and another /dev/sdb3 250Gb in a separate disk. Linux and other systems do not know what their contents are. May be that is why Grub2 has gone to sda2.

    Since that doesn't boot so you must have put your MS system in the 250Gb disk.

    You can edit /boot/grub/grub.cfg by command
    Code:
    nano /boot/grub/grub.cfg
    altering the root statement from
    Code:
        set root='(hd0,[COLOR="Blue"]2[/COLOR])'
    to
    Code:
        set root='(hd1,[COLOR="Red"]3[/COLOR])'
    You can try this out manually in the following steps
    when you see the Grub boot screen don't boot anything but just press the "c" key into a Grub prompt and type these commands
    Code:
    set root=(hd1,3)
    chainloader +1
    boot
    If it works then proceed to amend the grub.cfg as suggested.

    In the above you fire up the Windows manually first to test the Grub2 commands.
     
  7. 05026652

    05026652 Thread Starter

    Joined:
    May 5, 2010
    Messages:
    17
    thanks mate ill give it a whirl now
     
  8. 05026652

    05026652 Thread Starter

    Joined:
    May 5, 2010
    Messages:
    17
    No such luck, I tried it out manually first and it went straight to the screen as I described earlier on?
     
  9. saikee

    saikee

    Joined:
    Jun 11, 2004
    Messages:
    3,888
    Can you tell us where is your Windowa installation?

    Is it in the first disk with Ubuntu as sda2? or in the second disk sdb3. You must have done some manipulations with the second hard disk to get it recognised as sdb3 where there isn't sdb1 and sdb2 there.

    If another partition has been created or found before your Windows in the booting queue then your Windows will not be able to boot up as a "c" drive. In such case it will not boot because the installed drive letter cannot be adhered to. In your case sda2 is the first partition recognised by a MS system and sdb3 is the 2nd in the queue. You need to tell us what the two are.

    Did you have Grub1 before? If you did then the original booting instructions will be in /boot/grub/menu.lst. Post it here. Grub1 can swap the disk order on the fly but I haven't gone deep enough how this is done in Grub2 which you are using.

    Haven't tried it myself but the internet information suggests that the change the disk order for booting a MS Windows installed in (hd0) but subsequently moved to (hd1) would be
    Code:
    drivemap hd0 hd1
    drivemap hd1 hd0
    to be issued before the "boot" command.
     
  10. 05026652

    05026652 Thread Starter

    Joined:
    May 5, 2010
    Messages:
    17
    I have two 250GB drives, now when I originally installed Ubuntu (about December time) i'm pretty sure that I partioned the first hard drive, so that I can run Win 7 and Ubuntu on it. The second drive was used primarily to store my data, music, uni work etc on.

    I have mounted both drives just for convenience, the drive that has Win 7 on has 117GB on it, the other has 232GB confirming that the two OS were installed on the first hard drive.

    I dont think Grub1 was used I cannot find the menu.lst file in the location provided.

    Does that help?
     
  11. saikee

    saikee

    Joined:
    Jun 11, 2004
    Messages:
    3,888
    I would suggest to boot the Win7 manually with these commands at a Grub2 prompt
    Code:
    set root=(hd0,2)
    chainloader +1
    boot 
    I am convinced your sdb3 is just a data partition and your 1st disk in the Bios is sda. There is nothing strange about your system.

    If the above fail you might have to recourse to the Win7 installation DVD and getting involved with bcdedit.ext, bootsect.exe and bootrec.exe.
     
  12. 05026652

    05026652 Thread Starter

    Joined:
    May 5, 2010
    Messages:
    17
    Ok so I have given that I try....still no luck. What needs to be done regarding the Win 7 DVD and bcedit.ext etc.??
     
  13. saikee

    saikee

    Joined:
    Jun 11, 2004
    Messages:
    3,888
    Basically you have to restore Win7 boot loader's MBR. That will temporarily disable your Ubuntu which you need the installation CD to restore Grub2 ultimately.

    To restore Win7 MBR you boot up the W7 DVD, opt for repair and select Command prompt. The command to restore W7 MBR is
    Code:
    bootrec /fixmbr
    Depending on how your W7 current state the bootsect.exe can be used to restore its boot sector. Bcdedit.exe is used to edit the booting menu. The boot.rec can be used to rebuild the booting menu from scratch.
     
  14. 05026652

    05026652 Thread Starter

    Joined:
    May 5, 2010
    Messages:
    17
    Alright mate ill give that a try. Thanks for the help :D
     
  15. omalsa04

    omalsa04

    Joined:
    May 11, 2010
    Messages:
    4
  16. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/921261

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice