|
|
| Grub2 and windows on a second harddisk |
|
|
|
| Written by Bart Dorlandt |
| Monday, 17 May 2010 22:08 |
|
I had some challenges to get windows running from my grub. Here is my situation. I have a primary RAID which contains my Ubuntu 10.04 installation. I have a extra harddrive on which I have installed windows by setting it as primary for a moment in the BIOS. After installation I returned to the BIOS and set my RAID as primary again. So, now the technical stuff. Grub2 needs to be updated. Go to your terminal in Ubuntu and type update-grub. It will update the file /boot/grub/grub.cfg. You can look in the file and you'll see windows added to the list. You'll see a menu entry for your windows with a "set root" line and a line with searches for the UUID. At the "set root" line it is going wrong. As you can see it points to (hd1,1). Here are the tips to get this working and to keep the config even if update-grub is run again. Create a new file in the directory /etc/grub.d and call it how you like. I use the following: 42_my_own_stuff. Add the following to it. #!/bin/sh -e
echo "Adding personal stuff"
cat << EOF
# Adding a working menu entry for Windows 7 on the second harddisk
menuentry "Windows (Manual)" {
set root=(hd1)
chainloader +1
}
EOF
After adding it, execute the following to make it executable. chmod +x 42_my_own_stuff You can see in the config above we point to the disk without a partition. Also we have removed the "search" line. After all is done we execute the command update-grub again. And now all is done. NOTE: You'll now have 2 Windows options to select. You'll need to select the Windows (Manual) to really boot into windows. The other one still won't work.
|
| Last Updated on Tuesday, 18 May 2010 08:11 |
| Related items: |
|---|
|


