Debian – Swap: Better to create a dedicated swap partition or to create a swap file

debianlinuxswap

is there a rationale when to create a dedicated swap partition vs. creating a swap file, for example like /tmp/swap?

In my certain case, memory is kind of low (1GB), disk space on a SSD is pretty huge (256GB). Thus, swapping will happen pretty regularly.

Any comments appreciated!

Carsten

Best Answer

The main disadvantage that I can see for using swap files as opposed to swap partitions is that it's not possible to have a swap partition get fragmented, whereas it's possible that, upon creation, a swap file on an extent filesystem can get split up on the disk, causing slower sequential access.