Ubuntu – New Lubuntu install – 2GB RAM, 32GB SSD

lubuntussdswap

I'm planning on installing Lubuntu (16.04 LTS 64-bit) on 2-3 older laptops with similar specs. They're all 2GB RAM (and are max'd out), and I'll use a 32GB SSD as the only drive. I have the same Lubuntu distro on one already which works great, but it's on a 256GB "spinny" drive. That drive has a 2GB swap partition.

My question is on swap partition and swap file, when moving to this SSD. I do not need hibernation. The computers won't see heavy use, and I'm not much concerned with SSD "wear" or lifetime. I'm most concerned with getting the best "user speed" on old machines with modest CPU's. Most usage is not very memory intensive, altho we'll occasionally open some big stuff in GIMP etc, which could max out the 2GB RAM.

After a bunch of searching + reading, it seems I'm best served by NOT using a swap partition, so my questions are:

  1. Does it seem best to go with no swap partition?

  2. If no swap partition- do I need to do anything to create a swap file, or will the normal Lubuntu install do it?

  3. I've read a lot about TRIM, noatime, + a couple other "tweaks" to make Ubuntu 'play nice' with SSDs — however, a lot of the threads I found were years old, 2 or 3 or 7 or more years. Some threads say that recent Ubuntu distro's have things like trim + noatime built in, and take care of them automatically, so don't need the tweaks.

Best Answer

Swap files versus swap partitions:

Swap partitions can be used by two or more Linux installations on the same PC (e.g. dual boot).

Swap partitions are better in case the disk gets full. Swap files are subject to fragmentation. Swap partitions are not.

Swap files can be better if you need to change the size of the swap capacity since it is easier to resize the swap file than it is to resize the swap partition.

Operationally, swap files will work as well as swap partitions if they are created on non-full disks to avoid fragmentation.

Generally speaking, modern Linux systems typically employ swap partitions since high capacity storage devices are quite inexpensive.

Related Question