Rich Mingin (PLUG) on 16 Apr 2015 14:18:25 -0700

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] swappiness and ssd

Using relatime and noatime together is a bit nonsensical.

Relative access times plus no access times.

On Thu, Apr 16, 2015 at 3:36 PM, Eric H. Johnson <> wrote:

This is probably no longer needed for modern SSDs, but for embedded systems running XUbuntu 10.04 on a small SSD I would edit fstab as follows to both minimize writes just to update the file timestamp and to put commonly accessed files in ramdisk.

sudo gedit /etc/fstab

In fstab you should see a line something like this:

UUID=8037fd09-ea0d-4c28-a348-1fbdf9fb0b92 / ext3 relatime,errors=remount-ro 0 1

Add the noatime option. Normally every time you read a file, the time is written back to the drive. The noatime option disables this.

UUID=8037fd09-ea0d-4c28-a348-1fbdf9fb0b92 / ext3 relatime,noatime,errors=remount-ro 0 1

Now add the following lines. They move most temporary files to a ram disk.

tmpfs /tmp tmpfs defaults,noatime 0 0
tmpfs /var/run tmpfs defaults,noatime 0 0
tmpfs /var/log tmpfs defaults,noatime 0 0
tmpfs /var/lock tmpfs defaults,noatime 0 0
tmpfs /var/tmp tmpfs defaults,noatime 0 0
tmpfs /var/lib/dhcp3 tmpfs defaults,noatime 0 0

If you use Firefox a lot, you may want to move it's cache to ram as well. Your fstab line will look something like this:

tmpfs /home/les/.mozilla/firefox/vkuuxfit.default/Cache tmpfs defaults,noatime 0 0

Save the file and reboot. You should now have a fully working system that only does the absolute minimum of writes to the card.


The default swappiness on Ubuntu systems is 60, and presumably takes into consideration the relative performance of writes to and reads from the swap file / partition.  The ratio of write performance to read performance would be higher for SSDs than rotating media, since SSD reads are truly random whereas writes are in pages (in rotating media, seek and latency times would tend to apply to both).  Therefore, it seems to me that if swap is located on SSD, we should increase swappiness, to encourage less frequently used pages to be written out, since they can be brought back in very fast when needed.  Does that seem reasonable or am I missing something?  Thanks.

-- Bhaskar

Philadelphia Linux Users Group         --
Announcements -
General Discussion  --

Philadelphia Linux Users Group         --
Announcements -
General Discussion  --