Skip to content

Instantly share code, notes, and snippets.

@Medigato
Medigato / ubuntu-make-swap-file.sh
Created August 5, 2023 11:55 — forked from namgivu/ubuntu-make-swap-file.sh
increase swap file size to 8Gb
# ref. https://askubuntu.com/a/1075516/22308
sudo swapoff /swapfile # make all swap off
sudo rm -rf /swapfile # remove the current
# 8*1024Mb=8192Mb
# 4*1024Mb=4096Mb
sudo dd if=/dev/zero of=/swapfile bs=1M count=4096 # resize the swapfile to 8Gb
sudo chmod 600 /swapfile
@namgivu
namgivu / ubuntu-make-swap-file.sh
Last active March 5, 2025 11:37
increase mymory by swap file
# ref. https://askubuntu.com/a/1075516/22308
sudo swapoff /swapfile # make all swap off
sudo rm -rf /swapfile # remove the current
# 8Gb=8*1024Mb=8192 Mb
# 4Gb=4*1024Mb=4096 Mb
sudo dd if=/dev/zero of=/swapfile bs=1M count=4096 # resize the swapfile to 4Gb
# =