Hi at all,
I have a Pi 2B and only use it for Phiole and wireguard. It is installed on a 4gb Card. The Pi tells me there is not enough space when updating. Can I simply disable swap file? Why ist 4gb not sufficient?
Best wishes.
Swapfile really needed? Topic is solved
Re: Swapfile really needed?
Hi,
many thanks for your message. Basically SWAP setting depends on your application and usage. By default, DietPi will create a swap file fir SBC running less than 2GB RAM. If you just running PiHole + Wireguard, it could be ok to disable SWAP as it should not use that much. However you never know if there are other processes, like updates, who might need more RAM. I would recommend to use free -m (available memory) or htop to check current usage and then to assure that total memory (including swap) is at least double of size of what is currently used, to cover peaks. Best is to perfrom checks not directly after reboot, as for sure there not much RAM uses. Therefore let it run for some days and check how it looks like.
Regarding disk space, you can have a look using df -h how much space is left on your device. For safety reason, DietPi expect at least 500 MB free space if you run dietpi-software
many thanks for your message. Basically SWAP setting depends on your application and usage. By default, DietPi will create a swap file fir SBC running less than 2GB RAM. If you just running PiHole + Wireguard, it could be ok to disable SWAP as it should not use that much. However you never know if there are other processes, like updates, who might need more RAM. I would recommend to use free -m (available memory) or htop to check current usage and then to assure that total memory (including swap) is at least double of size of what is currently used, to cover peaks. Best is to perfrom checks not directly after reboot, as for sure there not much RAM uses. Therefore let it run for some days and check how it looks like.
Regarding disk space, you can have a look using df -h how much space is left on your device. For safety reason, DietPi expect at least 500 MB free space if you run dietpi-software
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Re: Swapfile really needed?
thanks for your help. currently I have this situation:
https://abload.de/img/dietpigwjfu.png
I guess it is not enough space for an update. I only have pihole and wireguard installed. shouldn't there be more space left?
https://abload.de/img/dietpigwjfu.png
I guess it is not enough space for an update. I only have pihole and wireguard installed. shouldn't there be more space left?
Re: Swapfile really needed?
yes, the amount of used space is quite normal and similar to my system
Anyway, let's check your memory usage and if we can reduce SWAP. Pls can you post free -m
Code: Select all
root@DietPi4:~# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/root 29G 3.5G 25G 13% /
devtmpfs 1.9G 0 1.9G 0% /dev
tmpfs 1.9G 1.6M 1.9G 1% /dev/shm
tmpfs 1.9G 8.3M 1.9G 1% /run
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 1.9G 0 1.9G 0% /sys/fs/cgroup
tmpfs 2.0G 0 2.0G 0% /tmp
tmpfs 50M 28K 50M 1% /var/log
/dev/mmcblk0p1 253M 55M 198M 22% /boot
root@DietPi4:~#
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Re: Swapfile really needed?
problem is that I only have 400 MB available now 
there you go:
https://abload.de/img/dietpi2k5j98.png

there you go:
https://abload.de/img/dietpi2k5j98.png
Re: Swapfile really needed?
Hi,
there is no need to do screen prints. You are able to copy the content from putty directly. Just mark it in putty and paste it here
let's reduce your SWAP file down to 512MB. pls do
You should have sufficient free space now
there is no need to do screen prints. You are able to copy the content from putty directly. Just mark it in putty and paste it here

Not really a problem, just a small challengeproblem is that I only have 400 MB available now

let's reduce your SWAP file down to 512MB. pls do
Code: Select all
/boot/dietpi/func/dietpi-set_swapfile 512
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Re: Swapfile really needed?
not sure what you mean exactly. But DietPi is using quite some tmpfs already
Code: Select all
root@DietPi3:~# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/root 15G 1.2G 13G 9% /
devtmpfs 456M 0 456M 0% /dev
tmpfs 488M 0 488M 0% /dev/shm
tmpfs 488M 13M 476M 3% /run
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 488M 0 488M 0% /sys/fs/cgroup
tmpfs 50M 8.0K 50M 1% /var/log
tmpfs 743M 0 743M 0% /tmp
/dev/mmcblk0p1 253M 55M 198M 22% /boot
root@DietPi3:~#
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Re: Swapfile really needed?
I thought using RAM and completely abandon swap file unless it is needed (RAM is full). that would save space.
Re: Swapfile really needed?
Well SWAP was used on the picture you shared
https://abload.de/img/dietpi2k5j98.png
That's why we reduced it by 50% to gain space but still have some SWAP file if needed.
https://abload.de/img/dietpi2k5j98.png
That's why we reduced it by 50% to gain space but still have some SWAP file if needed.
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team