OpenWrt:img镜像文件扩容空间

OpenWrt 官方下载的镜像默认空间只有一百多兆,完全不够用的嘛,本文记录一下空间扩容步骤。

解压得到 img 镜像文件

gzip -d openwrt-squashfs-sysupgrade.img.gz

给 img 镜像文件末尾增加 6G 空间

dd if=/dev/zero bs=1G count=6 >> openwrt-squashfs-sysupgrade.img

对 img 镜像文件进行分区调整,使分区占满整个镜像文件

parted openwrt-squashfs-sysupgrade.img

# 显示出分区
print

# 将第二个分区调整为 100% 大小
resizepart 2 100%

# 完成退出
quit

最后,将 img 镜像文件重新打包

gzip openwrt-squashfs-sysupgrade.img