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