Should you keep unionfs on your Eee PC?

When I announced to the other Ubuntu Forums staff members I was getting an Eee PC and planning to stick with Xandros (as opposed to installing Ubuntu on it), one of the first pieces of advice I got was to remove unionfs from the Eee to free up space.

What’s the deal with unionfs anyway?
Just a quick primer on unionfs (as well as I can understand it): one of the great features the Eee has is the ability to restore factory settings with the press of a couple of buttons at bootup (tap F9 quickly and then select the restore option from the menu). One person made a YouTube video of the process and clocked the restore at two minutes. I did the restore myself and it took about ten seconds (not kidding).

This works because the Eee has two major hard drive partitions (and two random smaller partitions at the end—I don’t know what those are for). The first is mounted at boot as read-only and contains the factory settings. The second is mounted as read-write and is the user partition you modify after you start using the Eee. While having those two partitions makes restoring (in case you mess up something) easy and quick, it also sucks up a lot of hard drive space on a drive that is already pretty small (4 GB on the 701 version).

My experience with unionfs and reasons for removing it
Even though the advice I got turned out to be good advice, at first I was hesitant to remove unionfs for two reasons:

  1. I knew I’d be tweaking Xandros a lot and wanted an easy way to restore the default installation in case I messed things up.
  2. I didn’t have an external DVD-ROM drive to use for the restore DVD that came with the Eee, and I was intimidated by the tutorials about making USBs into bootable live “CDs.”

Well, after a lot of tweaks, I did manage to mess up the Eee badly enough that I could fix it by undoing all the tweaks, but I was glad to have the option to quickly restore it. And, more importantly—too cheap to buy an external DVD-ROM drive—I rolled up my sleeves and actually followed a tutorial on making a USB device into a live “CD.” It wasn’t as difficult as I thought it would be.

So, with the ability to back up my installation (I used the dd command to back up the entire Eee PC hard drive to a .img file on an external hard drive), I had fewer qualms about removing unionfs. I also realized through regular use with unionfs that a little less than 2 GB is not a lot to work with after you have applications installed. I don’t want to store my entire music and photo collections on the Eee, but I’d like to have some selection available there.

The removal process
Emboldened by how much easier the make-a-USB-live-“CD” process was, I went ahead and tried the Removing UnionFS/aufs tutorial on the EeeUser Wiki, and the process could have been a lot smoother. I basically ended up following the instructions, messing everything up, and then having to restore my Xandros .img with dd and then redo the instructions again.

If you’re planning to follow the instructions, here are a few things to keep in mind:

  • You do not need to enable (i.e., add as a permanent boot option) single-user mode or recovery mode on the Eee, but it’s probably a good idea to know how to make it available for one-time use.
  • If you have an easy way to back up the Eee (the dd command, for example, or an external DVD-ROM drive with the Eee PC DVD), you can simplify the process by using a live CD (or live “CD” USB stick) to make all the changes to /dev/sda1. You should be familiar with mounting partitions, but it’ll save you the trouble of going into recovery mode and using vi and all that. You also won’t have to constantly reboot and test things (again, you should have backed everything up first; otherwise, testing is a good thing).
  • There are instructions in the middle of the page about growing the /dev/sda1 partition using GParted, but then there is a warning at the bottom of the page about how using GParted won’t work and how you should use fdisk and some other command-line options instead to merge partitions. Please heed this bottom-of-the-page warning. I tried to grow the /dev/sda1 partition in GParted to fill the space and got an error message and the /dev/sda1 partition then appeared to fill all 3.7 GB but was also almost completely full. When I rebooted into Xandros, the drive was reported as being only 2 GB large and almost full. If you want the non-unionfs-ed partition to fill the whole drive, follow the instructions about using the command-line to do it.
  • The other thing I learned is that the commands given seem counterintuitive to the uninitiated. To expand the first partition to fill the space, they actually have you delete all the partitions and then create a new partition. My intuition was telling me, “Hey, this is wrong! I don’t want to delete the partition. I just want to expand it.” But if you follow the instructions and delete all the partitions and recreate a new one, it actually has the same effect as expanding the first partition. Don’t ask me how that works, but it does. You backed everything up anyway, right? There should be nothing to lose.

