document.open();
document.writeln("<style type=\"text/css\">table.smipple-net-highlighttable div,pre,p,th,td{margin:0;padding:0;}</style>");
document.writeln("<div class=\"notranslate\" style=\"position:relative;\">");
document.writeln("<div style=\"overflow:auto;display:block;border:1px solid #E0E0E0;font: 11px Monaco,monospace !important;\">");

document.writeln("<table class=\"smipple-net-highlighttable\"><tr><td class=\"linenos\"><pre> 1");

document.writeln(" 2");

document.writeln(" 3");

document.writeln(" 4");

document.writeln(" 5");

document.writeln(" 6");

document.writeln(" 7");

document.writeln(" 8");

document.writeln(" 9");

document.writeln("10");

document.writeln("11");

document.writeln("12");

document.writeln("13");

document.writeln("14");

document.writeln("15");

document.writeln("16");

document.writeln("17");

document.writeln("18");

document.writeln("19");

document.writeln("20");

document.writeln("21");

document.writeln("22");

document.writeln("23");

document.writeln("24");

document.writeln("25");

document.writeln("26");

document.writeln("27");

document.writeln("28");

document.writeln("29");

document.writeln("30");

document.writeln("31");

document.writeln("32");

document.writeln("33");

document.writeln("34");

document.writeln("35");

document.writeln("36");

document.writeln("37");

document.writeln("38");

document.writeln("39");

document.writeln("40");

document.writeln("41");

document.writeln("42");

document.writeln("43");

document.writeln("44");

document.writeln("45");

document.writeln("46");

document.writeln("47");

document.writeln("48");

document.writeln("49");

document.writeln("50</pre></td><td class=\"code\"><div class=\"smipple-net-highlight\" style=\"border-collapse:collapse;border-spacing:0;\"><pre style=\"margin:0;padding:0 0 0 5;\"><a name=\"line-1\"></a># sudo fdisk -l /dev/sda");

document.writeln("<a name=\"line-2\"></a>");

document.writeln("<a name=\"line-3\"></a>According to this my Windows partition is hda1. To continue with my plan to add Windows boot option I typed in the following line:");

document.writeln("<a name=\"line-4\"></a>");

document.writeln("<a name=\"line-5\"></a># sudo nano /etc/grub.d/11_Windows");

document.writeln("<a name=\"line-6\"></a>");

document.writeln("<a name=\"line-7\"></a>This created a new a new file. I then added the following lines:");

document.writeln("<a name=\"line-8\"></a>");

document.writeln("<a name=\"line-9\"></a>#! /bin/sh -e");

document.writeln("<a name=\"line-10\"></a>echo \u201cAdding Windows\u201d &gt;&amp;2");

document.writeln("<a name=\"line-11\"></a>cat &lt;&lt; EOF");

document.writeln("<a name=\"line-12\"></a>menuentry \u201cWindows 7\u2033 {");

document.writeln("<a name=\"line-13\"></a>set root=(hd0,1)");

document.writeln("<a name=\"line-14\"></a>chainloader +1");

document.writeln("<a name=\"line-15\"></a>}");

document.writeln("<a name=\"line-16\"></a>EOF");

document.writeln("<a name=\"line-17\"></a>");

document.writeln("<a name=\"line-18\"></a>Now save the 11_Windows file.");

document.writeln("<a name=\"line-19\"></a>");

document.writeln("<a name=\"line-20\"></a>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:");

document.writeln("<a name=\"line-21\"></a>");

document.writeln("<a name=\"line-22\"></a>First partition (/dev/sda1): root=(hd0,1)");

document.writeln("<a name=\"line-23\"></a>");

document.writeln("<a name=\"line-24\"></a>Next type the following command:");

document.writeln("<a name=\"line-25\"></a>");

document.writeln("<a name=\"line-26\"></a># sudo chmod a+x /etc/grub.d/11_Windows");

document.writeln("<a name=\"line-27\"></a>");

document.writeln("<a name=\"line-28\"></a>Next type in the following command:");

document.writeln("<a name=\"line-29\"></a>");

document.writeln("<a name=\"line-30\"></a># sudo update-grub");

document.writeln("<a name=\"line-31\"></a>");

document.writeln("<a name=\"line-32\"></a>You should be able to see something like this:");

document.writeln("<a name=\"line-33\"></a>");

document.writeln("<a name=\"line-34\"></a># sudo update-grub");

document.writeln("<a name=\"line-35\"></a>Generating grub.cfg \u2026");

document.writeln("<a name=\"line-36\"></a>Found linux image: /boot/vmlinuz-2.6.30-9-generic");

document.writeln("<a name=\"line-37\"></a>Found initrd image: /boot/initrd.img-2.6.30-9-generic");

document.writeln("<a name=\"line-38\"></a>Found linux image: /boot/vmlinuz-2.6.30-8-generic");

document.writeln("<a name=\"line-39\"></a>Found initrd image: /boot/initrd.img-2.6.30-8-generic");

document.writeln("<a name=\"line-40\"></a>Adding Windows");

document.writeln("<a name=\"line-41\"></a>Found memtest86+ image: /boot/memtest86+.bin");

document.writeln("<a name=\"line-42\"></a>done");

document.writeln("<a name=\"line-43\"></a>");

document.writeln("<a name=\"line-44\"></a>Now close all the open programs and type in the following command to your terminal:");

document.writeln("<a name=\"line-45\"></a>");

document.writeln("<a name=\"line-46\"></a># sudo reboot");

document.writeln("<a name=\"line-47\"></a>");

document.writeln("<a name=\"line-48\"></a>If all went well you should see Windows 7 option in your GRUB2.");

document.writeln("<a name=\"line-49\"></a>");

document.writeln("<a name=\"line-50\"></a>-Eric");

document.writeln("</pre></div>");

document.writeln("</td></tr></table>");

document.writeln("</div>");
document.writeln("<div style=\"font: 11px Arial,Sans-Serif;float:right;position:absolute;bottom:0px;right:0px;padding: 5px 10px;background:#E0E0E0;-moz-border-radius-topleft:5px;-webkit-border-top-left-radius:5px;\"><a style=\"text-decoration:none;\" href=\"http://www.smipple.net/snippet/voyeg3r/How%20to%20add%20Vista%2FWindows%207%20partition%20to%20Grub%202%20%28Ubuntu%209.10%2C%20Karmic%20Koala%29\">Hosted on Smipple.net</a>");
document.writeln("</div>");
document.writeln("</div>");
document.close();

