Can't install Ubuntu alongside Windows 7 on unallocated disk space because there are already four primary partitions
I have just lived through this!
Consider what I have done as an unfinished test. I don't really know (and may never need to know) if what I did will work for me in all situations.
Steps:
I created the HP/Win7 back up DVDs. I think you will need 5 DVDs to do this. There were 4 primary partitions on my HP HDD. I think they were the BOOT(small), MAIN(huge), BACKUP(not big) & HPTOOLS(small) partitions. I am lead to believe that the software to create the DVDs is in the HPTOOLS partition. And that the DVDs are a copy of the BACKUP partition. But I could be wrong about that last point. Regardless, HP will only let you create (at least they say so when you do the backup) 1 set of DVDs per laptop. By all means do this. It only costs you your time and 5 DVD.
At this point I felt I could do away with either the BACKUP partition or the HPTOOLS partition. I chose to delete the HPTOOLS partition even though the placement of the undeleted BACKUP partition meant I would not be able to use about 5% of the HDD. As an added precaution, I did a disk dump of the HPTOOLS partition to an ordinary file in the Win7 partition. The "dd" (disk dump) application is an old Unix command. I was booted up in the Ubuntu Live CD under "try it" when doing this backup.
After the precautionary "dd" I deleted the HPTOOLS partition. I believe this was primary partition number 4 (of 1 to 4).
While booted up in Win7 you should probably run the de-fragmentation application on your Win7 partition. Make sure the disk is empty enough to be shrunk to the desired size.
I used gparted to shrink my Windows 7 partition. The Ubuntu installer might be able to do this as well.
Now the Ubuntu installer should offer up the option of installing Ubuntu "alongside" Win7. Before, with 4 primary partitions already on the HDD, the Ubuntu installer only offered me to install Ubuntu "into" the Win7 partition.
That got me to being able to dual boot my new HP laptop.