Create a union of two directories, while writing to only it's own original directory

Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I want to create a union of two directories and when I move a file within the union'd folder, I want it to stay on the folder it originates from(See below).
How would I accomplish this? I have tried unionfs, but it will always follow the folder order, for example, if I mount a RW folder in the first spot, all writes will go to that folder, I want the following behavior, as described below:
I want to have 2 RW folders and a union-ed folder
RW - driveA
RW - driveB
Unioned - mergeDrive
Basically, when I do a file move (I can only touch the files through the mergeDrive, I want each file to be moved within there own folder.
So for example,
mv /mnt/mergeDrive/subFolderA/fileA.csv /mnt/mergeDrive/subFolderB/fileA.csv
FileA's original path:
/mnt/driveA/subFolderA/fileA.csv
Expected path after move:
/mnt/driveA/subFolderB/fileA.csv
Then I want to be able to do:
mv /mnt/mergeDrive/subFolderA/fileB.csv /mnt/mergeDrive/subFolderB/fileB.csv
FileB's original path:
/mnt/driveB/subFolderA/fileB.csv
Expected path after move:
/mnt/driveB/subFolderB/fileB.csv
So where ever the root folder of the file originates from, it stays in that root folder when being moved, even though it is moved through /mergeDrive/. Can you setup unionfs(or something similar) to do this?
linux
add a comment |Â
up vote
0
down vote
favorite
I want to create a union of two directories and when I move a file within the union'd folder, I want it to stay on the folder it originates from(See below).
How would I accomplish this? I have tried unionfs, but it will always follow the folder order, for example, if I mount a RW folder in the first spot, all writes will go to that folder, I want the following behavior, as described below:
I want to have 2 RW folders and a union-ed folder
RW - driveA
RW - driveB
Unioned - mergeDrive
Basically, when I do a file move (I can only touch the files through the mergeDrive, I want each file to be moved within there own folder.
So for example,
mv /mnt/mergeDrive/subFolderA/fileA.csv /mnt/mergeDrive/subFolderB/fileA.csv
FileA's original path:
/mnt/driveA/subFolderA/fileA.csv
Expected path after move:
/mnt/driveA/subFolderB/fileA.csv
Then I want to be able to do:
mv /mnt/mergeDrive/subFolderA/fileB.csv /mnt/mergeDrive/subFolderB/fileB.csv
FileB's original path:
/mnt/driveB/subFolderA/fileB.csv
Expected path after move:
/mnt/driveB/subFolderB/fileB.csv
So where ever the root folder of the file originates from, it stays in that root folder when being moved, even though it is moved through /mergeDrive/. Can you setup unionfs(or something similar) to do this?
linux
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I want to create a union of two directories and when I move a file within the union'd folder, I want it to stay on the folder it originates from(See below).
How would I accomplish this? I have tried unionfs, but it will always follow the folder order, for example, if I mount a RW folder in the first spot, all writes will go to that folder, I want the following behavior, as described below:
I want to have 2 RW folders and a union-ed folder
RW - driveA
RW - driveB
Unioned - mergeDrive
Basically, when I do a file move (I can only touch the files through the mergeDrive, I want each file to be moved within there own folder.
So for example,
mv /mnt/mergeDrive/subFolderA/fileA.csv /mnt/mergeDrive/subFolderB/fileA.csv
FileA's original path:
/mnt/driveA/subFolderA/fileA.csv
Expected path after move:
/mnt/driveA/subFolderB/fileA.csv
Then I want to be able to do:
mv /mnt/mergeDrive/subFolderA/fileB.csv /mnt/mergeDrive/subFolderB/fileB.csv
FileB's original path:
/mnt/driveB/subFolderA/fileB.csv
Expected path after move:
/mnt/driveB/subFolderB/fileB.csv
So where ever the root folder of the file originates from, it stays in that root folder when being moved, even though it is moved through /mergeDrive/. Can you setup unionfs(or something similar) to do this?
linux
I want to create a union of two directories and when I move a file within the union'd folder, I want it to stay on the folder it originates from(See below).
How would I accomplish this? I have tried unionfs, but it will always follow the folder order, for example, if I mount a RW folder in the first spot, all writes will go to that folder, I want the following behavior, as described below:
I want to have 2 RW folders and a union-ed folder
RW - driveA
RW - driveB
Unioned - mergeDrive
Basically, when I do a file move (I can only touch the files through the mergeDrive, I want each file to be moved within there own folder.
So for example,
mv /mnt/mergeDrive/subFolderA/fileA.csv /mnt/mergeDrive/subFolderB/fileA.csv
FileA's original path:
/mnt/driveA/subFolderA/fileA.csv
Expected path after move:
/mnt/driveA/subFolderB/fileA.csv
Then I want to be able to do:
mv /mnt/mergeDrive/subFolderA/fileB.csv /mnt/mergeDrive/subFolderB/fileB.csv
FileB's original path:
/mnt/driveB/subFolderA/fileB.csv
Expected path after move:
/mnt/driveB/subFolderB/fileB.csv
So where ever the root folder of the file originates from, it stays in that root folder when being moved, even though it is moved through /mergeDrive/. Can you setup unionfs(or something similar) to do this?
linux
asked Mar 24 at 21:39
asdasd2a43qaad
11
11
add a comment |Â
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f433328%2fcreate-a-union-of-two-directories-while-writing-to-only-its-own-original-direc%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password