That easy? LoL yea but sounds true. I can use rsync for do it faster. So can I copy /dev things too? and proc? and why "dd" command exist if its just that?To backup you only need "cp" in my humble opinion.
Some use "rsync", "clone" is also not bad.
pkg install -y pv pigz
zpool create mybak da1
zfs snapshot -r zroot@mybackup
zfs send -R zroot@mybackup |pigz|pv >/mybak/c.zfs.gz
gpart destroy -F da0
gpart create -s gpt da0
gpart add -a 4k -t freebsd-boot -s 512k -l boot da0
gpart add -a 4k -t freebsd-swap -s 16g -l swap0 da0
gpart add -a 4k -t freebsd-zfs -l zfs0 da0
gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 da0
gnop create -S 4096 /dev/gpt/zfs0
zpool create -f -o altroot=/mnt -O canmount=off -m none zroot /dev/gpt/zfs0.nop
zpool import -o altroot=/mnt -f mybak
gzcat /mnt/mybak/c.zfs.gz | zfs receive -vF zroot
shutdown -r now
zpool import -o altroot=/mnt -f zroot
zpool set bootfs=zroot/ROOT/default zroot
shutdown -r now
Why do you think you need to copy those? They're dynamic, virtual, filesystems (see devfs(5) and procfs(5)). Devices are created based on the hardware the machine has, and proc only contains information about things that are currently running on that machine.So can I copy /dev things too? and proc?
dd is archaic, with zfs.That easy? LoL yea but sounds true. I can use rsync for do it faster. So can I copy /dev things too? and proc? and why "dd" command exist if its just that?
He wants a "ghost" image to blast on other computers, although this method will copy SSH keys, not change the hostname, etc.Why do you think you need to copy those?
Yea I mean this by saing cp not a very nice option. cp / thing copies that dynamic dirs too. So cp seems to not a very clean solution.
copying /dev ? hahah is it possible?The question how do you copy /dev is however interesting. It is said you "make special files".
The freebsd installer does this for you ....
SSH keys and I guess it will copy GUID and things like that too. Not very nice but maybe I can randomize them later by a script huh?He wants a "ghost" image to blast on other computers, although this method will copy SSH keys, not change the hostname, etc.
The main and ZFS-native way is to use send streams. You could save a file of the output of "zfs send" and keep that around for future receive operations.I want to full back up my FreeBSD 12.2 system. I want a image file that be able to setup other computers. How?
Not if you dump theDoes "zfs receive" have the ability to cope or recover? Detect and scrub?
zfs recv
into a single file; only if it is received into a proper pool with redundancy (e.g. mirrored vdevs).Does "zfs receive" have the ability to cope or recover? Detect and scrub?
All that sounds wonderful sort of a cascade system but what if you do detect an anomaly with a file.I.e. one host gathers all the backups/snapshots from multiple systems
correct.OK so you must store this zfs 'stream in a file' on a ZFS filesystem then you will be protected from bit rot/ flipped bit.
Is that right?
If version control is needed, the file would be in version control (i.e. our local gitlab server)How do you do 'version control' of a backed up file? Which one to restore from?
dd
to restore it. You must use zfs-receive.I think it is the other way around. After import a scrub should inform about inconsistent data. From my understanding it is close to transfer regular files plus their checksum. If something is corrupted one can copy the files again. It is of course necessary that the original files are still there to be copied, the same applies for a snapshot to be send again. And that does not mean to use poor media for the transfer by intention .So a ZFS send stream at rest should be treated with great care? More so than regular files?
Only use the highest quality media for physically transferring?
from my experience any hiccup in a send|recv stream leads to the process failing and completely reverting the whole recv job. The recv is atomic: either it succeeds, or everything is rolled back to have a consistent state.I think it is the other way around. After import a scrub should inform about inconsistent data.