• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

swapon: command not found

by admin

The swapon command is used to activate a swap partition in a specified device. The swapoff command is used to deactivate the swap space on a device.

Some of the frequently used swapon and swapoff command options are given in the following table.

Option Used To
swapon -e Skip non-existent devices.
swapon -a Activate all of swap space.
swapoff -a Deactivate all of swap space.

If you encounter the below error while running the swapon command:

swapon: command not found

you may try installing the below package as per your choice of distribution:

OS Distribution Command
OS X brew install util-linux
Debian apt-get install mount
Ubuntu apt-get install mount
Alpine apk add util-linux
Arch Linux pacman -S util-linux
Kali Linux apt-get install mount
CentOS yum install util-linux
Fedora dnf install util-linux
Raspbian apt-get install loop-aes-utils

swapon Command Examples

1. Consult /etc/fstab for devices marked sw. Use those in place of the devices argument.

# swapon -a

2. Used with -a. Don’t complain about missing devices.

# swapon -ae

3. Print help message, then exit.

# swapon -h

4. Specify a priority for the swap area. Higher priority areas will be used up before lower priority areas are used.

# swapon -p 5 /var/tmp/swapfile

5. Print swap usage summaries, then exit.

# swapon -s
Filename				Type		Size	Used	Priority
/dev/dm-1               partition	268435452	0	-1
/swapfile               file	      102396	0	-2

6. Print version information, then exit.

# swapon -V

Filed Under: Linux

Some more articles you might also be interested in …

  1. CentOS / RHEL : How to install and start the Apache httpd service
  2. pacman4console Command Examples in Linux
  3. CentOS / RHEL : How to resize (extend) existing Physical Volume (PV)
  4. How to Verify if a Disk/Partition is in Use by Oracle ASM, was used by Oracle ASM or is never used by Oracle ASM
  5. numlockx: command not found
  6. ipcrm: command not found
  7. What are the Network Bonding Modes In CentOS / RHEL
  8. Xen Hypervisor (xm) command Cheat Sheet
  9. What are “segfault” messages in /var/log/messages file
  10. numlockx Command Examples in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • protonvpn-cli Command Examples in Linux
  • protonvpn-cli connect Command Examples
  • procs Command Examples in Linux
  • prlimit: command not found

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright