Power & Source of Big Ideas

How to Add SWAP ?

Moderators: chensy, FATechsupport

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

Who is online

In total there are 2 users online :: 0 registered, 0 hidden and 2 guests (based on users active over the past 5 minutes)
Most users ever online was 5265 on Sun Aug 31, 2025 11:40 pm

Users browsing this forum: No registered users and 2 guests