Create a Linux swap

Creating Swap

Use free-h to view the current memory usage, whether there are swap

free -h

Memory Usage
Swap has a good distribution, you can not configure, of course, refer to the following configuration

1. Create a file swap partitions: increase the size of the swap partition 2G, count equal to the desired block size

dd if=/dev/zero of=/home/swap bs=1024 count=2048000

Successful configuration
2. Set the swap file

mkswap /home/swap

Setting Success
3. Enable the swap file

swapon /home/swap

Enable Success
4. Check again to memory conditions free -h, the results have changed

free -h

Here Insert Picture Description
So far, Swap created

Published 11 original articles · won praise 0 · Views 138

Guess you like

Origin blog.csdn.net/u012590718/article/details/104946064