Dd as a backup tool
dd is an excellent imaging tool , mainly lmeant for cloning partitions to images
you are certain that the image file is an exact byte 2 byte ( actually block t 2 block) copy
however, it can be use as a backup tool as well ,
but as backup not so efficient, since it copies all unallocated spaces as well ( ? as zero ? as null ? something else ? )
a great advantage is tat dd is avalable on all linux distro, garanteed
dd = disk based , it uses blockes/sectors , not files
possible approaches
rsync --sparse /dev/sda /dev/sdb ?
maar dit sync’t 2 partitions , niet een partitie naar een image file
rsync = file based
?Alternative implementation : github.com/dagelf/ddnz
./ddnz /dev/sda /dev/sdb
UPDATE , in the meantime the tool dd has been updated :
man dd
bs=BYTES
read and write up to BYTES bytes at a time (default: 512);
conv=CONVS
convert the file as per the comma separated symbol list => hoe ziet dat
sparse
try to seek rather than write the output for NUL input blocks
=>
dd if=/dev/sda of=/dev/sdb bs=1M conv=sparse
# R/W per sector instead:
dd if=/dev/sda of=/dev/sdb bs=4k conv=sparse
dd if=/dev/sda of=/dev/sdb bs=512 conv=sparse
test 1
dd if=/dev/sda of=/dev/sdb bs=1M conv=sparse
werkt prima , maar nog steeds met alle sectors , wel stukken sneller met de bs optie