try
try copied to clipboard
Failure in Merging Directories Located Under the Same OverlayFS Mountpoint
When attempting to merge two directories residing under the same overlayfs mountpoint within try, the operation fails, rendering the common directory unmountable within try.
Error Reproduction:
$ ./try -D sandbox1 "echo foo > file.txt"
...
$ ./try -L sandbox1 "cat file.txt"
...
try(/tmp/tmp.VwOWiakeQW): Warning: Failed mounting /users as an overlay and mergerfs or unionfs not set and could not be found, see "/tmp/tmp.B3jpnj64oq"
/tmp/tmp.LyCvWjVjEY: 7: cd: can't cd to /users/gliargko/try
Error log displays:
mount: /tmp/tmp.NSMc55yqg2/temproot/users: mount(2) system call failed: Too many levels of symbolic links.
dmesg
output:
[ 2107.018994] overlayfs: fs on 'sandbox1/upperdir/users' does not support file handles, falling back to xino=off.
[ 2107.019006] overlayfs: overlapping lowerdir path
Installing mergerfs
solves the issue.
- The initial mount failure is due to overlayfs's inability to handle overlapping directories. What causes these overlaps?
- It seems like
mergerfs
resolves this as it effectively manages overlapping paths, allowing the directories to merge seamlessly. Why isn't overlayfs enough?
Linking in https://github.com/torvalds/linux/blob/401644852d0b2a278811de38081be23f74b5bb04/fs/overlayfs/super.c#L1226