[Solved] No swap in DietPi v6.24.1

Having issues with your DietPi installation, or, found a bug? Post it here.
Post Reply
74cmonty
Posts: 18
Joined: Tue Jan 15, 2019 5:25 pm

[Solved] No swap in DietPi v6.24.1

Post by 74cmonty »

Hi,
I have check swap in DietPi v6.24.1 but there's none:

Code: Select all

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:

Code: Select all

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

#----------------------------------------------------------------
# PHYSICAL DRIVES
#----------------------------------------------------------------
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.

THX

Update:
Follow instructions here to create swap file manually.
User avatar
MichaIng
Site Admin
Posts: 2425
Joined: Sat Nov 18, 2017 6:21 pm

Re: [Solved] No swap in DietPi v6.24.1

Post by MichaIng »

@74cmonty
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:

Code: Select all

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.
Post Reply