Ubuntu 14.04 with 4.0.4 kernel and latest AUFS from source5 min read

After some Googling, this looks like a common issue with most kernels shipping with distros. Here are a few links to look at.


Here are the steps I followed to get this working.

First, let’s become the root user and get the build dependencies…

Next, let’s grab the mainline Ubuntu 4.0.4 kernel and patches, and install them.

Next, let’s grab the AUFS git repository and use the branch to match our 4.0.4 kernel

Next, let’s get kernel source and extract it.

Let’s patch this kernel with the Ubuntu configurations and then apply the AUFS patches.

Next, copy the AUFS files to kernel source tree.

Next, let’s configure kernel options to enable AUFS NFS exports.

At this point, you will want to go to select AuFS under **File Systems > Miscellaneous filesystems** Also, select the NFS export option. When you are done, it should look like this.

Then press exit a few times until you are out and save the changes.

Next, we will compile the kernel and generate dpkgs (this will take a LONG time). NOTE: I would strongly suggest you run this via tmux or screen because an SSH session will likely disconnect before it’s done causing the compile to be half finished and future steps in this tutorial to fail.

Next, let’s hold these custom packages, so that future kernel updates don’t break anything.

Next’s let update our GRUB menu to boot from this custom kernel.

At this point, you should have your new kernel all setup and working. Let’s reboot the machine and make sure you are on this new kernel.

After reboot, running uname -a should provide something like this (4.0.4 kernel).

Now, let’s start working on compiling AUFS for our kerel and include the notify and NFS export options.

Next, we need to fix a missing binary that prevents AUFS from compiling properly.

It’s time to start compiling…

If everything went well, and you don’t see errors at the end of the make, then it’s time to install and pickup this new AUFS module.

For some reason the module didn’t install in the right location correctly with the above, I therefore had to copy it manually to the proper location.

I created a mount point for it.

Finally, to use these options, you should mount your AUFS pool like this.

If the mount works correctly, I would suggest that you mount your pool via adding a line to /etc/rc.local rather than trying to mount the pool via fstab.

Add a line like this just before the exit line.

NOTE: I’m mounting with the pmfsrr option so that if the parent directory doesn’t have the available space for a write, AUFS will gracefully write to the next disk.

Once everything is working, you can clean up your src directory to get back 10+ GB if you’d like to.

You should now have AUFS running without the whiteout and opaque files, and all of it’s other benefits vs. mhddfs (less resource intensive and increased disk throughput). The whiteout files and opaque files will still show up at the data disk root. This is how AUFS works and is normal behavior.



I love learning new things and trying out the latest technology.

You may also like...

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.