I will be backing up a large (750GB) disk to an external USB disk using dd.
Should I be using redirection or piping? Which is more efficient? Or is there a difference?
Also, what is the best block size? USB is likely to be the bottleneck here.
dd if=/dev/sda bs=1M | gzip -c > /mnt/sdb1/backups/disk.img.gz
gzip -dc /mnt/sdb1/backups/disk.img.gz | dd of=/dev/sda bs=1M
vs
dd if=/dev/sda bs=1M | gzip -c | dd of=/mnt/sdb1/backups/disk.img.gz
dd if=/mnt/sdb1/backups/disk.img.gz | gzip -dc | dd of=/dev/sda bs=1M
Thanks.
dd
is archaic (any other tool thankfully does away withbs=
andcount=
, likeddrescue
), and in your case also pretty much pointless. Just pipe it intogzip -c </dev/sda >disk.img.gz
&gzip -cd disk.img.gz >/dev/sda
. – Mar 12 '12 at 11:12dd if=.../disk.img.gz |
part supposed to do? As far as I understand,gzip -dc
(=zcat
) doesn't care for itsstdin
when there's a file argument. – sr_ Mar 12 '12 at 13:57dd
.ddrescue
looks more robust then plaindd
. Would you use GNUddrescue
ordd_rescue
? What is a good Live CD to download? – mcu Mar 12 '12 at 20:45