Hi guys,
TrueNAS / docker newbie here.
I am building my first TrueNAS box, and I have been trying to finish off the hardware. Yesterday I took some snapshots of my main TrueNAS filesystem and moved it from a raidZ1 configuration to a striped mirror. All went fine and I am now running off my new drives. Today I was working on my fan speed controller bash script. This was built inside a docker container in dockge. I am a total n00b with docker, and I have broken the container, and seem to have lost the script I wrote. I have now learnt that I shouldn’t be writing scripts inside a running container…
Now I have several snapshots of this filesystem, I have spent a few hours and tried to look around but I can’t find where the actual containers are stored.
I think I have found containers in /mnt/.ix-apps/docker/overlay2/ , but this is my running system, but I can’t seem to locate my script in anything located there.
I assume my script should still exists in one of my snapshots?
Is there a way to recover this file?
To be honest I don’t know?
I have created 2 data sets. One on flash, and one on spinning disks.
The flash based one is my main one and is where I store everything, and I only have movies on the spinning disk.
I believe I took a snapshot of the top level of the whole flash based dataset.
If there is a separate ix dataset located somewhere else then I didn’t explicitly take a snapshot of that.
Essentially, docker containers consist of a bunch of layers of “overlay” filesystems, and the top layer is a temporary writable file system that gets thrown away when the container is updated.
If you took a snapshot of the hidden ix-apps dataset, that is where the docker directory is, and where all the file systems are located.
In the snapshot, you should theoretically be able to do a find/grep for your script, assuming you know its name.
The TrueNAS process is to store things you want to keep in a Host Path or similar.
Do not store things inside a container or inside a iXvolume residing in .ix-apps. Those places are volatile and thus unsuited for important data.
A Host Path dataset is easily replicated using normal means.
Thanks guys for your help. I didn’t loose anything (actually I spent more time trying to find my script, than it took me to rewrite it.) With the advise given to me I have learnt a lot more about docker, and I realized I had done quite a few things incorrectly. So in then end it turned out that this was a happy little accident.