Swap Emergency
Create an emergency swap file when RAM is critically low.
A intermediate Linux challenge worth 10 points. Solve it hands-on in a real Linux environment in your browser - no local setup, no fake shells.
The Challenge
A Java service heap is ballooning at 2 AM. free -h shows only 200 MB RAM left. You have minutes before the OOM killer fires.
Your tasks:
- Create a 2 GB swap file at /swapfile using fallocate
- Set permissions to 600 and format with mkswap
- Activate with swapon and verify with free -h
- Add a persistent entry to /etc/fstab
- Run check to validate