What happens to Snapshots during Factory Reset?

Status
Not open for further replies.

jnyl42

Dabbler
Joined
Dec 1, 2014
Messages
16
After months of frustration with my jails not working correctly, I backed up my configs and did a factory reset. While redoing my settings, I noticed all my snapshots were gone... so I freaked out and loaded the config I backed up, but they're still gone.

Can someone help me understand this behavior? I was under the impression that snapshots were a part of the filesystem and wouldn't be changed by a config reset. Are they still there somewhere, or do I just have to start over?
 
Joined
Jul 3, 2015
Messages
926
Something sounds wrong as I've done many config file backup and wipe OS and start again then upload Config file and snapshots stay. Like you said they form part of the pool. I've never used the 'factory reset' option however just a good old fashioned backup config and wipe the OS media.
 
D

dlavigne

Guest
The snapshots should still be there as they're part of the ZFS metadata on the storage disks. However, it's possible that the GUI isn't displaying them as the config reload nuked the snapshot tasks. Does recreating that in the GUI allow them to be displayed again?
 

depasseg

FreeNAS Replicant
Joined
Sep 16, 2014
Messages
2,874
Have you tried a reboot? Sometimes the rediscovery takes a little time.

From a command line, run zfs list -t snapshot to view what's actually on the filesystem.
 

jnyl42

Dabbler
Joined
Dec 1, 2014
Messages
16
This was a few days ago, I've been working on it a while. I rebooted several times trying different boot restorations and config backups, and then I made the snapshot task again (probably not an exact match though...)

I ran zfs list -t snapshot right now and it appears they're gone, except for the ones from the new snapshot task.

Is it possible that, when FreeNAS rebooted with an empty config, it checked for snapshot tasks, saw none, and "cleaned up" accordingly before I could change it? That's all I can think of.
 
Last edited:

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,525
Is it possible that, when FreeNAS rebooted with an empty config, it checked for snapshot tasks, saw none, and "cleaned up" accordingly before I could change it? That's all I can think of.

It does not.

BUT, it will clean stuff up that is "expired". That's why I recommend long expiration times. People that do 3 days, 4 days, etc. often find themselves in trouble because it might take them 3-4 days to get the system back up, and then they'll find they have no snapshots (which sounds kind of like the issue you are having).

But no, FreeNAS only deletes snapshots when they are "expired". If they haven't reached the point where they should expired (or are manual snapshots) they aren't deleted.
 

jnyl42

Dabbler
Joined
Dec 1, 2014
Messages
16
Thanks for weighing in everyone. So I went sniffing around my zpool history and found that there was, in fact, a mass snapshot purge after the "factory reset"... but it seems to only have been cleaning up the outer, recursive directory of prior deleted snapshots. Here's a sample from the purge, and all relevant prior entries:
Code:
2015-11-07.04:00:15 zfs snapshot -r TenPool@auto-20151107.0400-2w
2015-11-21.04:00:21 zfs destroy -r -d TenPool/Windows@auto-20151107.0400-2w
2016-03-28.17:33:46 zfs destroy -r -d TenPool@auto-20151107.0400-2w  //date of factory reset & mass purge


So you could see why I was heartbroken for a second when I saw a mile long list of those destroys right after the reset. But yeah... 2 week snapshots only. Not good regardless. Hard knocks tuition paid for the semester.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,525
Yep. That was FreeNAS deleting a snapshot that should have been looooong expired. :P
 
Status
Not open for further replies.
Top