My procedure was as follows:
- Boot to using the Ubuntu8.04 live CD.
- Use the partition editor to shrink the primary partition, and grow the the swap file partition and volume.
- Write the changes to the disk.
- Reboot to the server command line.
- Determine the swap volume's new UUID using:
ls -l /dev/disk/by-uuid
- Edit /etc/fstab and change the UUID for the swap partition to the correct value
- reboot
- Check that the partition is correctly mounted with the "free" command. Don't mind that you may not be using any of the swap at present, but you can at least tell that it's there for when you do need it.
Text editing with multiple files on the command line
To make my life easier, and considering that my web server doesn't have a GUI I first saved the output of the ls command to a text file, and edited that so that it contained just a single line containing the UUID
I then opened fstab
sudo vim /etc/fstaband then, at the end of fstab, I inserted the file I'd created with the command:
:r /home/john/uuid.txtI copied the UUID to the appropriate spot, deleted the line at the end and saved the file.
There are plenty of good tutorials and command summaries for vi / vim around on the web if you need them. (here's one, and another). I admit I'm somewhat conditioned to using graphical editors, but one doesn't always have a choice.