Skip to content

Swap file add

2019.01.02 22:03

WHRIA 조회 수:2132

From Ubuntu 18.04 onwards, a swapfile rather than a dedicated swap partition is used. The swap file is named "swapfile". To change the size of this swap file:

  1. Disable the swap file and delete it (not really needed as you will overwrite it)

    sudo swapoff /swapfile
    sudo rm  /swapfile
    
  2. Create a new swap file of the desired size.
    Determine the size of your swap file. If you want to make a 4 GB swap file, you will need to write 4 * 1024 blocks of 10242 bytes (= 1 MiB). That will make your count equal to 4 * 1024 = 4096. Create the file of this size with the command

    sudo dd if=/dev/zero of=/swapfile bs=1M count=4096
    
  3. Assign it read/write permissions for root only (not strictly needed, but it tightens security)

    sudo chmod 600 /swapfile
    
  4. Format the file as swap:

    sudo mkswap /swapfile
    
  5. The file will be activated on the next reboot. If you want to activate it for the current session:

    sudo swapon /swapfile
    

You can check the swap that is available with the command swapon -s (no root permissions needed).

번호 제목 글쓴이 날짜 조회 수
1159 으아.. 예진이 15개.... Han 2004.07.08 2073
1158 미래 [1] 휘야 2005.04.07 2073
1157 FEDORA 3 로 서버 교체.. [1] han 2004.11.02 2073
1156 한글사용..과연 올바른가... aris 2005.09.01 2073
1155 열난다 열나 han 2005.09.27 2073
1154 살이 분다. [1] WHRIA 2005.11.10 2073
1153 올만에 수영했더니 han 2005.11.29 2073
1152 컴퓨터 한대 더 주문하다. han 2005.12.03 2073
1151 푹 쉬었던 이번 주말 han 2006.02.27 2073
1150 검색 봇 WHRIA 2006.03.25 2073
1149 배경 음악 하나 추가 file WHRIA 2006.04.19 2073
1148 미국 han 2006.04.28 2073
1147 홈페이지를 조금 고쳤습니다. 한승석 2001.03.02 2074
1146 Re: 별과 소년 (맞나..? --;;) 검사자 2002.02.06 2074
1145 Re: 오늘은 중문과 해변을 구경갔습니다. 안소정 2003.02.12 2074

Powered by Xpress Engine / Designed by Sketchbook

sketchbook5, 스케치북5

sketchbook5, 스케치북5

나눔글꼴 설치 안내


이 PC에는 나눔글꼴이 설치되어 있지 않습니다.

이 사이트를 나눔글꼴로 보기 위해서는
나눔글꼴을 설치해야 합니다.

설치 취소