Differences of aufs, unionfs and overlayfs from each other

32

4

I have to join two file systems, one read-only (squashfs) and one read-write (ext4). My plan is to mount the read-write filesystem over the read-only flesystem so it appears writable. When I make some changes on the read-only filesystem, the changes should go to the read-write file system.

I am using Linux 3.17, Ubuntu 14.10, and came across these file systems: aufs, unionfs and overlayfs. I don't know what their differences from each other are and what to use for this situation. Could anybody show me the differences between aufs, unionfs and overlayfs, or just suggest the best one to use with this situation?

user128712

Posted 2014-10-30T02:03:53.873

Reputation: 569

Answers

9

overlayfs has been merged in kernel 3.18-rc2. Now that it has graduated to the main Linux tree, it is reasonable to guess that overlayfs will see a wider adoption in the future.

把友情留在无盐

Posted 2014-10-30T02:03:53.873

Reputation: 383

https://en.wikipedia.org/wiki/Aufs is also interesting: "aufs was rejected for merging into mainline Linux. Its code was criticized for being "dense, unreadable, [and] uncommented".[3] Instead, OverlayFS was merged in the Linux kernel.[4][5] After several attempts to merge aufs into mainline kernel, the author has given up.[6]" – Ciro Santilli 新疆改造中心法轮功六四事件 – 2018-10-13T15:41:32.733

1@CiroSantilli新疆改造中心法轮功六四事件 Aw... – Michael – 2020-01-29T23:34:08.023

3

A little reading on gentoo's wiki. Reveals one difference between unionfs and OverlayFS. Speed OverlayFS sends all file i/o requests directly to the underling file system. And is thus potentially faster than unionfs. aufs supplies a super set of OverlayFS features. In other words there setups that can be done with aufs but not OverlayFS. aufs is not in the official kernel but should be included on your system.

aufs supports selecting which branch will be writable rather having this hard code by the driver. It is unclear weather or not overlayfs does this unionfs does not.

For kernel 3.17 neither overlayfs nor aufs were included by mainline. Ubuntu may have chosen to include them. If not the appropriate kernel module will need to be installed.

wheredidthatnamecomefrom

Posted 2014-10-30T02:03:53.873

Reputation: 198

3

I cant offer you a comparison but I do use Aufs. If you follow the instructions in this blog post you can see via Example 3 how you can specify which branch can be read-only or read-write.

Typically the first file system is by default written to unless you specify otherwise as per example 3.

 mount -t aufs -o br=/read/write/dir=rw:/read/only/dir/=ro -o udba=reval none /tmp/aufs-root/

ubda parameter is how you control how changes made directly to the folders are relfected in the union system.

fswings

Posted 2014-10-30T02:03:53.873

Reputation: 666