trapexit / mergerfs

a featureful union filesystem
http://spawn.link
Other
4.19k stars 170 forks source link

Deletion of files in RO dirs #1358

Open JensKapitza opened 2 hours ago

JensKapitza commented 2 hours ago

Is there a plan to support sudo mount -t overlay overlay -o lowerdir=/mnt/lowerdir,upperdir=/mnt/upperdir,workdir=/mnt/workdir /mnt/merged

overlayfs behavior on delete.

the file 'tt' example is not deleted on lowerdir it ist masked in upperdir (this can be another mergerfs dir with DEL as flag (this makes it nice to avoid trash in datadir)

c--------- 2 root root 0, 0 Sep 24 14:06 tt

root@ThinkPad-P50:/mnt# stat upperdir/tt Datei: upperdir/tt Größe: 0 Blöcke: 0 EA Block: 4096 Zeichenorientierte Spezialdatei Gerät: fc00h/64512d Inode: 41943050 Verknüpfungen: 2 Gerätetyp: 0,0 Zugriff: (0000/c---------) Uid: ( 0/ root) Gid: ( 0/ root) Zugriff: 2024-09-24 14:06:49.231081134 +0200 Modifiziert: 2024-09-24 14:06:49.231081134 +0200 Geändert: 2024-09-24 14:06:49.231081134 +0200 Geburt: 2024-09-24 14:06:49.231081134 +0200

My Target,

I ve 12 Disks, some mdadm raid1 and some with ext4 and some ntfs drives. i'll overlay my OSes but avoid writes to the native OS files. (i will not see the Windows dir in my mergerfs overlay) if i mark the mount point (c:) as RO, an error occurs this is fine for me, overlayfs marks this item as dead file in upperdir.

if i reboot and remount this dir (i'll see the 'deletet files*' not again in my mount)

is there an option?

my current version has an overlayfs on the RO dirs and then an mergerfs on upperdirs, would be easyer to maintain if i can reduce one layer.

trapexit commented 1 hour ago

No, as mentioned in the documentation mergerfs is not and not intended to be an overlay filesystem. There are already good solutions for that that are kernel based like overlayfs. I see no good reason to duplicate that work.