Restore old snapshot, while still keeping intermediate/newer snapshots of dataset?

Interesting, block cloning seems active with recent versions, when copying from snapshot to same encrypted dataset:

root@truenas[/mnt/main/encrypted]# zfs get encryption main/encrypted
NAME            PROPERTY    VALUE        SOURCE
main/encrypted  encryption  aes-256-gcm  -

root@truenas[/mnt/main/encrypted]# zpool list -o name,size,alloc,free,bcloneused,bclonesaved main
NAME   SIZE  ALLOC   FREE  BCLONE_USED  BCLONE_SAVED
main  4.50G  1010M  3.51G            0             0

root@truenas[/mnt/main/encrypted]# ls -sh .zfs/snapshot/manual/random-bin
1001M .zfs/snapshot/manual/random-bin

root@truenas[/mnt/main/encrypted]# cp .zfs/snapshot/manual/random-bin .

root@truenas[/mnt/main/encrypted]# ls -sh
total 1001M
1001M random-bin

root@truenas[/mnt/main/encrypted]# zpool list -o name,size,alloc,free,bcloneused,bclonesaved main
NAME   SIZE  ALLOC   FREE  BCLONE_USED  BCLONE_SAVED
main  4.50G  1010M  3.51G        1000M         1000M

Great thing. Maybe that previous cp took so long due to amount of small files in that directory.

I also tried zfs rename via CLI and it works like a charm in TrueNAS. Definitely will pick up Clone + Promote + Rename in my toolbox as alternative to zfs rollback.

Add ability to rename datasets

1 Like