Resizing root partition on USB flash drive

Hi all,

I have openwrt running off a usb flash drive that has 32 GB of space. I would like to openwrt to use up all the available space and I came across the following:

https://openwrt.org/docs/guide-user/advanced/expand_root

Do I just run the automated script on the bottom of the guide?

The image that was installed on the flash drive was:
openwrt-23.05.4-x86-64-generic-ext4-combined-efi.img.gz

I read that attempting to resize on a live USB can corrupt the file system but it seems like the automated script in the link above does this at the startup. I appreciate any feedback. Thanks.

I used the script a while ago and it worked flawlessly. If you are unsure and afraid of data loss, use Gparted from a live linux distribution.

1 Like

Thank you. I will try it and report back.

It worked and was very simple to do! The documentation could be clearer in that guide though. Just for anyone else reading this and looking to resize you need to install the packages listed on the guide first:

opkg update
opkg install parted losetup resize2fs

Then create the script file by running:

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

Run the script:

. ./expand-root.sh

Finally reboot (it will take a bit longer than usual). Thanks again for your help kukulo.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.