Swap file on ext4

I installed MX Linux recently on my laptop that has 4 GB RAM. It quickly runs out of memory even with 7-8 tabs on Firefox, which freezes. To create swap file, I am getting mixed views on two issues.

(1) swap file doesn’t work well on ext4 partition, and a partition is a better option; I would prefer a file over a partition;
(2) using dd is better than fallocate; I would prefer the latter as it seems neater and more intuitive for a newbie like me.

Please refer to my post on MX Linux recently, where I have given some relevant posts on various websites: Swap file creation after MX Linux new install - MX Linux Forum

I would look forward to views of members here on both the issues.

1 Like

I’ve read through the thread and didn’t find a mention of how swap files supposedly do not work well on ext4. It’s normal to use swap files on ext4. There is also barely any difference between using a swap file or partition.

You can use fallocate on MX Linux, just as on any other consumer Linux.

You can confirm fallocate is available like this:

type fallocate
1 Like

Thanks @Akito. This certainly helps.

1 Like