[Solved] No swap in DietPi v6.24.1

I have check swap in DietPi v6.24.1 but there’s none:

root@pc5-raspi:~# free -m
              total        used        free      shared  buff/cache   available
Mem:            226          81          36           9         108          86
Swap:             0           0           0

However I used dietpi-config and dietpi-drive_manager respectively and configured swap.
After rebooting Raspi there’s no swap memory.

There’s an entry in /etc/fstab for swap, though:

root@pc5-raspi:~# tail /etc/fstab
/var/swap    none    swap    sw    0   0

PARTUUID=27504eef-02 / auto defaults,noatime,rw 0 1
PARTUUID=27504eef-01 /boot auto defaults,noatime,rw 0 1

Please advise how to fix this.


Follow instructions here to create swap file manually.

Hmm, works perfectly well. Perhaps the script claims that something is wrong, which should produce some output.

If you want to debug, we can test the script that is used by dietpi-drive_manager in the end:

cp -a /etc/fstab /etc/fstab.bak
/DietPi/dietpi/func/dietpi-set_swapfile 1 /path/to/your/swap

This will disable the current swap, and create a new one at /path/to/your/swap with a size so that your overall memory is 2G. At least it should.