Swap file add
2019.01.02 22:03
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:
-
Disable the swap file and delete it (not really needed as you will overwrite it)
sudo swapoff /swapfile sudo rm /swapfile
-
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 commandsudo dd if=/dev/zero of=/swapfile bs=1M count=4096
-
Assign it read/write permissions for root only (not strictly needed, but it tightens security)
sudo chmod 600 /swapfile
-
Format the file as swap:
sudo mkswap /swapfile
-
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).
댓글 0
번호 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|
679 | 오늘 과 홈페이지를 설명회를 한다는데.. | han | 2005.09.15 | 2065 |
678 | 정신 팔다 당하다... | han | 2005.09.20 | 2065 |
677 | 밖에서 사먹는 음식을 조심하자 | han | 2005.09.23 | 2065 |
676 | 무서운 나라 ... 말레이시아 | han | 2005.10.03 | 2065 |
675 | 행복 이란 무엇 일까... | han | 2005.10.05 | 2065 |
674 |
천공의 성 라퓨타.
![]() | han | 2005.11.10 | 2065 |
673 | 피곤 피곤 | han | 2005.11.17 | 2065 |
672 | 군의관을 가는 시점.. [1] | 의대생 | 2005.11.26 | 2065 |
671 | 컴퓨터 한대 더 주문하다. | han | 2005.12.03 | 2065 |
670 |
사진이삼
[1] ![]() | J | 2006.01.23 | 2065 |
669 | Small Linux | han | 2006.03.31 | 2065 |
668 | 그냥 쉽게 하는 말 [1] | WHRIA | 2006.04.24 | 2065 |
667 | 회식 | han | 2006.05.20 | 2065 |
666 | FTP 서버를 열었습니다. | 한승석 | 2001.03.02 | 2064 |
665 | 냉정 | 한승석 | 2003.04.26 | 2064 |