Swap is an exchange partition under the Ubuntu system, its function and function is somewhat similar to our Windows system virtual memory, the user opens this function to let the Ubuntu system run more convenient, the swap operation mode divides into the manual operation and the automatic running two kinds of forms, Some users will find it troublesome to run manually, but some users do not know how to add swap to the startup of Ubuntu, below see Small series for you to provide the Operation method Bar!
1. Add Swap
Add 2G swap partition, just modify count=2k
sudo dd if=/dev/zero of=/swap.disk bs=1m count=2k
sudo mkswap-f/swap.disk
sudo swapon/swap.disk
Or
sudo dd if=/dev/zero of=/swap.disk bs=1m count=2k && sudo mkswap-f/swap.disk && sudo swapon/swap.disk
2. Join start
sudo vi/etc/rc.local
Add before exit 0:
#sudo DD If=/dev/zero of=/swap.disk bs=1m count=2k && sudo mkswap-f/swap.disk && sudo swapon/swap.disk
sudo mkswap-f/swap.disk && sudo swapon/swap.disk
Exit 0
By using this method, users can add swap to the Ubuntu boot entry, so that you do not have to manually mount the swap partition every time you turn on the system