Advertisement
Guest User

Untitled

a guest
Mar 8th, 2012
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.26 KB | None | 0 0
  1. oday 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.
  2. 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:
  3.  
  4. # sudo fdisk -l /dev/sda
  5.  
  6. According to this my Windows partition is hda1. To continue with my plan to add Windows boot option I typed in the following line:
  7.  
  8. # sudo nano /etc/grub.d/11_Windows
  9.  
  10. This created a new a new file. I then added the following lines:
  11.  
  12. #! /bin/sh -e
  13. echo “Adding Windows” >&2
  14. cat << EOF
  15. menuentry “Windows 7″ {
  16. set root=(hd0,1)
  17. chainloader +1
  18. }
  19. EOF
  20.  
  21. Now save the 11_Windows file.
  22.  
  23. 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:
  24.  
  25. First partition (/dev/sda1): root=(hd0,1)
  26.  
  27. Next type the following command:
  28.  
  29. # sudo chmod a+x /etc/grub.d/11_Windows
  30.  
  31. Next type in the following command:
  32.  
  33. # sudo update-grub
  34.  
  35. You should be able to see something like this:
  36.  
  37. # sudo update-grub
  38. Generating grub.cfg …
  39. Found linux image: /boot/vmlinuz-2.6.30-9-generic
  40. Found initrd image: /boot/initrd.img-2.6.30-9-generic
  41. Found linux image: /boot/vmlinuz-2.6.30-8-generic
  42. Found initrd image: /boot/initrd.img-2.6.30-8-generic
  43. Adding Windows
  44. Found memtest86+ image: /boot/memtest86+.bin
  45. done
  46.  
  47. Now close all the open programs and type in the following command to your terminal:
  48.  
  49. # sudo reboot
  50.  
  51. If all went well you should see Windows 7 option in your GRUB2.
  52.  
  53. -Eric
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement