Got a NanoPi R6S with FriendlyWRT and want OpenWRT on the eMMC? The OpenWRT sysupgrade images work but only use ~120MB of your 32GB eMMC. Here’s how to get the full space.
⚠️ WARNING: This process involves writing directly to storage devices and modifying bootloaders. There is a risk of bricking your device. Proceed at your own risk - I am not responsible for any damage to your hardware.
📝 NOTE: Commands shown are from macOS. Some syntax may differ on Linux (e.g.,
bs=1m
vsbs=1M
, device names).
Flash to SD Card First
wget https://downloads.openwrt.org/releases/24.10.1/targets/rockchip/armv8/openwrt-24.10.1-rockchip-armv8-friendlyarm_nanopi-r6s-ext4-sysupgrade.img.gz
gunzip -c openwrt-*.img.gz | sudo dd of=/dev/diskX bs=1m
Boot from the SD card, SSH in.
Flash to eMMC
Check which device is which:
lsblk
Usually mmcblk0 is SD card, mmcblk1 is eMMC. Download and flash:
wget https://downloads.openwrt.org/releases/24.10.1/targets/rockchip/armv8/openwrt-24.10.1-rockchip-armv8-friendlyarm_nanopi-r6s-ext4-sysupgrade.img.gz
gunzip -c openwrt-24.10.1-rockchip-armv8-friendlyarm_nanopi-r6s-ext4-sysupgrade.img.gz | dd of=/dev/mmcblk1 bs=1M
Expand the Partition
parted /dev/mmcblk1 resizepart 2 100%
Now the partition is big but the filesystem is still tiny:
df -h
# Only shows ~122MB
The Problem
Trying to resize while mounted fails:
resize2fs /dev/mmcblk1p2
# resize2fs: Invalid argument While trying to add group #1
Online resizing doesn’t work when going from such a small to large size.
The Fix
Boot from SD card to resize the eMMC filesystem while unmounted.
# Disable eMMC boot temporarily
dd if=/dev/zero of=/dev/mmcblk1p1 bs=1M count=1
reboot
Now you’ll boot from SD card. Resize the eMMC:
resize2fs /dev/mmcblk1p2
Works perfectly:
Resizing the filesystem on /dev/mmcblk1p2 to 7561216 (4k) blocks.
The filesystem on /dev/mmcblk1p2 is now 7561216 (4k) blocks long.
Restore and Boot from eMMC
# Copy boot partition back
dd if=/dev/mmcblk0p1 of=/dev/mmcblk1p1 bs=1M
reboot
Remove SD card. You now have OpenWRT using the full eMMC space.