관리 메뉴

커리까지

리눅스 메모리 스왑 본문

리눅스

리눅스 메모리 스왑

목표는 커리 2021. 3. 12. 13:29
728x90
SMALL

1. 루트 계정

$ su -

2. 스왑파일 만들기

fallocate -l 32GB /swapfile

3. 파일 용량 배정하기

dd if=/dev/zero of=/swapfile bs=1024 count=32000000

4.스왑 파일 설정하기

mkswap /swapfile
swapon /swapfile
chmod 600 /swapfile
blkid /swapfile 
vi /etc/fstab
UUID=xxxxxxxxxxxx swap swap defaults 0 0

삭제하기

swapoff swapfile
rm /swapfile

su빠져나가기

su [변경할 사용자명]

스왑 끄기

sudo swapoff -v /swapfile
728x90
LIST
Comments