Building an Edison image and changing the root partition size
November 22, 2014
Update: As of February 2015, the newest version of the Edison image comes with a default root partition size of 1.4GB, which should be sufficiently large for most people. If you would still like to change the root partition size, these instructions should still work, but with a couple differences in the Linux source files, which are noted below.
I've been using Edison for a few weeks now, and one of the issues I quickly ran into was not having enough space in the
/dev/root partition. By default, the size is 512MB, which becomes very small once you start installing packages.
I started investigating on the forums and noticed this very helpful discussion on changing the partition's size. After some trial and error, I was able to build a new Edison image with a larger partition for
/dev/root, which I have summarized below. For reference, see this document for details on how to build an Edison image.
Before getting started, you also need a Linux machine. In my case, I created an Ubuntu 12.04 Vagrant VM on my Mac. The VM is provisioned with all the necessary packages to create an Edison image. It is also configured with 2GB of memory and with the ability to connect Edison via USB. You will also need about 30GB of disk space.
Getting the Linux source files
On your Linux machine, download the Edison Linux source files (
.tgz). Unpack the
.tgz file. If you saved it in the shared folder (if you are using the Vagrant VM), I suggest unpacking the file with the following command:
edison-src.tgz is the name of the downloaded file.
-C ~ unpacks it into the home directory of the VM. I ran into issues when building the image if the source files were in the shared directory.
Modifying the source files
edison.env. Based on which version of the Linux sources files you have, the location of the file is different. The quickest way to find it is by typing the following:
In my case, the file was originally located at:
As of February 2015, it is now located at:
To change the root partition size, update
rootfs in the partitions definition to the desired size in MB. In my case, I increased it from 512MB to 1024MB.
IMAGE_ROOTFS_SIZE to the same size as
edison.env. Note that the unit is block size, so multiply whatever number you used in
edison.env by 1024 and use the resulting value.
Building the image
Before going any further, I should mention that building an image can take HOURS. So, just keep that in mind before proceeding. To build the image:
- Navigate to the
- Initialize the build environment:
- Configure the shell environment:
- Build the image:
Once building the image is complete, copy the necessary files to the
As of February 2015, no modification to
flashall.sh needs to be made and you can skip the rest of this section. If you have an older version of the Edison source files, please continue reading.
To re-partition without using xFSTK (an Intel dependency that is a bit painful to install), modify
To do so, change the script from:
This modification causes Edison to reboot and resume flashing once it comes back online.
Flashing Edison with the new image
To flash Edison with the new image:
Follow the on-screen instructions. Note that the process can take some time (longer than 5 minutes), so please be patient. Once it's complete, the console should look similar to this:
Checking the new image
Log into Edison and check if the partition has changed by typing
Flashing succeeded! The size of
/dev/root has increased!