I've been trying to get Ubuntu installed over the last few days and I'm almost there. My problem now is that I can only have one more primary partition because I already have three others. I have 28GB of unallocated space and have tried going into the Ubuntu installer and under the "something else" option creating an ext4 primary partition with mount as "/". However, once I do that the rest of the free space I set aside for swap turns into "unusable" and from then on I can't create a swap partition. So how can I get a partition for "/" and a swap area on one primary partition?
You have already 3 primary partitions as you said you can create just one more primary in that case why not create a logical partition for the unallocated then split it for swap and Ubuntu
To create logical partition install Gparted when running on Ubuntu live Usb
In Gparted use the shrink option by right clicking unallocated space then create swap and os space
After this start the installation and choose something else
You can create a swap file on the main partition after installation if you need to stuff Ubuntu on one partition. Please keep in mind this is an advanced topic and you can break Ubuntu if you do not do this correctly. Here is a quick summarization from Digital Ocean.
You can use swap on whats called a swap file instead of a swap partition so you will need to create a swap file on your Ubuntu partition (after installation of course). You create a blank un-formatted swapfile by opening terminal (Ctrl-Alt-T) and typing:
sudo dd if=/dev/zero of=/swapfile bs=1024 count=1024k
Make sure to replace 1024k with how many megabytes large you want your swap file to be. Ubuntu usually makes this the size of you RAM so if you had 4 gigs of ram you would type 4096k. Also note typing sudo basically tells Ubuntu to run the dd program to run as root in other words the administrator.
Now we need to format the swap file so it is a proper swap file by typing:
sudo mkswap /swapfile
Now if you have no errors your should be able to activate it by typing:
sudo swapon /swapfile
If no errors occur at all we need to make sure to enable it at bootup. Now this involves editing a config file called fstab which can mess things up if you do not put the following information in correctly. You can open the fstab file by typing:
sudo nano /etc/fstab
You can move the cursor with the arrow keys and type to edit the fstab file. We want to paste this line at the end by moving the cursor down to the end and by right clicking on terminal and pasting this:
/swapfile none swap sw 0 0
Now before we finish we need to set the swappiness value so Ubuntu knows when to store memory in swap. We are going to set it to 10 in this case by typing:
echo 10 | sudo tee /proc/sys/vm/swappiness echo vm.swappiness = 10 | sudo tee -a /etc/sysctl.conf
And set the permissions so that no one but root (the administrator) can read the swap file for security purposes (optional but recommended).
sudo chown root:root /swapfile sudo chmod 0600 /swapfile
Now restart to see if Ubuntu boots and swap should be set up now!