My advice to owners of any Eee PC that has a 4 GB hard drive or smaller is to find a way to back up and/or restore your Xandros installation and then get rid of unionfs as quickly as possible in order to reclaim hard drive space. The quick restore tool is fun and amazing, but it takes up too much space. I’m so glad I now have 1.8 GB of free space on my Eee instead of 400 MB.


  1. This is great.

    As a fellow eeePC owner, I was very excited to see that you had acquired one too.

    Your experience and HOWTOs regarding Ubuntu have been instrumental in my own growth and ability to use, enjoy, and tweak. I look forward to the same insight regarding the eeePC.

    Keep up the good work!


  2. Did you replace the unionfs with ext3? It might be worth it to mention that ext3 reservces space for the root user, so it may be wise to mention the tune2fs util to gain some more space.

  3. I got my 4G Surf a month ago and still learning the ropes. Some really great, useful info you got here. Keep it up!

  4. If you have a Windows xp machine you can use it should be easy to make a USB install ‘stick’ using the DVD..

    You just run a utility on the DVD as far as I understand..

  5. Hello, i came across this post while researching whether or not I should remove unionfs. On the one hand it’s incredibly useful to restore my eee pc 900 back to square one.

    However my eee only has 4gb of space total and it is running out! It is brand new so do you think that i would need to still back up my hard drive? I’m also torn between installing an ubuntu variant customized for the eee vs the defaunt xandros which is much more compatable. We’ll see. Thanks for the post and your opinions though!!

  6. I have a 4G Eee PC, and after hitting the same unionfs issues, but not thinking of the possibility of backing it up and replacing the file system (plus not being very impressed by the Xandros software selection), I instead replaced the OS. Initially tried running Puppy Linux on it; worked OK, *very* lean and fast, but eventually I decided that I wanted to fatten it a bit with Wine, Java, LibreOffice, etc, so I’ve recently gone with Ubuntu.

    Thus far, my observations are:
    – Making a live USB is indeed very easy, and it makes unionfs rather redundant. If you want to restore defaults, just plug in your live USB.
    – The regular Ubuntu installer thinks that it needs 4.4GB. It actually doesn’t, but you’ll have to temporarily insert an 8GB USB stick or something to trick it into letting you continue with the install. I’ve also removed unused applications (like Thunderbird) to trim it back, and I’ve decided to keep my home directory and swap space on a spare SD card, so that’s now a fixture. With 3 USB ports, it’s no big deal, especially since I have a microSD-to-USB adapter, so I can still access microSDs if I want to. Actually, keeping my home directory on the card is a plus from a security perspective; I can remove it when not in use.
    – Boot time is much slower than Xandros, most of 2 minutes. The Unity desktop is slow, too; I’ve traded it in for LXDE, which is much more nimble.
    – Ubuntu does a good job of picking up the hardware. WiFi is fine, including the special keyboard key to enable/disable it, and it responds properly to the power button or closing the case. Be warned that while Unity will ask you to confirm after pressing the power button, LXDE will not.

    I would have tried eeebuntu or similar, but I didn’t have much luck finding an ISO. Regular Ubuntu seems to be OK anyway, and besides, I’ll heavily customise it regardless. I know there’s a Puppy Linux version optimised for the Eee, but I never used that either, just the standard one.

    @Jeremy: If you want to keep software updated, or install more, I’d recommend leaving Xandros behind; their repositories are not great. But if you want your Eee to stay exactly as it is, then Xandros is certainly smaller and faster than Ubuntu.

Leave a Reply to MatrixCat Cancel reply

Your email address will not be published. Required fields are marked *