Help Center/ Bare Metal Server/ User Guide (Paris Region) / FAQs/ OS FAQs/ How Do I Increase the Swap Partition Size?
Updated on 2022-02-22 GMT+08:00

How Do I Increase the Swap Partition Size?

Scenarios

When you install the Oracle database for a Linux OS, the swap partition size will be checked. If the swap partition cannot meet requirements, you can perform the operations in this section to increase the swap partition size.

The swap partition is similar to the virtual memory of the Windows OS. When the memory is insufficient, some hard disk space is virtualized into memory to improve the system running efficiency.

Procedure

  1. Log in to the BMS OS.
  2. Run the lsblk command to check the size of the swap partition.

    The size of the swap partition is 3 GB.

  3. Run the following command to increase the swap partition size by 5 GB (example):

    dd if=/dev/zero of=/swapfile bs=1M count=5000

    chmod 600 /swapfile

    mkswap /swapfile swapon /swapfile echo "/swapfile swap swap defaults 0 0" >>/etc/fstab

  4. Run the lsblk command to check the size of the expanded swap partition.

    The size of the swap partition is 8 GB.