Skip to content

Instantly share code, notes, and snippets.

@qifei
Created December 4, 2024 17:51
Show Gist options
  • Save qifei/bce5185c25b36af841cd045685b83a27 to your computer and use it in GitHub Desktop.
Save qifei/bce5185c25b36af841cd045685b83a27 to your computer and use it in GitHub Desktop.
該死的 NanoPi 安裝 OpenWrt 後,主分區空間極其有限(≈100MB),基本上裝不了幾個軟件包。儘管你的 eMMC / SD 容量很大,但是刷入 OpenWrt 後,系統只能利用到其中不到 2GB 的空間,其餘容量都被摒棄。

Log into your OpenWrt instance via SSH and install these prerequisites:

opkg update
opkg install parted losetup resize2fs

Now you can download and execute a helper script which will add the expansion to 100% free space on next boot:

wget -U "" -O expand-root.sh "https://openwrt.org/_export/code/docs/guide-user/advanced/expand_root?codeblock=0"
. ./expand-root.sh

Now reboot the device whenever convenient and afterwards you should see tons of new space using df -h command:

Filesystem                Size      Used Available Use% Mounted on
/dev/root                13.7G     52.0M     13.6G   0% /
tmpfs                   994.3M    200.0K    994.1M   0% /tmp
tmpfs                   512.0K         0    512.0K   0% /dev

source: Benjamin Höglinger-Stelzer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment