My general config is to create a swap partition and set swappiness to 0. so it is there for hibernate, but given 32G of ram it is never really touched.
The biggest difference is, files can become fragmented while partitions don't. On a hard drive this can make a big difference. On an SSD I would tend not to use a swap partition or file. If you use a swap partition on an SSD it would confine the writes to a smaller area of the disk and wear it out faster. So a file would work much better because it has the whole disk to even out the writes. But you do a lot of swapping that also puts more wear onto the SSD. So I would tend to put my swap on a hard drive.
I tend to prefer swapfiles.
Doesn't require a partition, so it can be resized easily and won't require you to know the partition number. (Opinion: fewer partitions is just easier)
It is encrypted swap when on a fully encrypted drive without needing more partitioning work.
I don't actually know a reason to make swap a partition over a swapfile. I imagine there is a partition setting somehow or maybe the inability to resize is desirable, but that hasn't been my use case before.
To be fair though... I don't use hibernate so don't really need a swap either. So it is rare I'd need it anyway.
------------------------------
Message: 2
Date: Mon, 26 Oct 2020 21:22:57 -0700
From: Jim <azanorak@gmail.com>
To: plug-discuss@lists.phxlinux.org
Subject: swap file vs swap partition
Message-ID: <4613ab4d-61b5-34b0-4944-d0917cec234e@gmail.com>
Content-Type: text/plain; charset=utf-8; format=flowed
Regarding swap file vs swap partition: Is one better than the other?
When I installed Kubuntu on my machine, both options were available and
I chose the swap file. The OS is installed on an SSD---------------------------------------------------
PLUG-discuss mailing list - PLUG-discuss@lists.phxlinux.org
To subscribe, unsubscribe, or to change your mail settings:
https://lists.phxlinux.org/mailman/listinfo/plug-discuss
---------------------------------------------------
PLUG-discuss mailing list - PLUG-discuss@lists.phxlinux.org
To subscribe, unsubscribe, or to change your mail settings:
https://lists.phxlinux.org/mailman/listinfo/plug-discuss
--
A mouse trap, placed on top of your alarm clock, will prevent you from rolling over and going back to sleep after you hit the snooze button.
Stephen