On 10/12/2021 15:16, Nikos Chantziaras wrote:
If you can't do that, then it doesn't matter much whether you use a swap file or partition. On an SSD, both should perform about the same. On an HDD, swap files could run into fragmentation issues if you resize them or create them incorrectly. On an SSD, fragmentation doesn't have much of an impact. A swap file gives you the option to resize it later on without having to do filesystem and partition resizing, so I'd say a swap file sounds better.

It very much does matter whether you use a swap file or partition in practice. I've just been reading right now a discussion about systemd logging and hibernation, and how btrfs handles swap files. It sounds nasty.

If you have a swap file, linux creates an immutable file then uses direct disk i/o. There's a LOT of unnecessary crap there that could go wrong. Just avoid all that trouble and give yourself a decent swap partition. (And if you're running btrfs, a lot of this sounds experimental and dangerous ...)

Cheers,
Wol

Reply via email to