Let’s be honest: in late 2025, the concept of a dedicated swap partition on your SSD feels… archaic. We have NVMe drives with speeds exceeding 7000 MB/s and RAM capacities that were unimaginable a decade ago. Yet, many Linux distributions still nudge us toward creating that “safety net” partition during installation.
I decided to stop following the herd.
Across my entire fleet of machines—from my beastly Desktop PC (Ultra 7 265KF, 64GB RAM) to my daily driver Lenovo ThinkPad P14s G5 and even my aging MacBook Air 2017—I have completely eliminated physical swap partitions.
Instead, I rely 100% on ZRAM with zstd compression. Here is why, and exactly how I configured it on Fedora 43.
Why ZRAM Over Physical Swap?
Traditional swap acts as an overflow tank. When your RAM is full, the system moves inactive pages to your slow disk (yes, even NVMe is “slow” compared to RAM). This causes stuttering and wears out your SSD.
ZRAM works differently. Instead of moving data to the disk, it compresses the data and keeps it in a virtual block device directly in your RAM.
The Secret Weapon: zstd Compression
By default, many systems use lzo compression. It’s fast but not very efficient. During my testing on the ThinkPad P14s, I noticed that switching to the zstd (Zstandard) algorithm offered a much better compression ratio without a noticeable CPU penalty.
This effectively “doubles” your RAM capacity for swap purposes. On my MacBook Air with only 8GB of memory, ZRAM feels like magic—it keeps the system responsive even when I have way too many browser tabs open.
The Guide: Configuring ZRAM & Disabling Disk Swap on Fedora 43
Since Fedora 43 is my primary OS, we will use the zram-generator, which remains the standard and most efficient way to handle memory compression in 2025.
Note: I am performing these commands as a root user or with
sudo. Tested on Fedora 43 Workstation.
Step 1: Check Your Current Swap Status
First, let’s see what your system is currently using. Open your terminal and type:
Bash
zramctl
What to look for:
If you see lzo-rle under the ALGORITHM column, you are using the default compression. If the list is empty, ZRAM might not be active. Also, check your disk swap usage with:
Bash
swapon --showIf you see a partition like /dev/nvme0n1p3 or similar, you are still using physical disk swap.
Step 2: Disable Physical Swap (Permanently)
Warning: This step involves editing your filesystem table (fstab). A mistake here can make your system unbootable. We will first create a backup.
- Turn off swap immediately:This command disables all swap devices (both disk and ZRAM) for the current session.
Bash
sudo swapoff -a - Backup your fstab file (CRITICAL STEP):Before editing, save a copy of the original file.
Bash
sudo cp /etc/fstab /etc/fstab.bak - Edit the fstab file:We need to prevent the disk swap from mounting at boot.
Bash
sudo nano /etc/fstab - Comment out the swap line:Look for a line that ends with swap or has a type swap. Add a # symbol at the very beginning of that line to comment it out.
Example before:
UUID=xxxx-xxxx none swap sw 0 0Example after:
# UUID=xxxx-xxxx none swap sw 0 0
Press CTRL+O to save and CTRL+X to exit.
Step 3: Configure ZRAM with zstd
Fedora 43 still defaults to lzo-rle in some configurations, so forcing zstd via config is still the best optimization trick.
Create/Edit the config file:
Bash
sudo nano /etc/systemd/zram-generator.conf- Paste the following configuration:This setup creates a ZRAM device using the zstd algorithm. I prefer setting the size to half of my physical RAM, but capped at 8GB to be safe (though you can go higher if you wish).
Ini, TOML
[zram0] zram-size = min(ram / 2, 8192) compression-algorithm = zstdNote for Power Users: The syntax
min(ram / 2, 8192)means it will take 50% of your RAM but never more than 8GB. If you have 64GB RAM like my desktop, you might want to increase the cap (e.g.,16384for 16GB).
Press CTRL+O to save and CTRL+X to exit.
Step 4: Apply Changes
To apply ZRAM changes instantly without rebooting:
Reload systemd configurations:
Bash
sudo systemctl daemon-reloadRestart the ZRAM service:
Bash
sudo systemctl restart systemd-zram-setup@zram0.service
Step 5: Final Verification
Now, let’s confirm everything is exactly as we want it.
Run the status command again:
Bash
zramctlYou should see:
NAME:
/dev/zram0ALGORITHM:
zstd(This confirms the new compression is active)DISKSIZE: Around 4G or 8G (depending on your RAM).
DATA: How much uncompressed data is in there.
COMPR: How much actual RAM it is taking (this number should be much lower than DATA!).
Finally, check that no physical disk is being used:
Bash
swapon --show
You should only see /dev/zram0 in this list.
You may also read:
Stop Googling Commands: The 3 Best AI Tools for Linux Help in 2025
7 Underrated Websites I Visit Daily Instead of Scrolling Social Media (2025 Edition)
Save Money in 2025: 5 Open Source Apps That Replaced Paid Software in My Workflow
By switching to ZRAM with zstd, I have noticed smoother multitasking on my ThinkPad P14s and zero waiting times on my Desktop PC. Plus, I am saving write cycles on my NVMe drives, prolonging their lifespan.
The era of physical swap partitions is over for desktop Linux.
Have you made the switch to ZRAM-only? Or do you still trust a physical partition? Let me know in the comments below!
Disclaimer: Modifying system partitions and swap settings is done at your own risk. Always ensure you have backups of your data

