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?