Skip to content
Technology News Information & Jobs

Technology News Information & Jobs

Ubuntu Tutorials, Ubuntu How To , Linux Tips, Tech Jobs

  • Work with US
  • Search Jobs
  • Post a Job
  • Contact Us
  • Ubuntu
    • Ubuntu 18.04
  • Ubuntu 20.04
  • Ubuntu 22.04
  • Themes
  • Linux
  • Laptops
  • Tutorials
  • Job Dashboard
  • Toggle search form
How To Add Swap Space On Ubuntu 22.04

How To Add Swap Space On Ubuntu 22.04 LTS

Posted on June 2, 2022 By admin

How To Add Swap Space On Ubuntu 22.04

Swap space is the part of the HDD or SDD that is designed to help the operating system temporarily store data. The data or information that the OS cannot hold in RAM is stored in Swap space. It is useful when there is more load on RAM.

In this tutorial, we will see the steps to add swap space on Ubuntu 22.04 LTS.

How To Add Swap Space On Ubuntu 22.04

You can check if the Ubuntu already has some swap space available with the following command.

sudo swapon --show

You should get an output if you have swap space available other you won’t get any output. Now, you can create the swap space from the available HDD space or SDD space. Run the following command to see if there is any space available or not.

df -h

If you have 2 GB RAM then you can create 2 GB swap space accordingly. Run the following command to create swap file at first. You need to convert the swap file to swap space later.

sudo fallocate -l 2G /swapfile

You can verify that the correct amount of space was reserved by typing:

ls -lh /swapfile
-rw-r--r-- 1 root root1.0G Apr 25 11:14 /swapfile

Now, after creating the swap file, you need to turn this into swap space. Meanwhile, you need to change the file permission to the root level to prevent further modification from the users.

sudo chmod 600 /swapfile

 

READ More Relevant Stuff:  Ubuntu 22.04 LTS Codename Is "Jammy Jellyfish"

Verify the permissions change by typing:

ls -lh /swapfile
Output
-rw------- 1 root root 2.0G May 01 05:15 /swapfile

As you can see, only the root user has the read and write flags enabled.

Now run the following command to change the file as swap space by typing:

Sudo mkswap /swapfile

Now, run the following command to inform your system and let your system use it as a swap space.

sudo swapon /swapfile

You can verify that the swap is available by running the following command:

sudo swapon --show
Ubuntu 22.04

Post navigation

Previous Post: Fix driver irql_less_or_not_equal [2023]
Next Post: Install Deepin Desktop Environment On Ubuntu 22.04 LTS

Related Posts

How To Install Nvidia Drivers On Ubuntu 22.04 LTS How To Correctly Install Uninstall Linux Ubuntu Nvidia Drivers Fast Ubuntu
Ubuntu Budgie 22.04 LTS Released Ubuntu Budgie 22.04 LTS Released Ubuntu
How To Upgrade Ubuntu 20.04 LTS To Ubuntu 22.04 LTS How To Upgrade Ubuntu 20.04 LTS To Ubuntu 22.04 LTS [2023] Ubuntu 20.04
How To Install Vim On Ubuntu 22.04 LTS How To Install Vim On Ubuntu 22.04 LTS Tutorials
Download Lubuntu 22.04 LTS | Best Lightweight Linux Distro Download Lubuntu 22.04 LTS | Best Lightweight Linux Distro Ubuntu 22.04
How To Remove A Snap Package From Ubuntu 22.04 LTS How To Remove A Snap Package From Ubuntu 22.04 LTS Ubuntu

Recent Posts

  • New Job Search October 10, 2025
  • How To Enable Hibernate in Ubuntu 22.04 LTS May 20, 2024
  • Popular Ubuntu Games: Top 5 Games To Play March 17, 2024
  • WordPress | Your site doesn’t include support for the “generateblocks/container” block GenerateBlocks Plugin February 11, 2024
  • Ubuntu Autoremove Command Debian Autoremove Command February 10, 2024
  • How To Mount Windows 11 Shares on Debian Linux December 7, 2023
  • Anonymous Browsing 101: A Deep Dive Into Residential Proxies November 20, 2023
  • How To Correctly Install Uninstall Linux Ubuntu Nvidia Drivers Fast October 31, 2023
  • Ethical Web Design: The Dos and Don’ts October 28, 2023
  • Understanding the Role of Security Operations Center October 25, 2023
  • The Positive Effects of AI Tools and Online Services on Students Successful Essay-Writing Skills October 3, 2023

Categories

  • Android
  • Apple
  • Blogs
  • Debian
  • Fix
  • Gadgets
  • Game
  • Google
  • How To Ubuntu
  • Internet
  • Laptops
  • Linux
  • Linux Commands
  • Linux Game
  • Linux Mint
  • News
  • Operating Systems
  • Security
  • Technology
  • Themes
  • Tools
  • Tutorials
  • Ubuntu
  • ubuntu 18.04
  • Ubuntu 20.04
  • Ubuntu 22.04
  • Windows 11
  • Wordpress
  • Search Jobs
  • Post a Job
  • Job Dashboard
  • Contact Us
  • About US
  • Cookie Policy
  • Terms and Conditions
  • Privacy Policy
  • Sitemap
  • Write For US

Tags

android apps centos ChatGPT command Commands Debian deepin Desktop docker Fedora fix game games Gaming gnome google kernel linux linux commands linux kernel Linux laptops Linux Mint Linux themes minecraft NVIDIA Python Raspberry Pi sysadmin themes ubuntu ubuntu 18.04 Ubuntu 18.04 LTS Ubuntu 20.04 ubuntu 20.04 lts Ubuntu 22.04 LTS Ubuntu games Ubuntu kernel ubuntu themes ubuntu tutorial VirtualBox Windows Windows 11 Wine WSL
itsubuntu.com is an Equal Opportunity Employer. For Advertisement, Jobs, Guest posts, and any other thoughts, email us at [email protected]
  • Grant Writer

    • Beverly Hills, CA
    • MY SERENITY SANCTUARY
    • Full Time
  • UX Writer

    • Boston, MA
    • Pyramid Consulting, Inc
    • Part Time
  • Grant Writer

    • Gillette, WY
    • YES House (Youth Emergency Services, Inc.)
    • Part Time
  • User Experience Writer

    • Chicago, IL
    • Tonic3
    • Full Time
  • Lead Data Architect & Engineer – AWS

    • Richardson, TX (Remote)
    • State Farm
    • Full Time
  • Take 5 – Lube Tech/Service Writer

    • Derby, KS
    • VANTEDGE AUTO T5 LLC
    • Full Time
  • Nonclinical Writer

    • Philadelphia, PA
    • MMS
    • Full Time
  • Senior Document Writer – New Group Business

    • Carson City, NV
    • CVS Health
    • Full Time

Copyright © 2025 Technology News Information & Jobs.

Powered by PressBook Grid Blogs theme