Linux increased swap partition size 2016-08-2 13:54:58
Category: LINUX
know Linux, the standard Linux installation, swap partition is twice times the size of memory, if the memory is added, the swap partition will also increase
If you add 1G of memory, the swap partition will increase by 2G
decide to modify the swap size, first create a swap file for partitioning in a space where appropriate: such as/swap1
#dd if=/dev/zero of=/swap1 bs=1m count=2048
If the infile,of means that outfile,bs=1m represents the increased module size, count=2048 represents 2048 modules, or 2G space
set the destination file to the swap partition file:
#mkswap/swap1
activate swap to enable swap partition files immediately:
#swapon/swap1
after restarting the system, the swap space will lose/swap1, and adding/SWAP1 to the/etc/fstab entry will allow the system to invoke Swapon-a from the Mount/swap1 in the init process, so that each time the machine restarts/ Swap1 are in a valid swap space.
Iv. Add the following line to the/etc/fstab file:
/swap1 Swap swap defaults 0 0
done! Use free to view swap sizes!
Linux increases swap partition size