I want Linux's OverlayFS to behave like AUFS when writing to a lower file. I want it to write through to the lower directory. For example, suppose I have two files named L/lower and U/upper.

mount -t overlay -o lowerdir=L,upperdir=U,workdir=W overlay X

This would merge L and U into a single OverlayFS directory named X. So now the two files would be accessible as X/lower and X/upper.

Therefore I could modify the lower file through the OverlayFS directory. For example:

echo 'This is a modification' >> X/lower

But this is where it misbehaves on me. It does not actually modify the lower file L/lower. Instead it creates a new upper file called U/lower and writes my modification there. This is not what I want. I want X to serve as a convenient, single access point for editing purposes.

How can I make the modification to X/lower write through to L/lower?

  • lower is readonly. thats how it works. you can recursively mount overlay over overlays, though.
    – mikeserv
    Commented Oct 29, 2015 at 22:31
  • I've posted a couple of answers to my own question (unix.stackexchange.com/q/393930) which covers this topic.
    – ejm
    Commented Sep 23, 2017 at 2:50
  • Is switching the role of upper and lower an option? Or do you need to write to both upper and lower? In that case, mergerFS might be more appropriate. MergerFS cannot do COW, though.
    – leggewie
    Commented May 3, 2020 at 20:41
  • @MAV, What I wanted at the time is write access to the files in both L and U, via X — ‘a convenient, single access point for editing purposes’ — what AUFS gave me. Commented May 4, 2020 at 21:52

1 Answer 1


You can write to the underlying directory by not using the created overlay to access the file (the directory "X" in this case). Do it with:

echo 'This is a modification' >> L/lower
  • 2
    That wouldn’t be done through the overlay, however, which is what I ask about. I’d like X/lower to be a single point of access for editing purposes regardless of whether the file actually sits in L/ or in U/; so apparently merging the two directories while actually keeping them apart. Commented Dec 5, 2019 at 0:08
  • 10
    This answer is wrong assuming you did not unmount the overlay first. That is even explicitly and officially documented: "Changes to the underlying filesystems while part of a mounted overlay filesystem are not allowed. If the underlying filesystem is changed, the behavior of the overlay is undefined, though it will not result in a crash or deadlock."
    – leggewie
    Commented May 3, 2020 at 20:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .