dphys-swapfile
swap file management for Debian-based systems
TLDR
Disable swap file
$ dphys-swapfile swapoff
Enable swap file$ dphys-swapfile swapon
Create a new swap file$ dphys-swapfile setup
SYNOPSIS
dphys-swapfile command
DESCRIPTION
dphys-swapfile manages swap files on Debian-based systems, particularly useful on systems like Raspberry Pi. It automatically sizes the swap file based on available RAM.
Configuration is in /etc/dphys-swapfile.
PARAMETERS
setup
Create or resize swap fileswapon
Enable the swap fileswapoff
Disable the swap fileuninstall
Remove swap file
CONFIGURATION
/etc/dphys-swapfile
Configuration file for swap size, location, and behavior settings.
CAVEATS
Common on Raspberry Pi OS. Swap files on SD cards can reduce card lifespan. Consider using zram as an alternative. Configure CONF_SWAPSIZE in /etc/dphys-swapfile.
