I. Problem description:
When installing Oracle 10 Gb in Linux, we find that swap partition is too small. We need to manually expand the size of swap partition.
Solution 2:
2.1 create a partition
The following operations must be performed under the root user. First, create a partition and run the DD command, such
Dd If =/dev/Zero of =/home/swap BS = 1024 COUNT = 1024000
This will create a partition file such as/home/swap. The file size is 1024000 blocks. Generally, 1 block is 1 K, so the space is 1024 MB.
2.2 specify the partition type as swap
Convert the partition into a swap partition. Run the mkswap command as follows:
/Sbin/mkswap/home/swap
Then use the swap partition to make it valid.
/Sbin/Swapon/home/swap
Now, run the free-M command to check the memory and swap partition size, and we can see that the space is increased by MB.
2.3 set the extended swap partition to auto mount
However, after the computer is restarted, it is found that swap is still so large, the new swap is not automatically started, and manual start is required.
Modify the/etc/fstab file and add the following line to automatically mount the command line:
/Home/swap defaults 0 0
From: http://it.jinghua.cn/448342/124227251163.shtml