tags:

views:

761

answers:

4

I wanted to know if I could just use Linux command 'dd' to make a copy of a hard drive. The hard drive has windows XP and the goal is to move data from a smaller HDD to this larger one without having to explicitly re-install windows. I personally don't know enough to know if this has the potential to screw up the file system. I also don't know if this works between different models of HDDs.

+4  A: 

Yup. dd operates beneath the file system. You can dup partitions or whole drives, depending on what device nodes you use.

You may want to research the optimal "bs" (block size) to use for your hardware because if you get it wrong, this can take forever.

dicroce
BTW... I've used this very technique to upgrade my TiVo hard drive.
dicroce
A: 

You should be fine. Plus, if for some reason you have a problem you'll still have the original (smaller) drive as a fall back.

Andrew
+3  A: 

Yes, you can do this, with a couple things to be aware of.

Different brand hard drives (or even different models of the same brand) may not be the exact same size. You should check the real size of the block devices to verify the target drive is the same size or larger than the source drive. As long as it is, you are good to go.

If the target drive happens to be larger, after you've cloned the drive you can use gparted to expand the partition to fill the drive.

In fact, you could use gparted to shrink the source partition and then copy it to the target drive if the target drive happens to be smaller.

As dicoroce mentioned, you can also copy just partitions instead of an entire drive. Just be aware that if you only copy the partition, you will have to reinstall the MBR (though that is trivial)

Drakonite
+2  A: 

If I'm not mistaken, one very nice feature of GParted is the ability to correctly resize an NTFS partition that has Windows installed, by updating some magic number somewhere. What this means for you is that you'll (probably) be able to expand the partition to fill the whole drive without worrying about confusing Windows.

jleedev