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:  Linux Lite 6.0 Based on Ubuntu 22.04 LTS Released

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 Fix "package dependencies cannot be resolved" Error In Ubuntu 22.04 LTS How To Fix “package dependencies cannot be resolved” Error In Ubuntu 22.04 LTS Tutorials
Must Have Apps For Ubuntu 22.04 LTS Must Have Apps For Ubuntu 22.04 LTS Ubuntu 22.04
Ubuntu Autoremove Ubuntu Autoremove Command Debian Autoremove Command Debian
Linux Kernel 6.0 Released, Multiple Ways To Upgrade Linux Kernel In Ubuntu 22.04 LTS Linux Kernel 6.0 Released, Multiple Ways To Upgrade Linux Kernel In Ubuntu 22.04 LTS Ubuntu 22.04
Ubuntu Studio 22.04 LTS Released Ubuntu Studio 22.04 LTS Released Date And Features Ubuntu 22.04
How To Install Python On Ubuntu 22.04 LTS How To Install Python On Ubuntu 22.04 LTS Ubuntu 22.04

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]
  • TECHNICAL WRITER

    • Virginia Beach, VA
    • VSolvit LLC
    • Full Time
  • Customs Entry Writer

    • Lombard, IL
    • Clutch Global Logistics, Inc.
    • Full Time
  • Technical Telecom Documentation Writer

    • Dallas, TX
    • Nokia
    • Full Time
  • Technical Writer – Information Technology

    • Anchorage, AK
    • Bering Straits Native Corporation
    • Full Time
  • Tech Writer/Editor Sr

    • Sterling Heights, MI
    • Zolon Tech Solutions, Inc.
    • Full Time
  • Senior Lead Data Engineer (Python, EMR, Databricks, AWS)

    • Plano, TX (Remote)
    • Capital One
    • Full Time
  • Technical Writer / Editor

    • Newton, MA
    • 804 Technology
    • Full Time
  • Technical Writer

    • San Diego, CA
    • A-Line Staffing Solutions
    • Full Time

Copyright © 2025 Technology News Information & Jobs.

Powered by PressBook Grid Blogs theme