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

Allow mounting a layer at a subdirectory rather than at the root of merged directory #118

Open
WaterJuice opened this issue May 1, 2022 · 1 comment

Comments

@WaterJuice
Copy link

Each merged source appears in the merged folders root. Ir would be very handy in some cases to be able to specify a "prefix" folder path for a particular source. I will illustrate what I'm trying to do with an example:

/mnt
    /folder1
        /extra
            /thing1
            /thing2
    /folder2
        /extra
            /thing1

Now if I merge these using
unionfs-fuse -o cow /mnt/folder1=RO:/mnt/folder2=RO:/mnt/rw=RW /mnt/merged
I get the following layout:

/mnt
    /merged
        /extra
            /thing1
            /thing2

Now let's say I only want the "thing1" folders in the merged thing. The layout I want is:

 /mnt
      /merged
           /extra
               /thing1

However there is no way to specify this.
If I try

 Unionfs-fuse -o cow /mnt/folder1=RO:/mnt/folder2/extra/thing1=RO:/mnt/rw=RW /mnt/merged

The folder2 "thing1" contents will be at the root level in the merged folder.

The syntax could be extended to allow something like

 Unionfs-fuse -o cow /mnt/folder1=RO:/mnt/folder2/extra/thing1=RO,prefix=extra/thing1:/mnt/rw=RW /mnt/merged

This is something I'm going to need and willing to implement in a fork, but thought I would check here first to see if it could be added to the official unionfs-fuse

@rarensu
Copy link

rarensu commented Jan 18, 2025

I usually do this by having multiple instances of unionfs-fuse running. I have a feeling it's not optimal, but it works great. they don't seem to mind if you start them out of order, either.

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

2 participants