SWAP — изменение размера файла
В примере новый размер swap - 1гб
- Turn off all swap processes
sudo swapoff -a
- Resize the swap
sudo dd if=/dev/zero of=/swap.img bs=1G count=1
if = input file
of = output file
bs = block size
count = multiplier of blocks
- Change permission
sudo chmod 600 /swap.img
- Make the file usable as swap
sudo mkswap /swap.img
- Activate the swap file
sudo swapon /swap.img
- Edit /etc/fstab and add the new swapfile if it isn't already there
/swap.img none swap sw 0 0
- Check the amount of swap available
grep SwapTotal /proc/meminfo