# 스왑 활성화 영역 확인
[root@localhost ~]# swapon -s
Filename Type Size Used Priority
[root@localhost ~]# free
total used free shared buffers cached
Mem: 1020748 945260 75488 0 20052 786928
-/+ buffers/cache: 138280 882468
Swap: 0 0 0
# 4G 추가
[root@localhost ~]# dd if=/dev/zero of=/swapfile bs=1M count=4096
4096+0 records in
4096+0 records out
4294967296 bytes (4.3 GB) copied, 124.143 s, 34.6 MB/s
# 스왑영역 생성
[root@localhost ~]# mkswap /swapfile
mkswap: /swapfile: warning: don't erase bootbits sectors
on whole disk. Use -f to force.
Setting up swapspace version 1, size = 4194300 KiB
no label, UUID=70d648c8-8ab1-42a6-bcef-8f0daa45107e
# 스왑영역 활성화
[root@localhost ~]# swapon /swapfile
[root@localhost ~]# swapon -s
Filename Type Size Used Priority
/swapfile file 4194296 0 -1
[root@localhost ~]# free
total used free shared buffers cached
Mem: 1020748 947980 72768 0 20052 786944
-/+ buffers/cache: 140984 879764
Swap: 4194296 0 4194296
# /etc/fstab 수정
/swapfile none swap sw 0 0
※ 스왑관리 도구명령어
- swapon : 스왑영역 활성화
- swapoff : 스왑영역 비활성화
- mkswap : 스왑영역 생성