How to expand file system on Lora Server OS SD card

I thought I posted this question here before but can’t find it even after searching. So I am asking again.

I downloaded the full Lora Server OS image and flashed that onto an 16 gb sd card.

I expanded the sd card using this procedure https://elinux.org/Beagleboard:Expanding_File_System_Partition_On_A_microSD

But I cannot expand the file system to suit the larger partition because this command (resize2fs) is missing from the Yocto derived Lora Server OS.

I am running a Postgres db integration and am fast running out of space on the small image.

Can anyone help explain how to expand the files system without that command?

Not an answer to your question, but storing a database - especially a large and busy one - on an SD card is probably not a good idea from a longetivity and reliability perspective.

If you really want to store application data on the node, a simple option could be an extra partition just for that, but realistically an entirely separate storage device would be better - ie, a USB stick or another SD card. Given that card flash translation layers do not seem to have any knowledge of or respect for partition boundaries, it’s probably better to not have the data and the system software on the same physical storage.

We have an extensive existing IoT network where we store data on MySQL db’s running on Sd cards within Raspberry Pi’s. This data is constantly being uploaded into a central db in the cloud. But the local on-site storage provides a valuable layer of redundancy and acts as buffer when we have connectivity issues.

We do occasionally get SD card failures but it’s not a big issue to simply swop out with a new card.

I intend to the same in this case.

So thanks for the comment but this mode works very well in our use case.

My problem is I have expanded the image to take up full size of the card, as I explained above, but the Yocto based operating system will not allow me to expand the file system to match the card size.

So that is the problem I’m trying to solve.

While I still think it’s a bad idea, two simple solutions would be to temporarily put the card in a fully featured desktop linux box and resize it there, or create another partition on the card for the database.

You could probably even use the same embedded board booting off debian-based card and putting the yocto one in a USB cardreader to resize it.

Ok, that sounds interesting!

Excuse my ignorance, but will I be able to expand a Yocto based file system by simply plugging the card into another Linux machine (or even a Mac) and then issuing the expand file command from there?

Is that what you are suggesting?

I’m not any sort of Linux specialist so this is all new to me.

I suppose I would have to mount the sd card or something like that?

Any specific hints would be greatly appreciated.