0

I need this behavior because I need to know what the application using the merged folder will do, so I can backup it properly and consistently with small backups.

I need to force it behave like I did with aufs because I am migrating my script that used aufs, but not only because of that. That behavior is mandatory for the layers I created and were working very well.

All my work branches (directories) are subfolders of the same folder (that is where the merged folder is placed), therefore share the same available space.

These options work +- well: defaults,allow_other,use_ino,category.action=ff,category.create=ff,category.search=ff
but if I modify one file at the merged folder, it will remove the file from the original folder :O and create/update the modified file on the first folder found :(,
it should not touch the original file :(.
If there is several overrides, it deletes them all leaving only the last modification on the first folder :O, it is good I know, but not for my script/useCase.

If I make all branches' folders and subfolders readonly, this will prevent the deletion of the files, so all updates will go to the first folder. But then, I will still need to make each branch(subfolders and files too) RW, change things there and do not forget to set it RO again or things will mess up.

So I still can't make it behave like AUFS did. It is close but not equal.

PS.: ubuntu22.04 has aufs no more, so no going back

Aquarius Power
  • 4,099
  • 5
  • 38
  • 56

2 Answers2

0

You can't. mergerfs is not an overlay/CoW filesystem.

https://github.com/trapexit/mergerfs#how-it-works

mergerfs does NOT support the copy-on-write (CoW) or whiteout behaviors found in aufs and overlayfs. You can not mount a read-only filesystem and write to it. However, mergerfs will ignore read-only drives when creating new files so you can mix read-write and read-only drives. It also does NOT split data across drives. It is not RAID0 / striping. It is simply a union of other filesystems.

trapexit
  • 41
  • 1
  • so I should have migrated from aufs to overlayfs? I just found a package on ubuntu22.04 for overlayfs. The only unsafety on mergerfs is to make branches writable and forget to make them RO again, what would delete modified files on them, but I tested and it accepts 1000 (probably more) branches! while aufs only accepted 127 and that was a bit difficult to workaround – Aquarius Power May 30 '22 at 13:16
  • aufs and overlayfs don't offer the same features. They are just both CoW. You have to compare the specific features you're looking for. – trapexit May 30 '22 at 17:24
0

I am using this:

mergerfs -o "defaults,allow_other,use_ino,category.action=ff,category.create=ff,category.search=ff" "FolderWriteHere:Folder1:Folder2" FinalMergedFolder

Now I need to make READONLY all folders that were merged (Folder1, Folder2 etc)!

But if "mergerfs" gives this error "no space left on device", when trying to write files at FinalMergedFolder, you need to be sure there is at least 4.2GB ALWAYS free on the FolderWriteHere (at least for mergerfs 2.33.3 I have this limitation), it means that, at any moment free space drops below about 4.2GB, that error will happen again. Anyone have any idea why?

Also, I use only a single partition/media/drive/disc (all folders share the same partition) for this merging, so I dont know what may happen for multi-partition/disks.

Aquarius Power
  • 4,099
  • 5
  • 38
  • 56