![如何备份整个 ZFS 池(在 FreeBSD 安装期间创建的 zroot)?](https://linux22.com/image/183767/%E5%A6%82%E4%BD%95%E5%A4%87%E4%BB%BD%E6%95%B4%E4%B8%AA%20ZFS%20%E6%B1%A0%EF%BC%88%E5%9C%A8%20FreeBSD%20%E5%AE%89%E8%A3%85%E6%9C%9F%E9%97%B4%E5%88%9B%E5%BB%BA%E7%9A%84%20zroot%EF%BC%89%EF%BC%9F.png)
as above.
when I mentioned snapshot, I meant all of the pool and not just the individual filesystem created by FreeBSD. So in case I made a mess in various folders, I can just rollback to this snapshot and my FreeBSD instance feels it's newly installed/factory reset.
Thanks
for reference, here are the various filesystems created during Auto-ZFS installation
root@mydesktop:/home/myuser # zfs list
NAME USED AVAIL REFER MOUNTPOINT
zroot 887M 51.0G 96K /zroot
zroot/ROOT 884M 51.0G 96K none
zroot/ROOT/default 884M 51.0G 884M /
zroot/tmp 112K 51.0G 112K /tmp
zroot/usr 432K 51.0G 96K /usr
zroot/usr/home 144K 51.0G 144K /usr/home
zroot/usr/ports 96K 51.0G 96K /usr/ports
zroot/usr/src 96K 51.0G 96K /usr/src
zroot/var 724K 51.0G 96K /var
zroot/var/audit 96K 51.0G 96K /var/audit
zroot/var/crash 96K 51.0G 96K /var/crash
zroot/var/log 244K 51.0G 244K /var/log
zroot/var/mail 96K 51.0G 96K /var/mail
zroot/var/tmp 96K 51.0G 96K /var/tmp
答案1
Unless you want to make a block-level backup of each vdev in the pool (e.g. using dd
), ZFS only provides you with a dataset-level backup mechanism. However, you can create recursive snapshots and back these up using zfs send
using the -R
option. This way you can back up all datasets in your zpool.