I am trying to mount an overlayfs inside an archivemount (as a follow-up to Layered or Virtual filesystem on Linux).

I am doing this:

mkdir -p {upper,work,mount}
tar zcf somefile upper/ work/ mount/
mkdir tmp
archivemount -o allow_root somefile tmp
sudo mount -t overlay -o lowerdir=/,upperdir=tmp/upper,workdir=tmp/work overlayfs tmp/mount

Note that I allow root to access the mounted archive (had to update /etc/fuse.conf for that). It fails with:

mount: tmp/mount: wrong fs type, bad option, bad superblock on overlayfs, missing codepage or helper program, or other error.

It works with the original folders. I checked and by default, archivemount is mounting in read/write by default. I also can write a file in every folder. I also checked the access rights and they seem to be correct. Root as access to mount and can write to it.

What am I doing wrong?

  • have you considered the fuse unionfs, then you don't need to be root. – ctrl-alt-delor Dec 9 '18 at 11:30
  • Yes but overlayfs comes with your kernel. That's why I prefer that solution, unless I can't find a way around that read-only issue. – Luke Skywalker Dec 9 '18 at 11:53
  • This question has changed from its original: It no-longer asks the same question. It should be rolled back, and a new question asked. – ctrl-alt-delor Dec 9 '18 at 14:50

unionfs does a better job unionfs-fuse $(pwd)/tmp/upper:$(pwd) $(pwd)/mount. However the mount-point seems to have to be outside of the archivemount file-system.

I see no advantage of nesting the mount-point, and has the advantage of not needing root privileges (except to install), so this may be workable.


I have no idea why mount-point needs to be outside of the archivemount. If that is what the error is; I have little evidence to make a conclusion. I suspect that the mount point is the only file-access into the archivemount that is done as root, when using unionfs. Other file-access is probably done as you.

In the mount -t overlay case, where the upper-layer and work-area, can not be in the archivemount, it maybe because root has no access to this mount. Try:

archivemount somefile tmp
ls tmp/
sudo ls tmp/ #gets permission denied
| improve this answer | |
  • You were right on overlayfs, I'll update the question. – Luke Skywalker Dec 9 '18 at 13:00

So the actual problem was that, by default, archivemount does not allow root to access the mounted filesystem. You have to add the -o allow_root option for that.

Note that you will have to update /etc/fuse.conf to allow that option.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.