How to Create a Root File System for Linux using Busybox

Beaglebone black board






In this article, we will show how to create a root file system for linux using busybox.

Busybox is an organization that distributes source code free of charge (licensed under the GNU GENERAL PUBLIC LICENSE) that helpers engineers to design root file systems for various types of embedded microcomputers, one for example being a beaglebone board.

The busybox software cuts the memory size constraints of a full-fledged root file system, such as one used for a general-purpose computer.

For embedded applications, not nearly as much functionality may be needed and with the dual combination that embedded applications tend to have much less memory, it makes a lot of sense and may be a necessity for a much-smaller root file system.

So how does this work?

The first thing is, you would download the source code from the busybox website found at the following link, https://busybox.net/downloads/

Downloading the latest source file is normally the way to go, as it has the most support for the latest boards.

As of creating this article, the latest version of the busybox source code is the busybox-1.35.0.tar.bz2

This is shown below.


Busybox 1.35.0.tar.bz2 source code


Once you have downloaded this file to your linux system, then you need to extract the files, as this is a compressed folder.

After this, go to the linux terminal and cd into the root of the busybox folder representing this source code.

Once you have done this, run the following command shown below.





Once you run this command, the configuration should commence, such as that shown below.


Apply the default configuration to busybox source code in linux


Once this is done, one configuration can be changed for the time being.

We will make this a static build instead of a dynamic build for a first root file system creation using busybox.

To do this, go to the terminal and type in the following command below.





This will open up the busybox menu configuration GUI, where we can make setting changes.


Busybox configuration menu


Click on Settings, which is highlighted above.

Then scroll down to where you see, Build static binary (no shared libs), which is shown below.


Busybox static build binary in configuration menu


To select this option, simply press the Spacebar.

Then exit and save the changes.

Next, we install and actually have the root file system installed on our computer.

This is done through the code of the general format shown below.





You don't actually have to install the root file system in a actual linux kernel file. You can install it any place on your computer, inside or outside of a linux kernel.

In my case, I decided to install it in my computer's Download directory.

This is shown below.


Installing the root file system built using busybox source code in linux


Once the installation is complete, you should see the following output, such as that shown below.


Completion of the installation of the root file system built using busybox source code in linux


If you now go to the folder where you installed the root file system, you should see it there present.


Busybox root file system directory created on linux computer


If we take a look at the properties of this root file system created by busybox and see how much memory it takes up.


Busybox root file system directory properties- Memory size


We can see here that the total size of this root file system is just 1.5MB, which is significantly less than full-functionality root file systems, which can be around 15MB, thus, busybox makes very efficient.

Know that this is the size without having removed unwanted or unnecessary commands from the Busybox software, so if we wanted to (and many times it will be required), we can get this 1.5MB down even further to fit the memory constraints of our embedded system.

So this is the whole big deal of busybox. It can put the root file system down to a size that is appropriate for an embedded system.

And this is how to create a root file system for a linux operating system using busybox software.



Related Resources





HTML Comment Box is loading comments...