Expanding ext4 OpenWrt storage on the same physical device?

I currently run my openWRT on a raspberry pi 4 running off a thumb drive device with 32GB of storage. The openWRT install is ext4 and boots from the flash drive correctly with one change in the cmdline.txt I believe. But I want to install adguard home and apparently I need more storage for that. I saw the extroot guide but that seems more geared for actually adding a separate flash drive when running off an SD card, and I'd prefer to still use my thumb drive for the main install. I wasn't sure how to adapt the guide for my use case. I'm fine with a separate partition if required.

I did it with RPI and used the guide. The extra space was dev/mmcblk0p5 on my Pi.

df -h    

Should show you the partitions on your system.

1 Like

It's not about it being on an rpi necessarily, but about me using USB as the primary storage device and wanting to expand storage on the same device.

might help


Thanks, does it matter that the rpi4 is not x86?

rpi runs a linux with ext4, right? so in theory should not matter. but as always every change has its risks, so take backup, download anything you might need upfront and be ready if something goes wrong you may need to reinstall firmware.

or, create a new partition on the usb stick, format to ext4, mount it as /sorage for example, install docker using /storage as data dir and run adguard as docker image.

or, create a custom firmware with imagebuilder with a bigger rootfs and then sysupgrade.


I'm using the rpi4 as the openwrt router, not as a separate device running linux and I don't have an extra. I think this option:

create a custom firmware with imagebuilder with a bigger rootfs and then sysupgrade

Is the only one that will work for me. No idea how to do this though, is there a guide?

Are you using this guide? This recipe is geared to ExtRoot on USB.


The following assumes that you will be creating your extroot as an EXT4 filesystem on your OpenWRT device with a connected USB flash drive. The process is similar for other kinds of devices.

1 Like

hm, you are using a linux based kind of distro specialized in networking called openwrt => so you are running linux.

and yes, there is guide. please check openwrt documentation https://openwrt.org/docs/guide-user/start or use search.


I saw that but from my understanding it requires you have your OS on internal storage or a SD card, and are expanding it with an additional device (a USB stick). Or at least, that was my understanding.

My mistake, I understand now. Thanks, I'll look into this.

I have come across this far later - 2023. I tried a few methods and there is now a better way described in the user guide pages at https://openwrt.org/docs/guide-user/advanced/expand_root that worked for me on 2 raspberry pi 4B images.
This was linked from the x86 page at https://openwrt.org/docs/guide-user/installation/openwrt_x86#resizing_filesystem

1 Like