1

I have the following directories:

/some/path/dir1/subdir1/*
/some/path/dir1/subdir2/*
/some/path/dir1/subdir3/*
/some/path/dir2/subdir1/*
/some/path/dir2/subdir2/*
/some/path/dir2/subdir3/*

I want to create an overlayfs (or similar) mount that merges subdir2 from both dir1 and dir2.

mount overlay -t overlay -o lowerdir=/some/path/dir1/subdir2:/some/path/dir2/subdir2 /newpath

However, I want to keep their full paths, so that /newpath will contain the following:

/newpath/some/path/dir1/subdir2/*
/newpath/some/path/dir2/subdir2/*

I have not been able to find any information on this online... can this be done? Or is there another tool that could accomplish this for me?

2
  • But ... but ... but ... aren't you already in the desired situation? The two subdirectories are already "merged" in one tree and with their paths intact!
    – AlexP
    Oct 13, 2019 at 22:50
  • @AlexP Heh. True. Ideally, I would like subdir1 and subdir3 to be absent from the merged directory. Oct 14, 2019 at 2:18

0

You must log in to answer this question.

Browse other questions tagged .