A swap file can be very handy in the GameShell, especially when compiling new games… I’m still fairly new to Linux. I was considering adding a swap partition, but remembering the hassle when expanding the partition in CW 1.0, I decided that a swap file would be the simpler and safer route to go. A little research resulted in the following procedure:
- Create an empty file (1K * 1M = 1GiB).
sudo mkdir -v /var/cache/swap cd /var/cache/swap sudo dd if=/dev/zero of=swapfile bs=1K count=1M sudo chmod 600 swapfile
- Convert newly created file into a swap space file.
sudo mkswap swapfile
- Enable file for paging and swapping.
sudo swapon swapfile
swapon -s or
top -bn1 | grep -i swap
Should display line like:
MiB Swap: 1024.0 total, 1024.0 free To disable, use
sudo swapoff swapfile command.
- Add it into
fstabfile to make it persistent on the next system boot.
echo "/var/cache/swap/swapfile none swap sw 0 0" | sudo tee -a /etc/fstab
- Re-test swap file on startup by:
sudo swapoff swapfile sudo swapon -va
Note: This procedure was taken directly from the AskUbuntu.com.
Shutdown and Restart now take a little longer… It’s not really a problem for me.