|
|
@ -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 |
|
|
|