openwrt resize root

712次阅读

装上cfdisk

opkg update
opkg install cfdisk

cfdisk操作很直观,选择rootfs分区后选择[resize],然后再[write]之后就好了。
但是用df -h查看,根目录分区的大小并没有变化,还需要resize2fs操作一下

opkg install resize2fs
resize2fs /dev/sda2

不过我的在这一步报错了

resize2fs: Invalid argument While checking for on-line resizing support

搜了下可能是这个原因https://bugs.openwrt.org/index.php?do=details&task_id=2951
然后这样操作一下

opkg install tune2fs
mount -o remount,ro / 
tune2fs -O^resize_inode /dev/sda2
e2fsck -f /dev/sda2
# 一路按y

重启reboot

resize2fs

resize2fs /dev/sda2

df -h看一下

正文完