About swap and trim

I just wanted to let you know that I installed EndeavourOS with two disks and 16 GB of RAM.

Disks info

/dev/sda
ext4 with /home partition
Model Family: Crucial/Micron Client SSDs
Device Model: CT1000MX500SSD1
Serial Number: 2211E61B5DCA
LU WWN Device Id: 5 00a075 1e61b5dca
Firmware Version: M3CR043
User Capacity: 1.000.204.886.016 bytes [1,00 TB]
Sector Sizes: 512 bytes logical, 4096 bytes physical
Rotation Rate: Solid State Device
Form Factor: 2.5 inches
TRIM Command: Available
Device is: In smartctl database 7.5/5706
ATA Version is: ACS-3 T13/2161-D revision 5
SATA Version is: SATA 3.3, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is: Thu Jul 17 20:18:29 2025 CEST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

/dev/sdb
ext4 with EFI and / partitions
Model Family: Samsung based SSDs
Device Model: Samsung SSD 750 EVO 250GB
Serial Number: S33SNB0H531399B
LU WWN Device Id: 5 002538 d40edec14
Firmware Version: MAT01B6Q
User Capacity: 250.059.350.016 bytes [250 GB]
Sector Size: 512 bytes logical/physical
Rotation Rate: Solid State Device
Form Factor: 2.5 inches
TRIM Command: Available
Device is: In smartctl database 7.5/5706
ATA Version is: ACS-2, ATA8-ACS T13/1699-D revision 4c
SATA Version is: SATA 3.1, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is: Thu Jul 17 20:21:05 2025 CEST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

I’m a little hesitant to use Btrfs because I’m not quite sure how to use it. I’m afraid of losing information or having to reinstall it often because I’m a bit clumsy.

I haven’t created a swap partition because my last Arch installations used zram and didn’t give me any problems, but I really need to be able to hibernate. I’ve looked everywhere, but I don’t see any swap on file or anything similar.

I’d love to get some more info on this.

  • How set up a swap to file and be able to hibernate?

  • How to adjust the trim, if that’s something you’re comfortable with. I’ve read that it’s suitable for disks like mine, but I’m not sure how to go about it.

I would really appreciate any guidance or references you could offer. I’m currently looking at this:

I can’t thank you enough!.

https://discovery.endeavouros.com/storage-and-partitions/adding-swap-after-installation/2021/03/

Then dont use it.
The only reason to want it is for its special features.
If those are not attractive to you then there is no reason.
Besides - btrfs does require special considerations for maintenance and general use.

Thats fine.
Of course zram on its own does not support hibernation.
But you can use zram and a backing swap for hibernation.

Up to you.

I wrote a tutorial on this in the manjaro forum back in the day;

But the actual swapfile/hibernation guide linked from there is written assuming grub;

I’m not sure what you mean.
Generally speaking continuous TRIM is discouraged and periodic trim, on a timer, is the suggestion.

systemctl enable fstrim.timer

Thats it.

1 Like

The essential info is [1] and [2].

In your case create a swap file on the / disk the size of your physical memory and you should be good to go.

The second decision is what to do with the existing zram. Out of the box Arch/EOS enables zswap, which will lead to weird swapping behavior if used together with zram.

The combination of zram combined with a swap-file/disk isn’t optimal either. Personally I would disable zram and switch to zswap+swap-file exclusively.

2 Likes

Think trim is installed by default , with the timer set to once a week.
You can check the status of trim this way.

systemctl status fstrim.timer
1 Like

This exchange might also be of interest …

If you use Btrfs, continuous trim, a.k.a., discard, is enabled by default when the filesystem is created. This can be disabled by the use of the nodiscard option in the fstab file. If EndeavousOS uses the fstrim timer as well, then you are getting both continuous trim and fstrim timer running together (weird, but since noone seems to be complaining, I guess it works).

If you go with Ext4, then continuous trim, or discard, is not enabled by default, and the fstrim timer is all you need.

1 Like

Thank you all for your clear answers; they were very helpful. :ok_hand:

1 Like