Windows – way to clone an NTFS hard drive but leave some files out

cloneclonezillahard drivewindows 7

I'm trying to find a nice way to do backups of my Windows 7 Media Center machine. Ideally I'd like to take periodic snapshots of the entire hard disk, but leave some files out of the selection. For example, take an image of the whole hard disk, but leave out all of the TV recordings (not the end of the world if I lose those).

I've been using Clonezilla to successfully clone machines for a long time. It's smart enough to use ntfsclone to smartly clone hard disk without resorting to dd. However, it only images the entire hard disk or partition, and does not let me leave some files out.

I know this is possible because we've got a little USB->SATA drive dongle at work that came with some software that allows you to skip files (works great for migrating down to an SSD), but it requires the dongle and only works with laptop drives.

Any suggestions on software I should use? Open Source is preferred, but not necessary.

Best Answer

Here is a way to do it using open source tools, e.g. using the Ubuntu live cd or live usb. You need the terminal and superuser access (sudo -i).

Suppose you want to clone the first partition on the first drive. This is known under linux as /dev/sda1.

First, create a full partition backup using ntfsclone:

ntfsclone -o yourfilename.img /dev/sda1

Yes, it will copy the full drive including unused space. You need sufficient temporary storage to facilitate this.

Now, you can actually mount this exact copy of the partition using a loopback mount point. E.g., to mount your backup at /mnt:

mount -o loop yourfilename.img /mnt

Now you can look at /mnt and delete stuff you don't need.

`cd /mnt

rm -rf "System Volume Information" 

rm pagefile.sys 

rm hiberfil.sys 

rm -rf "Users/myusername/MyLargeFolderIDon'tWantToKeep"`

When ready, unmount the /mnt folder:

cd the_directory_where_I_created_yourfilename.img
umount /mnt

Now, you can use ntfsclone again, but this time you use it on the cleaned up copy of the partition using the special disk format parameter. So your source is not the partition, but the previous backup file. It will only copy the blocks used in this case. Beware that, once you do this, the resulting image can't be mounted as the full disk image could be.

ntfsclone -s -o mysecondfilename.img yourfilename.img

Et voila, the second is an image only containing the data you want to be able to restore on /dev/sda1 in case of disaster.

You can now delete the full backup copy.

rm yourfilename.img
Related Question