Home > Ubuntu > How to add Vista/Windows 7 partition to Grub 2 (Ubuntu 9.10, Karmic Koala)

How to add Vista/Windows 7 partition to Grub 2 (Ubuntu 9.10, Karmic Koala)

Today I decided to give Ubuntu 9.10 (Karmic Koala) a try. I’m using my old laptop for testing purposes. At the moment I have there Windows 7 and Ubuntu 9.04 installed and I can use them both with dual booting. I had no vital documents on my Ubuntu partition so I decided to do a clean install. Karmic Alpha 2 was just released and compared to Alpha 1 it was now using GRUB 2. Install went smoothly with no particular issues so I booted to Karmic and messed around a bit. Then logged off again rebooted, ready to use Windows. Imagine my surprise when there was no boot to Windows option in GRUB.
Here’s what I did to add it. I booted up to Karmic again. Now I only had 1 hard drive, but several partitions. I needed to find out which one was my windows partition. To do that I started a terminal and used the following command:

# sudo fdisk -l /dev/sda

According to this my Windows partition is hda1. To continue with my plan to add Windows boot option I typed in the following line:

# sudo nano /etc/grub.d/11_Windows

This created a new a new file. I then added the following lines:

#! /bin/sh -e
echo “Adding Windows” >&2
cat << EOF
menuentry “Windows 7” {
set root=(hd0,1)
chainloader +1
}
EOF

Now save the 11_Windows file.

Bare in mind that in earlier version of GRUB, if your Windows was installed on first partition then you need to give root=(hd0,0). Thats how GRUB used to number partitions. Starting from GRUB 2, you need to give root=(hd0,1), if your Windows is installed on first partition. So under GRUB 2 it looks like this:

First partition (/dev/sda1): root=(hd0,1)

Next type the following command:

# sudo chmod a+x /etc/grub.d/11_Windows

Next type in the following command:

# sudo update-grub

You should be able to see something like this:

# sudo update-grub
Generating grub.cfg …
Found linux image: /boot/vmlinuz-2.6.30-9-generic
Found initrd image: /boot/initrd.img-2.6.30-9-generic
Found linux image: /boot/vmlinuz-2.6.30-8-generic
Found initrd image: /boot/initrd.img-2.6.30-8-generic
Adding Windows
Found memtest86+ image: /boot/memtest86+.bin
done

Now close all the open programs and type in the following command to your terminal:

# sudo reboot

If all went well you should see Windows 7 option in your GRUB2.

-Eric

