Browse Source

#709 2GB swap file

v1.3
Christian Rotzoll 6 years ago
parent
commit
12270c4c69
  1. 7
      home.admin/90finishSetup.sh

7
home.admin/90finishSetup.sh

@ -13,13 +13,14 @@ if [ ${swapExists} -eq 1 ]; then
else
echo "No SWAP found ... creating 1GB SWAP on HDD"
sudo sed -i "12s/.*/CONF_SWAPFILE=\/mnt\/hdd\/swapfile/" /etc/dphys-swapfile
sudo sed -i "16s/.*/CONF_SWAPSIZE=1024/" /etc/dphys-swapfile
# comment or delete the CONF_SWAPSIZE line. It will then be created dynamically
sudo sed -i "16s/.*/#CONF_SWAPSIZE=/" /etc/dphys-swapfile
echo "OK - edited /etc/dphys-swapfile"
echo "Creating file ... this can take some seconds .."
sudo dd if=/dev/zero of=/mnt/hdd/swapfile bs=1024 count=1024000
sudo dd if=/dev/zero of=/mnt/hdd/swapfile count=2048 bs=1MiB
sudo chmod 0600 /mnt/hdd/swapfile
sudo mkswap /mnt/hdd/swapfile
sudo dphys-swapfile setup
sudo chmod 0600 /mnt/hdd/swapfile
sudo dphys-swapfile swapon
# expand FS of SD

Loading…
Cancel
Save