先本身增長一塊磁盤spa
dd if=/dev/zero of=/tmp/newdisk bs=1M count =100
dd 操做磁盤從zero(盜零器)中產生0 到of 裏面去 ,產生塊大小1M 數量100 。code
[root@Carlton ~]# mkswap -f /tmp/newdisk 格式化 Setting up swapspace version 1, size = 102396 KiB no label, UUID=8fb9f68e-77da-4b86-b80e-7663edeb3c30 [root@Carlton ~]# free -m total used free shared buffers cached Mem: 996 919 76 11 35 336 -/+ buffers/cache: 547 449 Swap: 0 0 0 [root@Carlton ~]# swapon /tmp/newdisk [root@Carlton ~]# free -m total used free shared buffers cached Mem: 996 919 76 11 35 336 -/+ buffers/cache: 547 448 Swap: 99 0 99 [root@Carlton ~]# swapoff /tmp/newdisk [root@Carlton ~]# free -m total used free shared buffers cached Mem: 996 919 76 11 35 336 -/+ buffers/cache: 547 449 Swap: 0 0 0