How to use the Linux swapoff command

Source: Internet
Author: User

Swapoff is actually a swapon symbolic connection, which can be used to close the swap zone of the system.

Syntax

Swapoff [device]

Parameters:

  • -A: disable all the devices configured as swap in the/etc/fstab file.
  • -H help information
  • -V version information

Instance

Display partition information:

# Sfdisk-l // display partition information

Disk/dev/sda: 1305 cylinders, 255 heads, 63 sectors/track

Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0

Device Boot Start End # cyls # blocks Id System

/Dev/sda1*0 + 12 13-104391 83 Linux

/Dev/sda2 13 1304 1292 10377990 8e Linux LVM

/Dev/sda3 0-0 0 0 Empty

/Dev/sda4 0-0 0 0 Empty

Disk/dev/sdb: 652 cylinders, 255 heads, 63 sectors/track

Sfdisk: ERROR: sector 0 does not have an msdos signature

/Dev/sdb: unrecognized partition

No partitions found

Disable swap partition.

# Swapoff/dev/sda2 // disable swap partition

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.