Backing up Windows drive using dd

After installing Debian on a USB stick I have discovered that my mSATA drive with Windows installed has been corrupted, presumably by GRUB. Before attempting to perform a recovery of my Windows partition, I wanted to back up the drive, and wondered if I could use dd to do this. What seems to have happened is that GRUB overwrote the MBR of the mSATA drive and in so doing any file system information seems to have been corrupted.

gpart show identifies the former NTFS partitions as ms-basic-data. I want to save the data on a external disk before trying to correct the file system information. Can I use dd to do this?
 
Yes. Of course, it will copy every block in the partition, not just used ones, but there is no way to get around that now. Give it a decent buffer size to speed up copying.
 
I know that if I set of to a device it has to be a least as big as if and then I will create a copy, but I'm not sure what will happen if I set it to a file...
 
If set to a file, the output goes to a file. Likely a huge file, depending on the input. It can be piped through gzip(1) for compression:
dd if=/dev/ada0s2 bs=1M | gzip > /home/storage/corrupt-win-nt-fs.gz

(Untested.)
 
Back
Top