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 No Comments on How To Add Swap Space On Ubuntu 22.04 LTS

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:  Make Ubuntu Terminal Look Like Kali Linux [2023]

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 Hide a File Or Folder In Ubuntu 22.04 LTS? How To Hide a File Or Folder In Ubuntu 22.04 LTS? Tutorials
How To Install Docker On Ubuntu 22.04 LTS [User Guide] How To Install Docker On Ubuntu 22.04 LTS [User Guide] How To Ubuntu
How To Install Remmina On Ubuntu 22.04 LTS Jammy JellyFish How To Install Remmina On Ubuntu 22.04 LTS Jammy JellyFish How To Ubuntu
Ubuntu 22.04 LTS Beta Released Ubuntu 22.04 LTS Beta Released Ubuntu 22.04
How To Compile And Install Kernel On Ubuntu How To Compile And Install Kernel On Ubuntu [2023] Linux
How To Install Git On Ubuntu 22.04 LTS [2023] How To Install Git On Ubuntu 22.04 LTS [2023] Ubuntu 22.04

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • 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
  • Linux Wget Examples September 27, 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]
  • Senior Data Scientist Consultant – Marketing & Strategy

    • New York, NY (Remote)
    • Sia
    • Full Time
  • Service Writer

    • Apex, NC
    • Hendrick Automotive Group
    • Full Time
  • Sr. Customs Entry Writer

    • Seffner, FL
    • Rooms To Go
    • Full Time
  • Customs Entry Writer ILaredo, TX

    • Laredo, TX
    • FNS Customs Brokers Inc
    • Full Time
  • Service Writer, AgRev – Henderson

    • Henderson, KY
    • AGCO
    • Full Time
  • Service Writer – Hall of Fame Harley-Davidson

    • Cuyahoga Falls, OH
    • American Road Group
    • Full Time
  • Service Writer I

    • Gillette, WY
    • Wyoming Machinery
    • Full Time
  • Automotive Service Writer

    • Salem, VA
    • VIOCF
    • Full Time

Copyright © 2025 Technology News Information & Jobs.

Powered by PressBook Grid Blogs theme