Ubuntu – GRUB could not find Windows 7 after installing Ubuntu – RAID 0

12.04grub2raidwindowswindows 7

I just purchased a new computer with two 256 GB SSDs configured in RAID 0. It came pre-installed with Windows 7, but I wanted at least one Linux distribution installed as well. So, I tried installing Ubuntu through the LiveCD.

In the LiveCD, I first created a few partitions for Ubuntu. The first was a 12GB swap and the next, about 88GB formatted ext4 (gparted wouldn't let me create an extended partition, so both of there were primary partitions). The extra space came from shrinking the Windows 7 partition.

While installing Ubuntu, I selected the master RAID controller for the boot loader. After the installer was finished, everything booted fine, but GRUB didn't have an entry for the Windows 7 loader (even though it had one for the Windows 7 Recovery loader).

To fix this, I tried manually editing the /boot/grub/grub.cfg file by adding these lines to the 30_os-prober section:

menuentry "Windows 7 (loader) (on /dev/mapper/isw_bhcibcaafd_Volume0p5)" --class windows --class os {
    insmod part_msdos
    insmod ntfs
    set root='(hd2,msdos3)'
    search --no-floppy --fs-uuid --set=root 6A92977992974889
    drivemap -s (hd0) ${root}
    chainloader +1
}

After rebooting, GRUB didn't load and all I got was a blinking cursor in the top left of the screen. So, I tried taking that section out (through the Ubuntu LiveCD) and after doing so, I still couldn't boot anything. Could someone please help me out? Thanks!

Here is a copy of my BootInfo Summary: http://paste.ubuntu.com/1159385/

P.S. I have a copy of the grub.cfg if someone needs it for finding a solution

Best Answer

Do not manually edit your /boot/grub/grub.cfg. Since grub2 (around 2009) this file is automatically overwritten in several events (kernel updates, for example).

If you want grub to scan your hard drives and look for OSes, try this:

sudo update-grub

This will re-generate your grub.cfg with all entries the probe finds. If you want to customize how this is done, try editing this file: /etc/defaults/grub. This is the one config file meant to be edited by user/admin.

You may also enable or disable the executable bit in the files at /etc/grub.d. You can also edit or create new files there to include manual entries. The latter is precisely what /etc/grub.d/40_custom is for.

You may also check this wiki, it has everything and more you might want to know about grub2

Related Question