swapon 功能說明:激活交換分區 使用mkswap命令創建交換分區后,分區並沒有生效,還需要使用swapon命令使之生效。 參數選項 -s 顯示所有交換分區的信息 [root@cs6 ~]# mkswap -f /dev/sdb1 Setting up swapspace version 1, size = 417652 KiB no label, UUID=5ce3d626-5794-4990-9980-489d49e4d930 [root@cs6 ~]# swapon /dev/sdb1 [root@cs6 ~]# df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/vg_cs6-lv_root 26G 1.7G 24G 7% / tmpfs 931M 0 931M 0% /dev/shm /dev/sda1 477M 28M 424M 7% /boot [root@cs6 ~]# free -m total used free shared buffers cached Mem: 1989 176 1813 0 5 40 -/+ buffers/cache: 129 1860 Swap: 3479 0 3479 [root@cs6 ~]# swapoff /dev/sdb1 [root@cs6 ~]# free -m total used free shared buffers cached Mem: 1989 176 1813 0 5 40 -/+ buffers/cache: 129 1860 Swap: 3071 0 3071