ZFS Snapshots

Hi. I installed my new FreeBSD server with ZFS. I have not tried to use snapshots yet. I am not sure that this is correct - snapshot feature can be used to restore previous state of system. For example, I can make installation of new software, changes of configuration, upgrades, etc. Before all this I can create a snapshot and if the system is unstable after all new changes it can easily be returned to previous state. I guess snapshot switching can be made on the fly without reboot? If this is true, I am interested what happens with open files in the moment of snapshot switching. For example one process keeps open log file and adds new lines. The log file is empty or not exists in alternative snapshot (old state). What happens with the process and its open file(s)?
 
You're going to want to look at bectl(8), or, if you're still on 11.x sysutils/beadm.

I guess snapshot switching can be made on the fly without reboot?
Yes, you can.

If this is true, I am interested what happens with open files in the moment of snapshot switching.
It will fail. To revert to a snapshot the filesystem will need to be unmounted, which you can't do because it's still active.
 
Back
Top