a description of the problem:
When installing Oracle 10g under a Linux system, it is found that the swap partition is too small to expand the size of the swap partition manually.
We all know how to allocate a swap partition when installing a Linux system, and how to set up or adjust the swap partition when the system is installed (in operation).
There are two ways to create a swap partition after the Linux system is installed.
1. Create a new disk partition as a swap partition
2. Use the file as a swap partition (easier to operate, I'm more used)
These two methods are described below: (both must be rooted, and the procedure should be handled with caution.) )
Two solutions:
A. Create a new disk partition as a swap partition
1. Enter the console as root (login system), enter
# swapoff-a #停止所有的swap分区
2. Use the Fdisk command (example: # FDISK/DEV/SDB) to partition the disk, add a swap partition, create a new partition, and use the "T" command in Fdisk to change the newly added partition ID to ". Linux swap Type". Finally, the operation is actually written to the hard disk with W (the operation is not valid until W is useless).
3. # mkswap/dev/sdb2 #格式化swap分区, the sdb2 here depends on the actual partition device name displayed after you add the P command
4. # SWAPON/DEV/SDB2 #启动新的swap分区
5. In order for the system to start automatically enable this swap partition, you can edit/etc/fstab, add the following line
/DEV/SDB2 swap swap defaults 0 0
Second, use the file as a swap partition
1. Create a file to be a swap partition: increase the 1GB size of the swap partition, the command is written as follows, where count equals the number of blocks you want (bs*count= file size).
# dd If=/dev/zero of=/root/swapfile bs=1m count=1024
2. Format the swap partition file:
# Mkswap/root/swapfile #建立swap的文件系统
3. Enable the Swap partition file:
# Swapon/root/swapfile #启用swap文件
4. Make the system self-enabled when booting, add a line in file/etc/fstab:
/root/swapfile swap swap defaults 0 0
Linux new and added swap partitions