Skip to content

Removing a Swap File

To remove a swap file:

  1. At a shell prompt as root, execute the following command to disable the swap file (where /swapfile is the swap file):

    # swapoff -v /swapfile
  2. Remove its entry from the /etc/fstab file.

  3. Remove the actual file:

    # rm /swapfile

Dipin Krishna

Written by Dipin Krishna

Senior full-stack engineer — 15 years across Django, Laravel, SwiftUI and the infrastructure underneath. Available for contract work.

Work with me →

Leave a note

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.