ZFS How to copy (make a backup) root zfs pool?

Hello. I created recursive snapshot and sent it in another volume. Here are 'six-system' is production zfs pool, 'kinghuxing' is backup pool.

zfs snapshot -r six-system@tosam
zfs send -Rv six-system@tosam | zfs receive kingchuxing
zpoll export kingchuxing

What about right way to replication production pool into backup pool? Can I do that? I did it, and after it, if I zpool import kingchuxing -o altroot=/mnt I see only one dataset 'usr' in 'mnt' folder, but zfs list says that:

kingchuxing 213G 248G 88K none
kingchuxing/ROOT 30.3G 248G 88K none
kingchuxing/ROOT/default 30.3G 248G 30.3G /mnt/kingchuxing
kingchuxing/audit 88K 248G 88K none
kingchuxing/crash 88K 248G 88K none
kingchuxing/log 15.9M 248G 15.9M none
kingchuxing/mail 34.6M 248G 34.6M none
kingchuxing/swap 2.65G 250G 636M -
kingchuxing/usr 180G 248G 88K /mnt/kingchuxing/usr
kingchuxing/usr/home 180G 248G 143G /mnt/kingchuxing/usr/home
kingchuxing/usr/home/jails 36.5G 248G 31.4G /mnt/kingchuxing/usr/home/jails
kingchuxing/usr/home/jails/data 1.43G 248G 3.21G /mnt/kingchuxing/usr/home/jails/data
kingchuxing/usr/home/jails/http 1.90G 248G 3.68G /mnt/kingchuxing/usr/home/jails/http
kingchuxing/usr/home/jails/shumbely 1.85G 248G 1.81G /mnt/kingchuxing/usr/home/jails/shumbely
kingchuxing/var 88K 248G 88K /mnt/kingchuxing/var
six-system 213G 709G 88K none
six-system/ROOT 30.3G 709G 88K none
six-system/ROOT/default 30.3G 709G 30.3G /
six-system/audit 88K 709G 88K none
six-system/crash 88K 709G 88K none
six-system/log 15.9M 709G 15.9M none
six-system/mail 34.6M 709G 34.6M none
six-system/swap 2.65G 711G 636M -
six-system/usr 180G 709G 88K /usr
six-system/usr/home 180G 709G 143G /usr/home
six-system/usr/home/jails 36.5G 709G 31.4G /usr/home/jails
six-system/usr/home/jails/data 1.44G 709G 3.16G /usr/home/jails/data
six-system/usr/home/jails/http 1.90G 709G 3.68G /usr/home/jails/http
six-system/usr/home/jails/shumbely 1.85G 709G 1.81G /usr/home/jails/shumbely
six-system/var 88K 709G 88K /var
 
Consider if you want certain settings for your backup such as `zfs set readonly=on kingchuxing`.

Without overriding settings such as with -x or -o on receive, you cannot transfer a root pool without it mounting over the running system's mount points. You can send to a file and restore that file to a disk later but then you cannot browse the backup, switch to the backup as your live system, etc.

You can temporarily override properties on the destination datasets with '-x' so when copied back to another disk they will be changed back with a -b flag when sending back. Example: `zfs send -LRv six-system@tosam | zfs recv -x mountpoint -x canmount -x compression -x atime -x refreservation -x readonly kingchuxing`. There are probably other settings worth overriding on a backup vs the running system.
 
Back
Top