Updated on 2023-05-29 GMT+08:00

Creating a SWAP Partition

  1. Use partitions/disks as the swap partition.

    Run the following command to configure the swap partition.

    mkswap /dev/vdg

  2. Run the following command to enable the swap partition.

    swapon /dev/vdg

  3. Write the following information to /etc/fstab.

    echo "UUID=43a73**********d1f433 swap swap defaults 0 0" >> /etc/fstab

  4. Run the following command to check the size of the current memory and swap space. The default unit is KB, and the unit of -m is MB

    free -m

  5. Run the following command to check swap information, including detailed information about files and partitions.

    swapon -s