[newbee] how do i present contents of multiple shared directories (gdrive) to a single mount?

First of all thank you very much for making this great program!

This setup is what I have right now:

Laptop using linux to act as rclone server for my google drives.
3 gdrives:

remote-share1: -> has single folder "media1" which I have shared with remote-mount gdrive account
remote-share2: -> has single folder "media2" which I have shared with remote-mount gdrive account

and 3 crypt backends all using the same passwords:


I upload media using rclone copy /local/upload remote-share1-crypt: (and remote-share2-crypt).

To create a single point of access to read files I mount with: rclone mount --drive-shared-with-me remote-mount-crypt: /local/mnt/ . This folder I then use to share through samba so I can connect to it from my other devices

Now /local/mnt has 2 directories: media1 and media2. What I would like to get is the contents of media1 and media2 to show directly in the mount. So if media1 dir has file1 and media2 has file2 inside them I would like /local/mnt to show file1, file2 when I list the mount.

I'm quite new to linux and rclone so I'm not sure how to tackle this. As I've learned you can't share the root directory of a google drive (share as in to other gdrive accounts) but you can share each individual file/directory in the root directory using the web app. So I think I could instead of having a media1 folder and crypt from there, crypt from the root folder (remote-share1: ) and make new uploads shared through the gdrive webapp but that requires more manual work from me after each upload:-( .

Perhaps there is a google API that lets you set the sharing attributes of files? I could then set it to share with remote-mount: after each upload.

Other solution I could think of is having a mount for each remote and use mergerfs to a single mount? Would that cause more overhead if I were to add more remotes later on? (running several rclone mounts at the same time) Or keep this setup and mergerfs /local/mnt/media1 and /local/mnt/media2 to /local/mnt-merged/ ?

Or is another elegant solution for my "problem"? Any help is appreciated.

Have you looked into union command?

as far as rclone goes - the Union remote is what you are looking for.

Do note: Currently the Union remote is a little limited in the sense that while it can combine and read from a lot of different locations to present is as one - it can only write data back to one of those locations. Sometimes that is not a problem - but depending on your needs it could be a big headache.

But on Linux you could also use mergerFS. This is much more capable of advanced setups that Union can not accomplish yet. The setup is much more involved though, but if you are the time who does not mind reading a little documentation you will probably be ok :slight_smile: The combination of rclone and mergerFS is a well tested setup my several users here so there should not be any huge issues to worry about regarding making them play well together.

You should also be aware that there is a massive improvement coming to rclone's Union soon. It is functional and I have it in testing right now. This will basically mimic most of the important features of mergerFS so you can run that entire setup in rclone rather than via external tools (and also on other OSes other than Linux very importantly). It has been a much requested feature and Max-Sum very generously took it upon himself to fix this for us :smiley:

It might still take a bit longer to be tested enough for the public mainstream release (no ETA) - but if you are interested then look out for new rclone version notes (here on the forum or on github) that mention the "MultiWrite Union".

Let me know if you have any further questions. I have lots of experience with Union, but very limited experience with mergerFS (Animosity here on the forum is the local guru for that setup).

@thestigma comments the Union remote is limited compared to mergerFS.
And in terms of performance? mergerFS also provide better performance?

I am not sure. Usually performance will become limited by other things than the Union-layer so I don't know how much direct performance testing exists between the two.

My guess is that the FUSE system (which mergerFS is and rclone mounts are based on) is probably what will start to have problems at very high speeds - not the logic that redirects the traffic itself. In mergerFS I don't think you can avoid using FUSE (I am not an expert on mergerFS), but in rclone union you could avoid it if you chose to not use a mount on top of it (like in a script).

So if you google for fuse performance, you should find lots of results. All from technical research papers to more practical performance tests. You could also ask resident guru @Animosity022 if he can tell you his experiences with mergerFS performance. He has used it way more than me.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.