April 26, 2014

Flashing / Installing an OS on a Cubietruck (Cubieboard 3)

Update (Feb. 2017): The text below got pretty old and I just realized that some hyperlinks did not survive the migration from the Wordpress blog I used ages ago to Hugo…

In the meantime, some very good Linux distributions emerged from the community, which are really simple to install. I personally recommend Armbian. My Cubietruck has been running very reliably with this distribution for two years.

Furthermore, in case there are issues you cannot solve yourself, the Armbian Forum has been very helpful.

I’m not going to write a complete tutorial that explains how you install your favorite OS to the Cubietruck. Instead I want to add some info to a tutorial I found on Thomas’ webpage which contains stuff from the Cubieboard Wiki.

Flashing step:

Before you flash the operation system of your choice to the NAND of the device you should know that during the flashing procedure the Cubietruck is powered over the USB connection between your Mac and the Cubietruck. No external power, no keyboard, no screen is needed. Just think of the Cubietruck as a weird USB thumb drive ;) By the way: You can also completely ignore the advice given by the flashing tool LiveSuit. So just perform the steps explained by Thomas. After flashing the device, it will automatically start to boot. Just plug the USB cable and attach your proper power supply. 

Moving the OS to the Hard Drive

In contrast to Thomas I think it is a little wiser to move the OS to the hard drive first and tweak it later. In fact, when I first tried to move stuff I ended up with a device that didn’t boot anymore. So continue with step 3 unless you have balls of steel.  I also think there’s a glitch in Thomas tutorial. The last steps in his tutorial are

#umount /mnt

In the other tutorial from the wiki it is

#umount /mnt

The latter version worked for me. After the reboot I fired a df -h to see if my root file system is now on my large hard drive. At first I was a little confused as rootfs showed only 1 GB free space. Just run 

resize2fs /dev/sda1

to fix this. The file system of /dev/sda1 is resized and a second df -h shows the results. By the way: One might ask why it is necessary to move the OS to the hard drive (or an Micro SD card). Well, first of all because the NAND is slower than today’s pretty fast SD cards or a hard drive. Second, many people warn that the NAND might be damaged (“worn out”) over time by continuous swapping/paging of the OS. So it is a better idea to wear out some memory you can exchange easily. 

Tweaking the OS

Before I tweaked the OS I updated my installation to Ubuntu 13.10. I started with some

apt-get update
apt-get upgrade

Then I tried the release upgrade


This did not work at first but printed some error messages to the console. The reason for this error is that python-apt is missing. You can fix that with a friendly

apt-get install python-apt

But you are not done yet. The tempfs is set to 20MB which is too small for the upgrade to succeed. So type

nano /etc/fstab

and set the size of the tempfs to -let’s say- 1024m. Safe the file and reboot.

After the reboot invoke the release upgrade with the command above. The time has come for a cup of coffee. And peeling 1.5 kilos of asparagus. 

After another reboot you own a Ubuntu 13.10 server. As of writing this text Ubuntu 14.04 is out - a nice long term support version. So fire another release upgrade, watch some YouTube and wait until you have the latest Ubuntu. Now teak things to your liking as explained on Thomas’ blog.

© ho1ger 2015 - 2022