Swap故障一例
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Swap故障一例相关的知识,希望对你有一定的参考价值。
错误:swapoff: /dev/dm-1: swapoff failed: Cannot allocate memory解决方法:
[[email protected] ~]# swapon -s Filename Type Size Used Priority /dev/dm-1 partition 3145724 1524700 -1 [[email protected] ~]# swapoff /dev/dm-1 swapoff: /dev/dm-1: swapoff failed: Cannot allocate memory [[email protected] home]# dd if=/dev/zero of=/home/swap bs=1024 count=512000 512000+0 records in 512000+0 records out 524288000 bytes (524 MB) copied, 1.2637 s, 415 MB/s [[email protected] home]# mkswap /home/swap mkswap: /home/swap: warning: don't erase bootbits sectors on whole disk. Use -f to force. Setting up swapspace version 1, size = 511996 KiB no label, UUID=155bb4be-29cb-4e95-9581-24e11be6188f [[email protected] home]# swapon /home/swap [[email protected] home]# free -m total used free shared buffers cached Mem: 3832 3550 282 0 4 166 -/+ buffers/cache: 3378 453 Swap: 3571 1495 2076 [[email protected] home]# swapoff /dev/dm-1 [[email protected] ~]# free -m total used free shared buffers cached Mem: 3832 3711 120 0 2 19 -/+ buffers/cache: 3689 143 Swap: 499 499 0 [[email protected] home]# swapon /dev/dm-1 [[email protected] home]# free -m total used free shared buffers cached Mem: 3832 3717 114 0 1 25 -/+ buffers/cache: 3691 140 Swap: 3571 495 3076 [[email protected] home]# swapoff /home/swap [[email protected] home]# free -m total used free shared buffers cached Mem: 3832 3725 106 0 0 15 -/+ buffers/cache: 3710 122 Swap: 3071 476 2595
以上是关于Swap故障一例的主要内容,如果未能解决你的问题,请参考以下文章