Can't create swapfile

Having issues with your DietPi installation, or, found a bug? Post it here.
Post Reply
Sptz
Posts: 16
Joined: Mon Aug 17, 2020 7:31 pm

Can't create swapfile

Post by Sptz »

I've tried through the drive-manager and no luck. Tried on both eMMC and external SSD and nothing happens. I just had an issue where I believe the whole system ran out of ram so threw everything out as none of my applications are accessible (plex, sonarr etc) and htop shows very little processes.

SWP in htop shows as 0k/0k all the time as well

Anything I can do?
User avatar
Joulinar
Posts: 2300
Joined: Sat Nov 16, 2019 12:49 am

Re: Can't create swapfile

Post by Joulinar »

Hi,

many thank's for your request. To be sure you are running out of memory, you could run free -m to check memory usage.

To create a swap file, you could try following

Code: Select all

/boot/dietpi/func/dietpi-set_swapfile 512 # Sets swap size to 512 MiB
/boot/dietpi/func/dietpi-set_swapfile 0 # Removes the swap file completely
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
User avatar
WarHawk
Posts: 622
Joined: Thu Jul 20, 2017 8:55 am

Re: Can't create swapfile

Post by WarHawk »

Only problem is with a swapfile is it will increase read/writes to the SD Card immensly

Hopefully they will have the ZRAM and ZSWAP option implemented very soon
User avatar
Joulinar
Posts: 2300
Joined: Sat Nov 16, 2019 12:49 am

Re: Can't create swapfile

Post by Joulinar »

A first basic implementation of ZRAM will be done with next release. ZSWAP will take some time :)

https://github.com/MichaIng/DietPi/issu ... -682158346
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Post Reply