6

I replaced my HDD with Samsung EVO 860 SSD. I read suggestions that swap partitions should be disabled/removed in order to extend the life of the SSD. However, gparted does not show that I have a swap partition.

Does Ubuntu 20.04 installer automatically skip creating a swap partition when installing on an SSD?

Thanx in advance!

user68186
  • 33,360
KJ Baxter
  • 63
  • 1
  • 4

1 Answers1

7

Swap is now a file

Ubuntu 20.04 creates a swap file during installation. Swap partitions are not required anymore. This is irrespective of SSD or HDD.

Ubuntu started using a swap file instead of a partition from the version 17.04. See Default 17.04 swap file location for more.

Swap is still needed

The suggestion that you should disable or remove swap from SSD is rather old. it comes from the old time when SSDs would get corrupt with too many writes. Modern SSDs are more robust. So, it is okay to keep a swap file (or a swap partition, if you really need it) in the SSD.

I would keep the default swap file as is in the SSD unless you have some special needs and requirements. If you have enough RAM the swap file may not be used much and won't "speedup" the death of the SSD by any significant time. On the other hand, if you edit videos or work with lots of open tabs in Firefox the swap file will prevent your computer from crashing if it runs out of RAM.

Hope this helps

user68186
  • 33,360
  • 1
    Since most systems now have a lot of RAM, you may never use swap unless editing videos or opening many tabs in Firefox. I never used swap with my 4GB RAM system, but did not game, nor edit very large files. So if you never use swap, it did not matter where swap partition was. And I believe that is part of reason why now a swap file. You can check swap & RAM use with free -m. – oldfred May 24 '20 at 19:46
  • Perhaps worth adding that swap files are preferred to swap partitions on SSDs because they are resizable. – Matthew Dec 29 '20 at 15:03
  • @Mathew I agree that swap files are easier to resize as compared with swap partitions. However, that has nothing to do with SSD or HDD. – user68186 Dec 29 '20 at 15:16