Is it possible to rollback to a snapshot of a zvol?

KevDog

Patron
Joined
Nov 26, 2016
Messages
462
Hi - I ran into a problem today having deleted some files within one of my Ubuntu VM's running inside of FreeNAS. Snapshots of the zvol however are taken daily of the Zvol.

How do I roll back a snapshot of the zvol? The snapshots for zvols I thought were stored within the zvol. Any idea how to do this?
 

Heracles

Wizard
Joined
Feb 2, 2018
Messages
1,401
Hey @KevDog,

From what you described, I would suggest you NOT TO rollback to that snapshot. Should you do it, you would also loose everything new since that snapshot. For such a recovery, I would instead clone the snapshot.

You go in the list of all your snapshots and found the one you need.
You then create a clone of this snapshot and mount in under any name you wish.
You then deploy a new VM pointing to that clone instead of your original zvol.
From that VM, you recover and extract whatever you need.
Once done, you destroy both that temporary VM and the clone.

All of that done without touching the live zvol.
 

KevDog

Patron
Joined
Nov 26, 2016
Messages
462
Hey @KevDog,

From what you described, I would suggest you NOT TO rollback to that snapshot. Should you do it, you would also loose everything new since that snapshot. For such a recovery, I would instead clone the snapshot.

You go in the list of all your snapshots and found the one you need.
You then create a clone of this snapshot and mount in under any name you wish.
You then deploy a new VM pointing to that clone instead of your original zvol.
From that VM, you recover and extract whatever you need.
Once done, you destroy both that temporary VM and the clone.

All of that done without touching the live zvol.

Honestly that worked really well. Thanks for the tip -- I was able to grab what I needed. Thank goodness for daily snapshots on these datasets.
 
Top