Advertisements
Categories: Ubuntu Tags: , , ,
  1. Geert
    June 17, 2009 at 6:17 pm

    Thank you,

    it works !!!!!!!!!!!!!!!!!!!!!

  2. Joe Chrysler
    August 10, 2009 at 2:47 am

    Thanks for this informative, quick and effective solution!

  3. piggy
    August 14, 2009 at 8:05 pm

    Thanks worked for me

  4. Jon
    September 21, 2009 at 10:36 pm

    ur amazing thnx

  5. Juchmis
    October 20, 2009 at 9:35 pm

    Also works with Vista, XP, etc (all windows)

    Very quick way to do it if GRUB screws up and doesn’t add Vista/7/XP to the list automatically

  6. Fabien
    October 30, 2009 at 7:25 pm

    I had a hard time figuring out the problem on my computer! I have windows on a separate harddisks (not partitions).

    There for the boot to work it should be:

    menuentry “Microsoft Windows” {
    insmod ntfs
    insmod chain
    insmod drivemap
    set root=(hd1,1)
    drivemap -s (hd1) (hd0)
    chainloader +1
    }

    hd1 (in this exmaple) <- the harddisk where windows is
    hd0 (in this example) is where grub is installed (the drivemap) is really important

    • Tzes
      November 6, 2010 at 3:21 pm

      Same for me!!!
      sda 320GB/ Windows 7 / 100MB secret partition
      sdb 160GB/ Windows XP / Ubuntu / Swap
      And I get “error 15: file not found”
      Is that safe???
      The last time I ve tried to fix this problem I put GRUB2 in Windows disk…
      And this is something I want to avoid.
      And after that I completely destroyed Windows MRB
      Yeah for me!!! 😦
      So can I use 11_Windows file method with Fabien way???

  7. miche
    November 3, 2009 at 2:34 am

    my win 7 install put the boot in a hidden partition….would the method explained above work the same?
    im dying to install KK on my pc but i cannot loose win for work.
    thanks

    m

  8. wassim
    November 12, 2009 at 6:44 pm

    thanks a lot, it’s simple and it works :))

  9. Usman
    November 27, 2009 at 10:56 pm

    hey eric, could you help me out. my windows 7 is on drive C: which is hd0,1 (/dev/sda1) but no matter how many times I follow your technique, “Adding windows” never comes. please help.

  10. Andre
    December 8, 2009 at 6:19 pm

    i´ve tried this tutorial but when my computer reboots it show me this

    error: too many titles for menuentry: 7″

    and then ubuntu 9.10 boots up… what should i do?
    :S

    thanks in advance

    • December 8, 2009 at 9:53 pm

      perhaps u got a typo somewhere ? i would recommend going it over agan

      • brad
        January 4, 2010 at 10:35 pm

        I too am getting the same problem as Andre. I’ve checked and rechecked what you suggested above, even to the extend of copy and pasting it all with gedit.

        Still trying to figure out how to fix this. Any suggestions?

      • January 4, 2010 at 10:59 pm

        have you tried lanteshis option ?

        “too many titles for menuentry: 7″

        I had this issue too. The issue lies in Windows, not Linux. I had to use the Win CD to re-write Win to the MBR, and then use my live Linux Mint CD to re-write Grub2 back to the MBR. After that I was able to get things working

      • Andi
        March 9, 2010 at 6:10 pm

        Hi, at the moment i have the issue that grub failed to boot my windows 7 after i select it in grub menu. The loading cursor is blinking but nothing is done after i select it. No error message occurs. Before it i had the problem that the grub menu was disabled, but it could be fixed by changing following property #GRUB_HIDDEN_TIMEOUT=0.

        Has anyone this issue too ?

      • Jorn
        March 19, 2010 at 1:56 am

        I had the same problem.
        The issue lies in the copy pasting from the code above.
        With pasting in the terminal in nano the left apostrophe and the right apostrophe of “Windows 7” aren’t the same.. If you edit these apostrophes, it works.

  11. Ivan
    December 9, 2009 at 11:41 am

    Hey Eric!
    Thanks for the tutorial, I did as you said but still nothing happened. I have 2 hard drives all of which are internal. Grub is installed on one, and Windows is installed on the other one. The problem is, that I think the Windows 7 and XP loader was on the drive which I erased for Ubuntu….I have no idea how to configure Windows 7 to boot with grub…..

    • December 9, 2009 at 12:48 pm

      Can you show me the printout of this command sudo fdisk -l /dev/sda
      and also can u show me the file u created for the windows partition.

  12. Ivan
    December 9, 2009 at 8:41 pm

    that’s fdisk -l /dev/sda
    Disk /dev/sda: 160.0 GB, 160041885696 bytes
    255 heads, 63 sectors/track, 19457 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Disk identifier: 0x0006a321

    Device Boot Start End Blocks Id System
    /dev/sda1 2 6581 52853850 f W95 Ext’d (LBA)
    /dev/sda2 * 6582 12803 49978215 83 Linux
    /dev/sda3 12804 18060 42226852+ b W95 FAT32
    /dev/sda4 18061 19457 11221402+ 82 Linux swap / Solaris
    /dev/sda5 2 6581 52853818+ b W95 FAT32

    here’s fdisk -l

    Disk /dev/sda: 160.0 GB, 160041885696 bytes
    255 heads, 63 sectors/track, 19457 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Disk identifier: 0x0006a321

    Device Boot Start End Blocks Id System
    /dev/sda1 2 6581 52853850 f W95 Ext’d (LBA)
    /dev/sda2 * 6582 12803 49978215 83 Linux
    /dev/sda3 12804 18060 42226852+ b W95 FAT32
    /dev/sda4 18061 19457 11221402+ 82 Linux swap / Solaris
    /dev/sda5 2 6581 52853818+ b W95 FAT32

    Disk /dev/sdb: 500.1 GB, 500107862016 bytes
    255 heads, 63 sectors/track, 60801 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Disk identifier: 0xfe0da636

    Device Boot Start End Blocks Id System
    /dev/sdb1 1 60801 488384001 7 HPFS/NTFS

    Disk /dev/sdg: 8086 MB, 8086618112 bytes
    249 heads, 62 sectors/track, 1023 cylinders
    Units = cylinders of 15438 * 512 = 7904256 bytes
    Disk identifier: 0x000b6296

    Device Boot Start End Blocks Id System
    /dev/sdg1 * 1 1023 7896506 c W95 FAT32 (LBA)
    Partition 1 has different physical/logical endings:
    phys=(1023, 248, 62) logical=(1022, 248, 62)

    And the file is:

    #! /bin/sh -e
    echo “Adding Windows” >&2
    cat << EOF
    menuentry “Windows 7″ {
    set root=(hd1,1)
    chainloader +1
    }
    EOF

    Thanks

    • December 9, 2009 at 9:34 pm

      which one is the part (harddrive) where win 7 is installed on ?

  13. Ivan
    December 10, 2009 at 10:08 am

    Windows 7 is on the

    /dev/sdb1

    partition.

    • December 10, 2009 at 12:38 pm

      if u scroll up and check comments, u will see the fabiens comment, he had the same issue as u and the solutions is there. I will add it to my post with his permission 🙂

      • Ivan
        December 10, 2009 at 1:27 pm

        Oh ok, I saw that, but am I supposed to put hd1 or /dev/sdb1 in the drive?

  14. Aleksey
    December 14, 2009 at 3:54 am

    Eric, I have the same problem like Andre: too many titles for menuentry: 7
    I have 2 ntfs partitions, and 7 installed on the second.

    • Lantesh
      December 28, 2009 at 2:05 am

      “too many titles for menuentry: 7”

      I had this issue too. The issue lies in Windows, not Linux. I had to use the Win CD to re-write Win to the MBR, and then use my live Linux Mint CD to re-write Grub2 back to the MBR. After that I was able to get things working.

  15. Balas
    December 16, 2009 at 12:14 am

    Eric you rock!!! I am a newbie but I followed your instructions to a ‘T’ and it works like a charm !!!

  16. kt
    December 30, 2009 at 2:05 pm

    Thanks, grub2 is new for me, but this helped me a lot.

  17. Tijmen
    January 17, 2010 at 11:04 am

    If your grub menu disappears have a look at this:

    https://wiki.ubuntu.com/Grub2#Where%20did%20my%20Grub2%20boot%20menu%20go!?!?!

  18. Michael
    February 17, 2010 at 3:25 pm

    Eric, Merci!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    It’s work. Great!.

  19. Steve
    February 26, 2010 at 10:25 pm

    Thanks for this guide! I’d like to add my $.02 – I just installed 9.10 next to a fresh Windows 7 install, and was fully expecting to have to deal with this issue.

    But… I did not. The Grub menu had a nice bright shiny “Windows 7 (loader)” option at the end of the list. I couldn’t believe my luck until I accessed the option. It worked like a charm with no further intervention from me.

    I’m pretty ignorant of what details are relevant. I’m willing to field questions, though.

  20. February 27, 2010 at 11:54 am

    Hi all.
    I had to add the following line to my /etc/default/grub:
    GRUB_DISABLE_OS_PROBER=false
    in order to grub showing the Windows menu entry.
    Thanks a lot for your advices, Eric. This worked fine for me.

  21. QuAz@r
    March 11, 2010 at 8:15 am

    Thanks man u are the king worked for me as well !!!

  22. March 18, 2010 at 7:01 pm

    Thank you so much !!

  23. March 18, 2010 at 7:44 pm

    I followed the directions exactly but I am getting this output can someone PLEASE HELP :*(

    nathan@nathan-desktop:/$ sudo update-grub
    Generating grub.cfg …
    Found linux image: /boot/vmlinuz-2.6.31-20-generic-pae
    Found initrd image: /boot/initrd.img-2.6.31-20-generic-pae
    grub-probe: error: Cannot find a GRUB drive for /dev/sdb1. Check your device.map.

    grub-probe: error: Cannot find a GRUB drive for /dev/sdb1. Check your device.map.

    “Adding Windows”
    Found memtest86+ image: /boot/memtest86+.bin
    Found Windows 7 (loader) on /dev/sda1
    done

  24. sandy
    March 23, 2010 at 3:14 pm

    Can someone please tell me where my win7 is in from the details given below:

    Disk /dev/sda: 30.0 GB, 30003240960 bytes
    255 heads, 63 sectors/track, 3647 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Disk identifier: 0xe874cf66

    Device Boot Start End Blocks Id System
    /dev/sda1 * 1 1305 10482381 5 Extended
    /dev/sda2 1306 3648 18813952 7 HPFS/NTFS
    /dev/sda5 1 996 8000307 83 Linux
    /dev/sda6 997 1305 2482011 82 Linux swap / Solaris

    Disk /dev/sdb: 320.1 GB, 320072933376 bytes
    255 heads, 63 sectors/track, 38913 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Disk identifier: 0xfdaffe7f

    Device Boot Start End Blocks Id System
    /dev/sdb1 1 1 992+ 42 SFS
    Partition 1 does not end on cylinder boundary.
    /dev/sdb2 1 10444 83886080 42 SFS
    /dev/sdb3 10444 38914 228683096 42 SFS

    —————————–
    also please tell the file i should write..

  25. Rand E. Gerald
    May 12, 2010 at 2:28 pm

    I have GRUB2 on a dual boot machine:

    Ubuntu 10.4 LTS (Lucid Lynx)
    Windows Vista Ultimate

    Is there an option to get Windows Vista to boot in Safe Mode with Networking or do I have to go back to booting from the MBR?

  26. May 21, 2010 at 12:41 pm

    Thank you, Eric. This post is just what I was looking for.

  27. jk
    June 9, 2010 at 5:53 pm

    thumbs up! worked like a charm!

  28. June 9, 2010 at 9:08 pm

    gud fix

  29. Ben
    June 28, 2010 at 9:24 pm

    Thanks, your solution worked perfectly!

  30. frisquet
    August 16, 2010 at 8:22 am

    It doesn’t work ((
    What shoul I do to make it work?

    Generating grub.cfg …
    Found linux image: /boot/vmlinuz-2.6.32-24-generic
    Found initrd image: /boot/initrd.img-2.6.32-24-generic
    “Adding Windows”
    /etc/grub.d/11_Windows.save.1: 2: Syntax error: “&” unexpected

    • August 17, 2010 at 1:31 am

      just double check that you don’t have any unnecessary comas etc.

      • frisquet
        August 21, 2010 at 12:51 pm

        it’s ok
        problem is solved
        thanks

  31. R2
    August 23, 2010 at 9:59 pm

    Thank you Eric, you just saved me from totally re-installing. =D

    Thanx again.

  32. Hannes The Hun
    October 9, 2010 at 12:03 pm

    thanks a bunch, this worked for me! I have a lucid x64 server install with XBMC on top and every time I upgrade the kernel, the win7 entry disappears with no chance to get it back automatically.
    adding the entry manually by following your instructions finally worked.
    I did the steps using a putty terminal, first time I copied the 11_Windows content directly but it changed all the ” signs to . so be aware of this.

  33. Siddhartha
    November 5, 2010 at 8:55 pm

    It works like a charm

  34. mark
    November 14, 2010 at 10:23 am

    Hello,
    Thanks but it did not work. I got as far as seeing ‘adding windows’ then when I reboot nothing.

    My Hd looks like this

    Disk /dev/sda: 320.1 GB, 320072933376 bytes
    255 heads, 63 sectors/track, 38913 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: 0x000440f0

    Device Boot Start End Blocks Id System
    /dev/sda1 1 9668 77657186 7 HPFS/NTFS
    /dev/sda2 * 9669 28046 147621285 b W95 FAT32
    /dev/sda3 28047 38914 87290881 5 Extended
    /dev/sda5 38149 38914 6142976 82 Linux swap / Solaris
    /dev/sda6 28047 38149 81146880 83 Linux

    Partition table entries are not in disk order

    Windows in on the sda1 partition so I assume that that your config lines match mine

    Any help would be appreciated

  35. December 5, 2010 at 10:26 pm

    Hey
    My Windows 7 is on sda5, how do I do that?

  36. André
    December 9, 2010 at 12:14 pm

    those quotes will break the grub.cfg

  37. Eric H
    December 12, 2010 at 6:16 pm

    worked – nice quick solution. Thanks.

  38. badenia
    December 21, 2010 at 4:46 am

    Hi
    It didn’t solved my error 15 problem.There already is a Windows choice but gives me the error. When I use the Windows Repair Disk (64 bit Repair Disk) says “The version of System Recovery Options is not compatible with this version of Windows…..etc” On my other (32bit) laptop with the (proper 32bit) Repair Disk had no problem
    Any ideas?

  39. xyz
    December 26, 2010 at 9:04 pm

    Thanks a lot!!! it worked like a charm!! Very Thankful to You……
    Again Thanks!!!

    • yousry
      February 11, 2011 at 7:26 am

      Thanks a lot.. I was suffering from installing windows on another physical drive while having Ubuntu 10.10 on the other. Windows does not install at all unless it wants to ruin my entire system partition for Linux to start a new MBR as it does not recognise the drive with a Linux system partition, I am sure you know that painful story :), after which I have to reinstall and restore grub2 uhh. But I simply disconnected the Linux physical drive as if it wasn’t there. Installed Windows on the other physical drive, reconnected it again and simply applied your code to the grub2 on my first drive. WOWW.. Thanks man.. You saved me a lot of time and effort.. You are a GENIUS !!! THANK YOU A+++ !!!

  40. Mark
    February 19, 2011 at 9:23 pm

    This worked. Thank You!!

  41. matej
    March 20, 2011 at 2:07 am

    thank you!

  42. henrik
    April 3, 2011 at 7:04 pm

    Hi,
    I installed Ubuntu with the Alternate-CD on a raid Hard drive my Win 7 is on a different Hard drive here’s my fdisk -l:
    “Platte /dev/sda: 1000.2 GByte, 1000204886016 Byte
    255 Köpfe, 63 Sektoren/Spur, 121601 Zylinder
    Einheiten = Zylinder von 16065 × 512 = 8225280 Bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x4f16d6a4

    Gerät boot. Anfang Ende Blöcke Id System
    /dev/sda1 1 1 992+ 42 SFS
    Partition 1 endet nicht an einer Zylindergrenze.
    /dev/sda2 1 1959 15728640 27 Unbekannt
    /dev/sda3 1959 1972 102400 42 SFS
    /dev/sda4 * 1973 61754 480198915 7 HPFS/NTFS

    Platte /dev/sdb: 160.0 GByte, 160041885696 Byte
    255 Köpfe, 63 Sektoren/Spur, 19457 Zylinder
    Einheiten = Zylinder von 16065 × 512 = 8225280 Bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x97559755

    Gerät boot. Anfang Ende Blöcke Id System
    /dev/sdb1 * 1 9732 78172258+ 7 HPFS/NTFS
    /dev/sdb2 9733 13161 27539062+ 7 HPFS/NTFS
    /dev/sdb3 13161 19457 50576737+ f W95 Erw. (LBA)
    /dev/sdb5 16319 18565 18048996 7 HPFS/NTFS
    /dev/sdb6 18566 19457 7164958+ b W95 FAT32
    /dev/sdb7 13161 16182 24266752 83 Linux
    /dev/sdb8 16182 16318 1094656 82 Linux Swap / Solaris

    Partitionstabelleneinträge sind nicht in Platten-Reihenfolge

    Platte /dev/sdh: 1995 MByte, 1995440128 Byte
    62 Köpfe, 62 Sektoren/Spur, 1013 Zylinder
    Einheiten = Zylinder von 3844 × 512 = 1968128 Bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x00000000

    Gerät boot. Anfang Ende Blöcke Id System
    /dev/sdh1 * 1 1013 1946955 c W95 FAT32 (LBA)”
    This log is in german, because I’m from germany.
    On the first hard drive is Win7(SDA4). How can I add it?
    Thanks, Henrik

  43. thisisme
    April 23, 2011 at 2:48 pm

    Man, thanks. It works like magic. I tried to read some documentation but this one is the simplest and the shortest script.

    you rock!

  44. Colin Cedric
    June 18, 2011 at 6:31 pm

    thank you mean, you save my life ^^.

  45. AJ
    July 24, 2011 at 2:42 am

    Anyone tried to do this with a GPT disk?

    I tried adding this to the 11_windows file instead of what the author suggested:

    insmod part_gpt
    insmod ntfs
    set root='(/dev/sda,gpt3)’
    chainloader +1

    but I get disk not found even though in ubuntu I can see that windows is installed on gpt3 of sda….

    Anyone have any idea what the problem is?

  46. July 31, 2011 at 10:23 am

    Thanks, just what I was looking for.

  47. August 9, 2011 at 1:34 pm

    when i write the file is necessarly to put the # i saw that the commands dont work when I put #. i tried both in the file with and withouth #, after sudo-update i saw the Adding Windows line but still no Windows in boot loader. I found that the windows is in /dev/sda4 so in 11_windows is (hd0,4 ) . I have 2 hdd but Linux and Windows are on the same hdd, different partitions.

  48. Pascal
    August 13, 2011 at 7:39 am

    Wow thanks!!!

  49. rasputi
    August 16, 2011 at 8:22 pm

    Thx. You saved my Life

  50. Joseph
    September 3, 2011 at 11:51 am

    Perfekt Work!!! THX… There is some documentation???

  51. Anon
    November 2, 2011 at 6:58 pm

    Thanks for in-depth guide. Though it seems on current Ubuntu version 11.10 “update-grub” is enough and grub recognizes W7 partition automagically… If creating manual config is needed, hard disk ordering is at /boot/grub/device.map file.

  52. gossfunkel
    December 10, 2011 at 4:40 pm

    That almost worked perfectly, until I tried to boot the Windows partition from Grub- I got this error:

    “error: invalid signature.”

    I’ve had this with pretty much any attempt to add windows to grub- update-grub wouldn’t find it, but this method created it. wtf is going on? If it’s any help, partition managers are saying that sda1, the windows boot partition, is a linux-swap partition. Has one of the operating systems (and I have many) misread it and dumped swap data all over it?

  53. sahibou doucoure
    December 17, 2011 at 8:51 pm

    youve just saved my life !! thank you

  54. January 25, 2012 at 11:37 am

    Awesome! Thanks a ton, Eric!

  55. Rombus
    February 12, 2012 at 3:52 am

    Totally awesome!

    The worst thing of all, is that I tried to avoid editing grub. Tried re-installing but nothing was working. Then I found this and in 5 minutes I got my dual boot setted up :E

    Thanx!

  56. May 27, 2012 at 8:46 pm

    Clean and clear! Worked flawlessly. Thank you!

  57. chris
    June 12, 2012 at 1:41 pm

    hello!
    I use Debian6 with Grub2 and tried to add a new menu entry: I followed your instructions.
    update-grub finished with “adding windows” and “done”. But there is no new grub entry?! I repeated this procedure 3 or 4 times: no new boot entry appeared….
    do you have an idea what was happened?

  58. michael
    July 25, 2012 at 5:18 pm

    Thanks for sharing this. I’m glad it helped so many. I just can’t make it work for me, and I don’t know why.

    I am trying to dual boot on a single hard drive using Ubuntu 12.04 (on dev/sda6) and Fedora 17 LXDE (on dev/sda2). I started with a clean hard drive, and carefully followed the instructions contained in this tutorial:

    http://www.linuxbsdos.com/2011/06/20/dual-boot-fedora-15-and-ubuntu-11-04-with-either-side-on-an-lvm-partitioning-scheme/

    Everything worked as expected right up until the very end. My fdisk looks like this:

    Disk /dev/sda: 41.1 GB, 41110142976 bytes
    255 heads, 63 sectors/track, 4998 cylinders, total 80293248 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x0008cb3f

    Device Boot Start End Blocks Id System
    /dev/sda1 * 2048 1026047 512000 83 Linux
    /dev/sda2 1026048 39938047 19456000 8e Linux LVM
    /dev/sda3 39940094 77828095 18944001 5 Extended
    /dev/sda5 39940096 40718335 389120 83 Linux
    /dev/sda6 40720384 77828095 18553856 8e Linux LVM

    Fedora is on /dev/sda2, and it booted up properly before I installed Ubuntu. Supposedly, following this procedure would result in both operating systems appearing in my grub. In fact, that’s the only reason I stuck to it. But, only Ubuntu showed up in grub after all was said and done. So, I used the terminal in Ubuntu to apply your fix. I set root=(hd0,2) — assuming the Ubuntu installation had rewritten my master boot record and installed Grub 2. Sure enough, the Fedora option appeared in my next boot-up. But, when I selected it, I got the following message from grub:

    “error: invalid signature

    Press any key to continue . . .”

    Pressing a key or just waiting a few seconds brings me back to grub, where Ubuntu is my only functional selection. I noticed that my grub header said “GNU GRUB version 1.99-21ubuntu3.1,” so I thought that maybe I needed to change the set root value in your fix to (hd0,1), which I did. But, I got the same result — Fedora in the grub menu but not functioning. I even tried set root=(hd0,0) and set root=(hd0,3), for some reason. Same result.

    Sigh…

  59. October 9, 2012 at 9:58 am

    Hllo, I have a new blog. I wanna collect ideas for Linux future 🙂 Thanks for this post.

  60. Jon
    July 13, 2013 at 3:23 am

    Very nice tutorial, i would kiss you right now

  61. R7c
    March 11, 2014 at 6:56 pm

    Works like a charm, only tricky part is finding Windoze partition if its lost amongst the other ones, but indeed the best solution

  62. October 19, 2014 at 9:04 am

    Hi Eric…i have a laptop with win7 and then i’ve installed linux mint 17 but i dont have a choise to boot win7
    fdisk – l command give this information
    Device Boot Start End Blocks Id System
    /dev/sda1 2048 16351231 8174592 b W95 FAT32
    /dev/sda2 * 16351232 32704511 8176640 c W95 FAT32 (LBA)
    /dev/sda3 32704512 566714367 267004928 7 HPFS/NTFS/exFAT
    /dev/sda4 566716414 625141759 29212673 5 Extended
    /dev/sda5 566716416 617588735 25436160 83 Linux
    /dev/sda6 617590784 625141759 3775488 82 Linux swap / Solaris

    What can i do to add a choise for win 7…what should i change to 11_Windows file to work?
    (i dont know almost anything about linux)

  63. Mark
    October 8, 2015 at 3:12 pm

    Clever ! I got thru the LPIC-1 (old), the CompTIA book that I studied from didn’t go into Grub2 in depth. You certainly get KUDOs for Mastering Boot Loading and GRUB !

    Nice work young man !

  1. November 30, 2009 at 12:23 pm
  2. September 11, 2010 at 7:11 am
  3. June 2, 2011 at 5:42 am
  4. July 10, 2011 at 3:49 pm
  5. December 5, 2011 at 3:56 am
  6. December 5, 2011 at 3:57 am
  7. December 5, 2011 at 3:58 am
  8. January 19, 2012 at 6:05 pm
  9. October 27, 2014 at 5:32 pm
  10. November 6, 2014 at 5:37 pm

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: