Close Menu
Linux All DayLinux All Day
    Facebook Bluesky Mastodon X (Twitter)
    Linux All DayLinux All Day
    • News
    • Operating Systems
      • Linux Distributions
      • Android-based OS
      • ChromeOS Alternatives
    • Software
      • Apps & Tools
      • Desktop Environments
      • Installation & Management
    • Tutorials
      • Linux Basic & Tips
      • System Optimization
      • Security & Privacy
    • Linux Gaming
      • Game News & Reviews
      • Emulators & Retro
      • Performance & Benchmarks
    • Comparisons
    Mastodon Bluesky Facebook
    Linux All DayLinux All Day
    Home - Tutorials - System Optimization - ZRAM Linux Guide: Why I Stopped Using Swap Partitions (2025)

    ZRAM Linux Guide: Why I Stopped Using Swap Partitions (2025)

    ow to reclaim your SSD space and boost performance by moving swap to RAM—tested on high-end workstations and older laptops.
    By Mitja System Optimization November 21, 20255 Mins Read
    Share Facebook Bluesky Twitter Threads Reddit LinkedIn Telegram Tumblr Email Copy Link Pinterest
    Follow Us
    Facebook Mastodon Bluesky X (Twitter)
    Terminal output showing zramctl command with zstd compression algorithm enabled on Fedora Linux
    Share
    Facebook Twitter Bluesky Reddit Threads Tumblr Email Copy Link

    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 --show

    If 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.

    1. Turn off swap immediately:This command disables all swap devices (both disk and ZRAM) for the current session.

      Bash

      sudo swapoff -a
      
    2. Backup your fstab file (CRITICAL STEP):Before editing, save a copy of the original file.

      Bash

      sudo cp /etc/fstab /etc/fstab.bak
      
    3. Edit the fstab file:We need to prevent the disk swap from mounting at boot.

      Bash

      sudo nano /etc/fstab
      
    4. 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 0

      • Example 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.

    1. Create/Edit the config file:

      Bash

      sudo nano /etc/systemd/zram-generator.conf
      
    2. 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 = zstd
      
      • Note 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., 16384 for 16GB).

      Press CTRL+O to save and CTRL+X to exit.

    Step 4: Apply Changes

    To apply ZRAM changes instantly without rebooting:

    1. Reload systemd configurations:

      Bash

      sudo systemctl daemon-reload
      
    2. Restart 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

    zramctl

    You should see:

    • NAME: /dev/zram0

    • ALGORITHM: 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

    Follow on Mastodon Follow on Bluesky
    Share. Facebook Twitter Bluesky Reddit Threads Telegram Email Copy Link

    Related post

    TLP vs Power-Profiles-Daemon: The Ultimate Linux Battery Guide (2026 Edition)

    November 29, 2025

    Stop Wasting RAM: How to Use ZRAM on Linux

    November 19, 2025

    A Beginner’s Guide to Nginx Proxy Manager on Linux

    November 13, 2025
    Leave A Reply Cancel Reply

    → Switch to Linux Today
    • Facebook
    • Twitter
    • Mastodon
    • Bluesky
    More From Linuxallday
    Beyond the Grid: Mastering the Zen Flow of Bryce Tiles
    Mozilla Confirms Full “AI Kill Switch” for Firefox, Arriving in Early 2026
    Rescuezilla Review 2025: The ‘Undo Button’ for Your Entire PC
    Tails OS Review 2025: The Ultimate Amnesic System for Total Privacy
    Facebook X (Twitter) Mastodon Bluesky Threads RSS
    • About Us
    • Cookie Policy
    • Terms & Conditions
    • Privacy Policy
    • Disclosure & Disclaimer
    • Contact
    • Our Authors
    • Cookie Policy (EU)
    © 2026 Designed by FeedCrux

    Type above and press Enter to search. Press Esc to cancel.

    Manage Consent
    To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
    Functional Always active
    The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
    Preferences
    The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
    Statistics
    The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
    Marketing
    The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
    • Manage options
    • Manage services
    • Manage {vendor_count} vendors
    • Read more about these purposes
    View preferences
    • {title}
    • {title}
    • {title}