OpenWRT ROOT Relocation

本文最后更新于 2025年1月27日 下午

Why are we doing this?

Sometime customized openwrt OS root partion(/) is too small, we need extend or Relocate the root path.


Let’s get started

1
2
3
4
5
6
7
8
$ mkdir -p /tmp/introot
$ mkdir -p /tmp/extroot
$ mount --bind / /tmp/introot
$ mount /dev/sdb4 /tmp/extroot
$ tar -C /tmp/introot -cvf - . | tar -C /tmp/extroot -xf -
$ umount /tmp/introot
$ umount /tmp/extroot

Update in fstab before next boot

1
2
root@OpenWrt:~# blkid | grep sdb4
/dev/sdb4: UUID="93206a0f-9bf8-6a44-a0c7-4609451a107f" BLOCK_SIZE="4096" TYPE="ext4" PARTLABEL="Linux data partition" PARTUUID="87539ce8-8096-4737-9af8-73a0938ac03d"

1
2
3
root@OpenWrt:~# df -Th /
Filesystem Type Size Used Available Use% Mounted on
/dev/sdb4 ext4 27.9G 1.3G 25.1G 5% /

OpenWRT ROOT Relocation
https://msfts.org/2024/05/29/OpenWRT-ROOT-Relocation/
作者
Jas0n0ss
发布于
2024年5月29日
许可协议