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

Configuring the Swap Partition

  1. Use partitions/disks as the swap partition.

    Run the following command to configure the swap partition.

    mkswap /dev/vdd

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

    swapon /dev/vdd

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

    echo "UUID=43a73cdb-4359-4141-a255-b86156d1f433 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