0

I am running on a live session of linux on my USB. I am seeking to copy the entire contents on my hard drive to a file on a external USB.

To the best of my knowledge, using the dd command on the mounted directory of the harddrive will copy all of its contents, but will also repartition the USB, which i dont want. I still have files on the exteral USB i used for backing up on other PC's.

To the best of my knowledge, issuing the cp -r command on the mounted directory will copy files, without partitioning, but fail to include hidden files.

What is the proper command i need to copy the entire hardrive to a file for backup?

TrevorKS
  • 240

1 Answers1

2

You can pipe dd to a gzip file:

(source)

# dd if=/dev/hda conv=sync,noerror bs=64K | gzip -c > /mnt/sda1/hda.img.gz

See also : Why is piping 'dd' through gzip so much faster than a direct copy?

Yorik
  • 4,988