Skip to content

Instantly share code, notes, and snippets.

@dlangille

dlangille/snapshots Secret

Created Feb 20, 2021
Embed
What would you like to do?
[dan@knew:~] $ sudo zfs create nvd/bsdnow
[dan@knew:~] $ zfs list nvd/bsdnow
NAME USED AVAIL REFER MOUNTPOINT
nvd/bsdnow 24K 192G 24K /iocage/jails/bsdnow
[dan@knew:~] $ cd /iocage/jails/bsdnow
[dan@knew:/iocage/jails/bsdnow] $ ls -l
total 0
[dan@knew:/iocage/jails/bsdnow] $ touch a
touch: a: Permission denied
[dan@knew:/iocage/jails/bsdnow] $ sudo chown dan .
[dan@knew:/iocage/jails/bsdnow] $ touch a
[dan@knew:/iocage/jails/bsdnow] $ sudo zfs snapshot nvd/bsdnow@a
[dan@knew:/iocage/jails/bsdnow] $ touch b
[dan@knew:/iocage/jails/bsdnow] $ sudo zfs snapshot nvd/bsdnow@b
[dan@knew:/iocage/jails/bsdnow] $ touch c
[dan@knew:/iocage/jails/bsdnow] $ sudo zfs snapshot nvd/bsdnow@c
[dan@knew:/iocage/jails/bsdnow] $ touch d
[dan@knew:/iocage/jails/bsdnow] $ sudo zfs snapshot nvd/bsdnow@d
[dan@knew:/iocage/jails/bsdnow] $ ls -l
total 2
-rw-r--r-- 1 dan wheel 0 Feb 20 18:16 a
-rw-r--r-- 1 dan wheel 0 Feb 20 18:16 b
-rw-r--r-- 1 dan wheel 0 Feb 20 18:17 c
-rw-r--r-- 1 dan wheel 0 Feb 20 18:17 d
[dan@knew:/iocage/jails/bsdnow] $ sudo zfs rollback nvd/bsdnow@c
cannot rollback to 'nvd/bsdnow@c': more recent snapshots or bookmarks exist
use '-r' to force deletion of the following snapshots and bookmarks:
nvd/bsdnow@d
[dan@knew:/iocage/jails/bsdnow] $ touch e
[dan@knew:/iocage/jails/bsdnow] $ ls -l
total 3
-rw-r--r-- 1 dan wheel 0 Feb 20 18:16 a
-rw-r--r-- 1 dan wheel 0 Feb 20 18:16 b
-rw-r--r-- 1 dan wheel 0 Feb 20 18:17 c
-rw-r--r-- 1 dan wheel 0 Feb 20 18:17 d
-rw-r--r-- 1 dan wheel 0 Feb 20 18:18 e
[dan@knew:/iocage/jails/bsdnow] $ sudo zfs rollback nvd/bsdnow@d
[dan@knew:/iocage/jails/bsdnow] $ ls -l
total 2
-rw-r--r-- 1 dan wheel 0 Feb 20 18:16 a
-rw-r--r-- 1 dan wheel 0 Feb 20 18:16 b
-rw-r--r-- 1 dan wheel 0 Feb 20 18:17 c
-rw-r--r-- 1 dan wheel 0 Feb 20 18:17 d
[dan@knew:/iocage/jails/bsdnow] $ sudo zfs destroy nvd/bsdnow@b
[dan@knew:/iocage/jails/bsdnow] $
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment