When installing the Linux system, the initial set of swap space is not enough to be used in the actual use, need to increase the swap space;
All the following operations require root user privileges;
To increase the swap capacity step:
1. Create a partition using the DD command
DD If=/dev/zero Of=/home/swap bs=1024 count=10240000
A partition file is created/home/swap. File size is 10.24 million block,bs for 1 blocks of size 1k, here to create 10G size swap;
# Ll/home/swap
-rw-r--r--1 root root 10485760000 April 15:29/home/swap
2, the creation of the file into a swap partition,-f parameter enforcement;
/sbin/mkswap-f/home/swap
3. Make the Swap partition valid
/sbin/swapon/home/swap
FREE-M View swap space has increased 10G space, this setting machine restart after the failure, want to be permanent, need to join the Fstab file;
4, Vim/etc/fstab Add a row, save exit, restart also effective; Remember that you cannot delete the/home/swap file, the newly added swap space will not exist after deletion;
/home/swap swap swap defaults 0 0
This article is from the "Model Student's Learning blog" blog, please be sure to keep this source http://mofansheng.blog.51cto.com/8792265/1916092
How to increase the swap capacity of Linux system