Reducing the size of the BBB Ubuntu rootfs

Hey Robert, I’m working on a custom board and have everything up and going but since it’s much more simple than the BBB I think I can cut out a lot of what is in your Ubuntu 20.04 image. I’m just starting to research how to get a smaller rootfs up and going. I tried a vanilla Ubuntu Base 20.04 and that seems to be way too sparse.

Before I get to far I wanted to see if you had any advice on the best path forward? I don’t need things like cape managers, graphics, etc… I have my kernel whittled way down, I just need the rootfs to match.

EDIT: I have 256MB for RAM so it would be nice to be able to get a rootfs less than that so I can tftp it to the eMMC without having to increase the DDR size, not sure if that’s feasible?

Thanks,
Adam

Hi @AdamGerken, at one time i played that game, I had debian down to 75MB, but you ended up with a system that only had apt/dpkg/perl/python…

Here is the last version I ever uploaded:

https://rcn-ee.net/rootfs/eewiki/barefs/debian-8.8-bare-armhf-2017-06-12.tar.xz

It really wasn’t too useable… For ‘small’ os, Buildroot really shines…

You can grab some ideas from here:

grep for chroot_very_small_image in that script…

Regards,

Yeah, I looked at buildroot briefly. What about just deleting firmware I don’t need? Looks like that would get me down to about 200MB. The device doesn’t need to have any of that available, it will only be used for one specific purpose.

Yeah, you can nuke the firmware directory… Look at nuking the man pages…

Regards,

Cool, that helped a lot. down to 195MB so fingers crossed I can transfer it to eMMC with my puny 256MB RAM.

EDITL: ugh, gotta be close but it looks like I’m still hitting the end of RAM.

Hello Robert,

I have requirements similar to Adam. A while back (2016?) there was a “small file system” option available in the “Getting Started with the BeagleBone Black” tutorial. It was less than 400MB, which allowed it to fit nicely into the 512MB DDR on the board. I would like to upgrade to the latest version of Debian, but I see the “small file system” option is no longer available. Why was this option dropped? Did you use the chroot.sh script to create the smaller file system?

Daven

Hi @dmccalla , at the time i created that bare root file system, i had a target of under 512Mb to fit into flash.

In the end, it really wasn’t too useful, as it was just perl + dpkg…

This was also pre-systemd…

Today, honestly, if you need a really small Root File System, just use Buildroot or Yocto, and you’ll get more functionality at the micro Root File system sizes…

Regards,