Very basic question, but I'm trying to validate my understanding of how files are managed between datasets/jails to make sure I don't lose any data in future migrations.
So I have a dataset with all of my files (let's call it Storage-Dataset), and then I have a few jails in a separate dataset (let's call it Jails-Dataset). Each jail has mountpoints so it can access the files/directories relevant to them from Storage-Dataset. My understanding is that those mountpoints essentially act as links between those two foreign datasets, but that the apps running within the jails will still have the ability to alter the files in Storage-Dataset even though they are in a separate dataset, unless the mountpoint is set a read-only.
In a read-only scenario, it seems pretty clear to me, it's just a read-only link, the jail and the app running within it can read and serve files from Storage-Dataset, but can't alter them, and if you delete the jail, the mountpoint/link disappears but the files within Storage-Dataset remain untouched.
Where it gets muddier to me is when it's a read-write scenario, here are my questions:
- When I mount a directory within a jail, and if say I were to FTP into the server, I will see that directory in 2 different places: the source (Pool/Storage-Dataset/FolderA) and also the destination within the jail where I mounted it (say /Pool/Jails-Dataset/Jail1/FolderA). So does that folder actually exist in two places and is constantly synced by the system, or is it really only stored in Storage-Dataset and what I see in Jails-Dataset is only a symlink?
- What happens when the Jail creates a new file in a folder that's mounted from another dataset - I can see a new file created by the jail in both datasets as well, so the mountpoint appears to work both ways. So for example you have NextCloud installed in a jail, with a mountpoint that give the NextCloud jail access to Pool/Storage-Dataset/FolderA and that mounted folder within the jail is also a NextCloud user's folder and they upload a new file in it, then that new file will appear in the jail of course, but in Storage-Dataset as well because of the mountpoint, and if the user deletes the file, then it will be deleted from Storage-Dataset. But what happens if the NextCloud jail and/or dataset is completely deleted, will all files also be deleted from Storage-Dataset?
Thanks!
So I have a dataset with all of my files (let's call it Storage-Dataset), and then I have a few jails in a separate dataset (let's call it Jails-Dataset). Each jail has mountpoints so it can access the files/directories relevant to them from Storage-Dataset. My understanding is that those mountpoints essentially act as links between those two foreign datasets, but that the apps running within the jails will still have the ability to alter the files in Storage-Dataset even though they are in a separate dataset, unless the mountpoint is set a read-only.
In a read-only scenario, it seems pretty clear to me, it's just a read-only link, the jail and the app running within it can read and serve files from Storage-Dataset, but can't alter them, and if you delete the jail, the mountpoint/link disappears but the files within Storage-Dataset remain untouched.
Where it gets muddier to me is when it's a read-write scenario, here are my questions:
- When I mount a directory within a jail, and if say I were to FTP into the server, I will see that directory in 2 different places: the source (Pool/Storage-Dataset/FolderA) and also the destination within the jail where I mounted it (say /Pool/Jails-Dataset/Jail1/FolderA). So does that folder actually exist in two places and is constantly synced by the system, or is it really only stored in Storage-Dataset and what I see in Jails-Dataset is only a symlink?
- What happens when the Jail creates a new file in a folder that's mounted from another dataset - I can see a new file created by the jail in both datasets as well, so the mountpoint appears to work both ways. So for example you have NextCloud installed in a jail, with a mountpoint that give the NextCloud jail access to Pool/Storage-Dataset/FolderA and that mounted folder within the jail is also a NextCloud user's folder and they upload a new file in it, then that new file will appear in the jail of course, but in Storage-Dataset as well because of the mountpoint, and if the user deletes the file, then it will be deleted from Storage-Dataset. But what happens if the NextCloud jail and/or dataset is completely deleted, will all files also be deleted from Storage-Dataset?
Thanks!