I accidentally delete some files from my zfs pool and tried to mount the latest snapshots but i just figured out that i have no snapshots. How to activate the snapshots, how to configure it?
I am using Ubuntu 12.04.1 server and zfs 0.6.1, pool version is 28.
Starting from Ubuntu 17.04 you can install zfs-auto-snapshot like this:
For Ubuntu versions prior 17.04 you could setup zfs-auto-snapshot to use automatic snapshots from repository
or directly from github
By default it creates snapshots for each data set every 15 minutes and saves snapshot up to 1 year. However you could disable snapshots for specific dataset by setting
com.sun:auto-snapshot
dataset property to falseYou could also use
com.sun:auto-snapshot:...
properties to tune auto snapshot behaviour. E.g. save snapshots daily for 31 days for tank/backup dataset:By default script saves:
If you have not taken any snapshots, you lost your data.
To take snapshot, use
zfs snapshot
commandhttp://docs.oracle.com/cd/E19253-01/819-5461/gbcya/index.html