How do you setup swap when installing Linux if the system has SSD?
2026-04-04 17:37 UTC
Replies (9)
-
@IratePirate@feddit.org 2026-04-07 22:06
I haven’t used swap or hibernation in years. My machines have plenty of RAM for even demanding workloads, so why risk faster disk degradation? As for hibernation, I just use suspend to RAM if I know that I’ll need the machine again that day, or shut it down if I don’t. With modern SSDs, I feel there’s not much of a perceptible difference between a ‘cold’ boot and a wake-up from suspend-to-disk - at least none that would be worth spending more write cycles on.
-
@monovergent@lemmy.ml 2026-04-05 01:00
For desktops, zram with no swapping to disk. Hasn't given me any trouble yet, except for the rare news website (it's always news websites) with a horrific memory leak. For laptops, zram plus a low-priority swap file for suspend-then-hibernate. My old laptop drains a fair bit in sleep mode and my new one doesn't have proper S3 suspend because microslop is pushing manufacturers to only support S0 idle. Always a file, never a swap partition. Everything that can be encrypted lives inside the encrypted root partition.
-
@HumbleExaggeration@feddit.org 2026-04-05 07:05
Noob question: what is bad about having a swap drive on an SSD? When installing OpenSuse, I followed the recommended setup, of creating a swap drive equally sized to my 32 GB RAM. And because I only have SSDs this also sits on an SSD. Seems to be working fine so far with quick hibernation and wakeup. What am I missing?
-
@catdog@lemmy.ml 2026-04-04 18:28
I have learned about the existence of zram and zswap today, and added a higher priority RAM swap on my workstation to reduce swapping to SSD. Should speed things up even more.
-
@MonkderVierte@lemmy.zip 2026-04-05 14:35
Whatever you want, but setup swap. Linux benefits generally from the existence of swap, used or not. https://chrisdown.name/2018/01/02/in-defence-of-swap.html
-
@savvywolf@pawb.social 2026-04-04 21:35
Depends on how much RAM you intend to use, and how much you need. For normal web browsing, I think probably enough swap space to make your total RAM + Swap amount up to 24GiB should do. If you have more than that and don't run anything memory intensive, you can probably get away without any swap at all. If you want the ability to hibernate though, you need at least the same amount of swap as physical RAM (since Linux will use the swap space as the location to "hibernate to". I think for an SSD it makes sense to use a swap file rather than a swap partition, since random access is basically free and you can resize it easily. That's a minor thing though. How much memory do you have? How much storage do you have? What will this computer be used for? Do you want to be able to hibernate?
-
@axum@lemmy.blahaj.zone 2026-04-06 04:25
Make a swapfile and continue on with life.
-
@Cysioland@lemmygrad.ml 2026-04-06 15:57
I've set up a swap partition so as not to OOM, but set the swappiness to minimum
-
@hyacin@lemmy.ml 2026-04-05 19:09
On the fastest drive I have, longevity be dammed. I buy fast hardware because I want my computer to be fast - having my RAM (likely the fastest thing in the system) swap to a _slow_ drive completely undermines that and defeats the purpose. Hibernation I don't normally mess with, and same with swappiness.