9:52 root@hostname:/> swapon -s
Filename Type Size Used Priority
/swap.img file 8388604 8388520 -2
9:53 root@hostname:/> dd if=/dev/zero of=swap32g.img count=32 bs=1GiB
32+0 records in
32+0 records out
34359738368 bytes (34 GB, 32 GiB) copied, 129.372 s, 266 MB/s
9:56 root@hostname:/> mkswap swap32g.img
mkswap: swap32g.img: insecure permissions 0644, 0600 suggested.
Setting up swapspace version 1, size = 32 GiB (34359734272 bytes)
no label, UUID=e8a99a10-0742-4f10-9f61-09340b1a06ca
10:00 root@hostname:/> swapon swap32g.img
swapon: /swap32g.img: insecure permissions 0644, 0600 suggested.
10:01 root@hostname:/> chmod 644 swap.img
10:01 root@hostname:/> swapon -s
Filename Type Size Used Priority
/swap.img file 8388604 8388448 -2
/swap32g.img file 33554428 0 -3
1.swap 생성
dd if=/dev/zero of=swap32g.img count=32 bs=1GiB
mkswap swap32g.img
chmod 600 swap32g.img
swapon swap32g.img
2. 확인
swapon -s
3.부팅시에 적용하기
vi /etc/fstab 에 아래 내용 추가
/swap32g.img none swap sw 0 0
댓글