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:  How To Set JAVA_HOME Environment Variable On Ubuntu 22.04

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 WhatsApp Client On Ubuntu 22.04 LTS/ Ubuntu 20.04 LTS Install WhatsApp Client On Ubuntu 22.04 LTS/ Ubuntu 20.04 LTS How To Ubuntu
Ubuntu Studio 22.04 LTS Released Ubuntu Studio 22.04 LTS Released Date And Features Ubuntu 22.04
How To Install Microsoft Teams On Ubuntu 22.04 LTS And Other Linux How To Install Microsoft Teams On Ubuntu 22.04 LTS And Other Linux Linux
How To Install Deepin Desktop Environment On Ubuntu 22.04 LTS Install Deepin Desktop Environment On Ubuntu 22.04 LTS How To Ubuntu
Install PHP Mcrypt Extension On Ubuntu 22.04/Debian [Updated] Install PHP Mcrypt Extension On Ubuntu 22.04/Debian [Updated] How To Ubuntu
How To Upgrade To Xfce 4.18 on Ubuntu How To Upgrade To Xfce 4.18 on Ubuntu How To Ubuntu

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]
  • Psychological Thriller- Co-writer

    • Remote
    • Mary Stone Publishing
    • Temporary
  • Writer – Trends, Reactive & Licensed

    • New York, NY
    • Cella
    • Full Time
  • Principal Architect – LINUX – Active Top Secret Required

    • Washington DC
    • AECOM
    • Full Time
  • Artificial Intelligence (AI) Specialist (San Francisco)

    • San Francisco, CA
    • Forhyre
    • Full Time
  • Digital Transformation Architect (Berkeley)

    • Berkeley, MO
    • BOEING
    • Part Time
  • Azure Architect

    • Washington DC
    • AIS (Applied Information Sciences)
    • Full Time
  • Senior Data Engineer (Python)

    • Newport News, VA (Remote)
    • Capital One Bank
    • Full Time
  • Commercial Director, AI & Optimization

    • Foster, CA
    • Gilead Sciences
    • Full Time

Copyright © 2025 Technology News Information & Jobs.

Powered by PressBook Grid Blogs theme