As the image above, I can see and access the Nextcloud data directory using my local storage mount.
My Question
The mount works well so far and I can edit and update the files in /sto using my Nextcloud
However, I’m just wondering if it is a good practice that the Nextcloud data directory is inside somewhere of the mounted directory, like, will this cause Nextcloud to generate two identical preview for same file inside data directory? (One because of it’s in NextCloud data directory and managed by Nextcloud, another because the same file appeared again in the mounted external storage, in my case is /sto/NextCloud directory)
No, not at all. There are different problems. The Nextcloud data folder contains all the user’s data, and permissions are managed within Nextcloud, on the file level, they all belong to the webserver user. Like this you can now see and access all the files of all the users, and everybody with access of this external folder can as well. For all data protection laws, this behavior is very critical.
For the main Nextcloud storage, let only Nextcloud access is. With all the logic, it considers to have exclusive access to this storage and does not expect other processes to be able to modify anything (even not the external storage app).
I also would design my storage in a way, that the other processes cannot access the Nextcloud folder at all.
For external storage, Nextcloud is more tolerant, it takes into account that other programs might add or delete files or folders.
I understand that there should be no direct access and modification towards files in Nextcloud data directory, and I didn’t mean to use External Storage to directly edit any file in /sto/Nextcloud
Instead, I just want to be able to access all other directories and files in /sto directory of my server (For example /sto/qBittorrent), and it appears that my Nextcloud data directory is now also inside my mount directory /sto
So actually my question is will this mounting approach cause server to produce some duplicated preview files and some other metadata?
Anyway as you said I may need to reconsider my directory structure to avoid Nextcloud data directory appeared in any of my mounted directory but that will means I need to move the whole data directory to somewhere else or manually mount all other directory in /sto as local external storage except /sto/NextCloud lol
I think this is a very bad idea. If I were you, I would integrate the other folders individually as external storage or rethink the overall structure.
Personally, I access more or less all files (outside Nextcloud) on my web server via alternative software. You can have a look at Tiny File Manager for this. It’s much better suited to this type of access than Nextcloud’s External Storage. Nextcloud is not a web file manager. And External Storage should not make it one either.