Dual boot Ubuntu and Windows 7

Getting Windows 7 RC side by side with Ubuntu is not too difficult, but still requires some practice. I started by freeing 30 GB on my 1 TB disk. It seems too small afterwards; only 6 GB left! If I come to install the Windows 7 retail version someday, I will definitely increase the partition to say 60 or 100 GB. To do so:

  1. Launch GParted
gksudo gparted
  1. Resize an existing partition (I removed an unused swap partition and made my Data partition smaller)
  2. Create a primary partition, format it as NTFS

Then I installed Windows 7 using the DVD:

  1. When asked where to install Windows 7, choose Custom
  2. Select the NTFS partition

Windows 7 was up and working, but of course Ubuntu was not accessible anymore. Using a Live CD (in my case, RIPLinuX, but it's also doable with the Ubuntu live disk), I could boot my Ubuntu system. Using RIPLinuX:

  1. Choose Boot Linux Partition
  2. Press TAB
  3. Change /dev/XXXX to /dev/sda1 (or /dev/yourLinuxPartition, I assume you know what I'm talking about)
  4. Press Enter twice

You should be able to log in your Ubuntu system. We can now restore GRUB (the Linux loader), but we will first add Windows 7 to GRUB so that we can boot it:

gksudo gedit /boot/grub/menu.lst

Then add the following lines at the end:

title		Windows 7
root		(hd0,2)
chainloader	+1

The (hdX,Y) parameter indicates which hard disk number (in my case 0) and which partition number (in my case the third partition, so number 2)

Finally:

  1. Start a terminal, then:
sudo grub
find /boot/grub/stage1
  1. It will give you something like (hdX,Y)
root (hdX,Y)
setup (hdX)
quit

That should be it. Enjoy!

source 1 source 2

Page top