Expanding rootfs on RPi

I have OpenWrt installed on an 8GB SDHC card in an RPi2, and it only uses 280MB of space.

How do I expand the rootfs to use up all the space?

I remember when installing Raspbian a while ago that on first boot there was an option to use all the available space, but I don't know how that was achieved.

Here is a link showing how to do it on Raspbian

https://www.raspberrypi.org/forums/viewtopic.php?t=195836

Unfortunately I don't have raspi-config.

Have you tried the forum search already?
I think I have seen someone else with the same problem...

1 Like

If you have a computer with a SD card slot, you can use a program like GParted to resize the partition.

I was curious as to how Raspbian achieves this effortlessly...

The source for raspi-config is available here:- https://github.com/asb/raspi-config/blob/master/raspi-config.

It's a shell script so may even work on OpenWrt....

I'm completely lost by your inquiry. I've never heard of an offline Operating System re-partitioning itself, nor an online one able to do so with root (/).

What is your question?

The partitions already exist in OpenWrt, if you use that, you'll have to re-copy each one, or re-write the script....WHY???

You cannot expand a partition containing root while the partition is mounted and in-use, so what you describe is not possible. If you're going to use another computer to run the script anyway, you could just run a GUI and use a program like Gnome Partition Editor (GParted) to accomplish your task.