【Pro-test and easy to use! ] Add swap partition to Alibaba Cloud ECS server CentOS6.5
Learning to install oracle database installation today, I found that my SWAP partition is too small and does not meet the requirements, so I want to expand the swap space, Baidu adds its own practice, the operation is as follows:
Create a swap partition using the dd command
[root@localhost Desktop]#dd if=/dev/zero of=/home/swap bs=1024 count=1048576
The calculation formula of count: count=SIZE*1024 (size is in MB)
This creates a /home/swap partition file with a size of 1G, and then needs to format the new SWAP partition:
[root@localhost Desktop]# mkswap /home/swap
Then use the swapon command to convert this file partition into a swap partition
[root@localhost Desktop]#swapon /home/swap
(The command to close the SWAP partition is: [root@localhost Desktop]#swapoff /home/swap)
Check it again with free -m, you can see that the swap has expanded.
In order to allow swap to mount automatically, modify the /etc/fstab file
vi /etc/fstab
add at the end of the file
/home/swap swap swap default 0 0
In this way, even if the system is restarted, the swap partition does not need to be manually mounted.
Article source: http://blog.chinaunix.net/uid-26881541-id-3347389.html
Please indicate: Method SEO Consultant » [Pro-test and easy to use! ] Add swap partition to Alibaba Cloud ECS server CentOS6.5