Page 1 of 1

How to Add SWAP ?

Posted: Thu Oct 23, 2025 12:58 am
by robclark
Is there a recommended procedure to add a swapfile to a NanoPi Zero2, with one of the Linux distros?

Using rk3528-eflasher-debian-bookworm-core-6.1-arm64-20250811.img does not seem to allow adding a Swap file.

Re: How to Add SWAP ?

Posted: Sun Oct 26, 2025 8:35 am
by robclark
Success. Here is how I did it

  • Flashed rk3528-eflasher-multiple-os-20250812-30g.img to SD card
  • Installed SD into NanoPi Zero2 and booted
  • SSH to 192.168.1.231 (login:root password:fa)

Code: Select all

eflasher --disable-overlayfs -i /mnt/sdcard/debian-bookworm-core-arm64/

  • Power Off NanoPi > Remove SD > Power On NanoPi
  • SSH to NanoPi-Zero2.lan (login:root password:fa)

Code: Select all

fallocate -l 1G /swapfile
dd if=/dev/zero of=/swapfile bs=1M count=1024
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
echo '/swapfile none swap sw 0 0' >> /etc/fstab