Why do Linux installers prefer swap partitions over swap files in 2025?

0
59
Asked By CloudyCanoe42 On

I'm curious why most Linux installers still prefer to set up a swap partition rather than a swap file. I understand that swap files are more flexible and can be resized on the fly, while swap partitions are fixed in size when created during installation unless you want to take the risk of resizing them later. What's the reasoning behind this preference?

4 Answers

Answered By TechieTurtle99 On

There are some issues with certain functionalities when using swap files instead of partitions. They don't exactly match up, in terms of behavior. Unless you've upgraded your RAM, you probably won't need to change the size of your swap often. Resizing file systems isn't something most users should do without understanding how partitions work, even if it is usually safe.

Answered By CuriousPenguin37 On

I actually use swap mainly as an indicator for system memory use. I had some strange out-of-memory experiences while experimenting, so I enabled systemd-oomd, which has worked well as it alerts me when swap starts filling up.

Answered By QuickSwan24 On

Using a swap partition can be better for btrfs users because swap files require you to disable copy-on-write and other features. With a swap partition, you don't have to worry about that. It's still viable to use swap files; it just adds a bit of complexity during setup.

Answered By RustyPineapple88 On

In 2025, with memory being quite affordable, I've stopped configuring disk swaps altogether on my machines. Instead, I use zRAM, which Fedora prefers too. My main question is why installers still ask for disk swap settings instead of just using zRAM? For those with HDDs, zRAM is a better option and generally works without issues unless you're using a lot of swap.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.