Skip to content

파일 스왑 기능 추가하기 #16

@sephid86

Description

@sephid86

레드헷 계열 문서

스왑 파일을 만듭니다. (ram 용량의 1.5가 적정하다고 합니다.)(예시는 4기가)
# dd if=/dev/zero of=/swapfile bs=1024 count=4194304

스왑 설정을 합니다.
# mkswap /swapfile

다른 사용자가 읽을수 없게 합니다.
# chmod 0600 /swapfile

부팅할때 활성화 되도록 /etc/fstab 파일에 아래 내용을 추가합니다.
/swapfile swap swap defaults 0 0

systemd 에 fstab 내용이 등록되도록 리로드 해줍니다.
# systemctl daemon-reload

스왑을 켭니다.
# swapon /swapfile

제대로 동작하는지 확인하는 방법입니다.

# cat /proc/swaps
# free -h

https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/7/html/storage_administration_guide/ch-swapspace#swap-creating-file

https://wiki.archlinux.org/title/Swap#Swap_file

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions