So here's how I upgraded to Windows 8 with less than 20GB of free space (I started with 2GB). For this you will need to have chosen the option to install of a DVD and you will not be importing any of your old Windows 7 stuff during install. If you want to keep all of your applications and settings etc and import them, this is not the method for you. First of all, I got rid of hiberfil.sys which was taking up 6-8GB on my hard drive. If your pagefile is running off c:/ you can get rid of that too. All you need is 8.5GB free if you do the install straight off the DVD.
Boot onto the install DVD. During the install, choose the option that does not import any of your settings (the other option takes you back to windows and requires 20GB). I didn't need any of my applications or settings so this was fine for me. From here you can choose to install on any hard drive, however, as I'm upgrading, the installer fails on a hard drive that does not have Windows. Install onto your current Windows 7 partition. It backs up your old set-up as Windows.old, which you can delete to free up 20+GB when you're in Windows 8 later using disk cleanup. Though for some reason it still shows up on the windows splash screen as an option. Good one Windows.
Now for the Ubuntu part:
Now, to get grub back up and running (the Windows install deletes it). If you've got a reasonably new livecd around (new enough to have grub2 on it) then just boot onto that and follow these instructions:
and then sudo rebootFirst, open the Terminal.Mount the partition you Ubuntu Installation is on. If you are not sure which it is, launch GParted (included in the Live CD) and find out. It is Usually a EXT4 Partition. Replace the XY with the drive letter, and partition number. Example: sudo mount/dev/sda5 /mnt. Then bind the directories, you need, like so:
sudo mount /dev/sdXY /mnt
sudo mount --bind /dev /mnt/dev
sudo mount --bind /proc /mnt/procNow we jump into that using chroot.
sudo chroot /mntNow install, check, and update grub. This time you only need to add the partition letter (usually a) to replace X. Example:grub-install /dev/sda, grub-install –recheck /dev/sda
grub-install --recheck /dev/sdX
update-grubNow you can exit you mounted hard disk, and unmount.
sudo umount /mnt/dev
sudo umount /mnt/proc
sudo umount /mnt
and then when you get back into ubuntu you're going to need to sudo update-grub to get your windows partition back, or alternately I guess you could mount it with your ubuntu drive earlier on the livecd, but that would require way more than a single command!