ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • Centos7 swap 메모리 설정
    카테고리 없음 2020. 12. 30. 04:05
    728x90

    Centos7 swap 메모리 설정

    1. swapfile 생성

    $ fallocate -l 2GB /swapfile

    fallocate 명령어로 생성 안될 경우 아래 명령어로 생성. count 뒷부분이 swap file 용량

    $ dd if=/dev/zero of=/swapfile count=5096 bs=1MiB

    2. swap file 권한 설정

    $ chmod 600 /swapfile

    3. 스왑 포맷 형태로 파일 변환

    $ mkswap /swapfile

    4. 스왑 파일 시스템 등록

    $ swapon /swapfile

    5. 등록된 swap memory 확인

    $ swapon --summary
    $ free -h

    6. 스왑 파일 삭제

    6-1. 스왑 사용 비활성화

    $ swapoff swapfile

    6-2. 스왑 파일 삭제

    $ rm /swapfile

    다음 부팅시 스왑 공간을 사용하지 않게 /etc/fstab 에 등록된 항목도 삭제 해야 합니다.

    참고 자료

    728x90
Designed by Tistory.