Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing a file from a unionfs such that a formerly shadowed file does not appear in its place #76

Open
lvml opened this issue Oct 8, 2017 · 3 comments

Comments

@lvml
Copy link

lvml commented Oct 8, 2017

Maybe I misunderstood what the unionfs-fuse man-page wanted to tell me with:

-o hide_meta_files
In our unionfs root path we have a .unionfs directory that includes metadata, such as hidden (deleted) files.

... but that led me to believe it is possible to remove a file from a mounted unionfs such that a potentially existing file of the same name from a "lower branch" would not appear in its place.

However, that does not work - I see the file from the "lower branch" immediately after removing the file from the "higher branch".

That is a problem for me, because the "lower branch" not only holds a file of the same name - that file also is owned by a user other than the one mounting the unionfs-fuse, so any attempt to re-create/overwrite the file in the mounted unionfs will end in a "no permission" error.

Is there a way to hide a file from a "lower branch" once and for all? (It would be sufficient for me if I had to name it specifically at mount-time.)

@mohitmv
Copy link

mohitmv commented Dec 23, 2020

Hi, Any update on this ? I'm facing the same issue.
@lvml - btw, did you find any other unionfs which can work in macOS as well and the union (merged) fs supports deletion of files from read-only branch.

@bsbernd
Copy link
Contributor

bsbernd commented Dec 23, 2020

Oh really, there should be a file in the .unionfs structure, which will make the lower branch file to not show up. Can you post an example how to reproduce this? Maybe a quick fix...

@mohitmv
Copy link

mohitmv commented Dec 23, 2020

It works for simple directories (i.e. if the read-only directory is created by me). However it doesn't work for system read-only directories like /bin.

System: macOS

Repro:
mkdir -p /tmp/A
./src/unionfs -o cow -o debug /tmp/A=rw:/bin=ro /tmp/C
cd /tmp/C && rm ls

Here is what I get in the debug info when I try to remove "ls" binary.

getattr /ls
   unique: 2, success, outsize: 136
unique: 4, opcode: GETXATTR (22), nodeid: 35, insize: 75, pid: 32781
getxattr /ls com.apple.rootless 128 0
   unique: 4, error: -93 (Attribute not found), outsize: 16
unique: 5, opcode: GETATTR (3), nodeid: 1, insize: 56, pid: 32781
getattr /
   unique: 5, success, outsize: 136
unique: 3, opcode: GETATTR (3), nodeid: 35, insize: 56, pid: 32781
getattr /ls
   unique: 3, success, outsize: 136
unique: 2, opcode: GETXATTR (22), nodeid: 35, insize: 75, pid: 32781
getxattr /ls com.apple.rootless 128 0
   unique: 2, error: -93 (Attribute not found), outsize: 16
unique: 4, opcode: GETATTR (3), nodeid: 1, insize: 56, pid: 32781

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants