How can I backup a partition (not the whole disk) to another partition on an external hard-disk using DD?
I achieved this with the following command:
sudo dd if=/dev/sda6 of=/dev/sdb3 bs=1M
However my requirements are:
I need to backup
/dev/sda6
and store that as an image (.img
) file in/dev/sdb3
Preferably as a compressed (.gz) image file (this is actually what I am trying to achieve)
(Here are my foolish attempts that, obviously, didn't work:
sudo dd if=/dev/sda6 of=/dev/sdb3/backup.img bs=4096 conv=notrunc,noerror
sudo dd bs=1M if=/dev/sda6 | gzip -c > /dev/sdb3/backup.gz