3 08 2018
CentOS – How to set SWAP Memory
1 2 3 4 5 6 7 |
[root@nuriware bin]# dd if=/dev/zero of=/root/swapfile bs=1024 count=5000000 5000000+0 records in 5000000+0 records out 5120000000 bytes (5.1 GB) copied, 25.8677 s, 198 MB/s |
1 |
[root@nuriware bin]# chmod 600 /root/swapfile |
1 2 3 4 5 6 7 8 9 |
[root@nuriware bin]# mkswap /root/swapfile mkswap: /root/swapfile: warning: don't erase bootbits sectors on whole disk. Use -f to force. Setting up swapspace version 1, size = 4999996 KiB no label, UUID=ad13ad1b-8f68-42f9-affe-0556f9541342 |
1 |
[root@nuriware bin]# swapon /root/swapfile |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
[root@nuriware bin]# swapon /root/swapfile [root@nuriware bin]# free -m total used free shared buffers cached Mem: 32080 31722 357 8371 329 12158 -/+ buffers/cache: 19234 12845 Swap: 4882 0 4882 [root@nuriware bin]# swapoff /root/swapfile [root@nuriware bin]# free -m total used free shared buffers cached Mem: 32080 31729 350 8371 330 12158 -/+ buffers/cache: 19241 12838 Swap: 0 0 0 |
swap delete
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
[root@nuriware bin]# swapoff /root/swapfile [root@nuriware bin]# free -m total used free shared buffers cached Mem: 32080 31729 350 8371 330 12158 -/+ buffers/cache: 19241 12838 Swap: 0 0 0 [root@nuriware bin]# rm /root/swapfile rm: remove 일반 파일 `/root/swapfile'? y [root@nuriware bin]# |
reboot : setting
1 |
[root@nuriware bin]# vi /etc/rc.local |
1 2 3 4 5 6 7 8 9 10 11 12 13 |
#!/bin/sh # # This script will be executed *after* all the other init scripts. # You can put your own initialization stuff in here if you don't # want to do the full Sys V style init stuff. touch /var/lock/subsys/local swapon /root/swapfile |
Port 확인후 Process kill Mac host 변경