-   Linux - General (
-   -   Cloning a hard drive! (

Shioni 03-19-2006 08:52 AM

Cloning a hard drive!
My friend has two computers, one is running XP other Win2000, I want to install Linux on the first one. But my friend doesn't want to lose all Win software, so I decited try to clone HDD. I think both of these HDD has NTFS. Can I just clone it using live CD like this?:

dd if=/dev/hda of=/mmt/hda2/hdd.iso
and then put it on the Win2000 box and somehow using dd, write it on the disk? is this posible? Thank you!

Lenard 03-19-2006 09:14 AM

Yes, but you might want to use partimage as a solution instead;

saikee 03-19-2006 10:25 AM

A LiveCD is totally adequate for the job as documented in the first link of my signature.

Basically you can clone the whole disk if the target is equal or bigger than the source disk. In any case you can clone the partition alone in any other situation.

In cloning with "dd" command the target disk will boot too.

Shioni 03-19-2006 11:20 AM

Thank you! I downloaded SystemRescueLiveCD, now the only problem is that PartImage says:

NTFS Windows NT, 2000 and XP experimental
Both hard drives use NTFS. And another problem.
The used space on the first machine is 9GB, I need to copy that. The disk is 50GB size. The second machine has 250GB disk. First I will put in the live CD and then clone the whole drive and make ISO file. Then I will 'burn' everything on the second machines hard drive. Can I run into any problems with this? for example, the second machine will show, that the hard drive is only 50GB? Thank you!

Lenard 03-19-2006 11:44 AM

Never had a problem with partimage (but your mileage may vary). To be sure why not do both, the 'dd' file will be about 50-gig in size.

You may want to make sure the filesystem your recording the backup images (partimage or dd) can handle large files (greater the say 4-gig).

saikee 03-19-2006 11:44 AM

The thing to remember is if play around with NTFS files the Linux programs are experimental only and may break down.

If you use "dd" then the partition is copied natively in 1s and 0s and no filing system is involved. That is why Linux can clone XP and still makes it bootable even officially it can write on a NTFS partition. The downside is since no filing system is used you don't get a compression. In your case the whole of the 50Gb will be mirrored unless the your XP is in a smaller partition. At 50Mb/s transfer rate obtainable from dd a 50Gb cloning should take about 1000 seconds which isn't much.

What you can improve on is to use a modern LiveCD with QTparted inside to "resize" the XP partition to a smaller size, say 10 or 12Gb. Both Kantotix and Knoppix have QTParted inside the LiveCD. As a rule you should defrag XP before resizing it.

In your case I would clone the partition, say from hda1 to hdb1 by a simple command

dd if=/dev/hda1 of=/dev/dev/hdb1 bs=32768
The block size 32768 is a product of 64 sectors times 512 bytes per sector, making one full track being cloned at a time. Not providing a size for bs then dd will default to 512 byes. You still have a full 250Gb in the hdb no matter what you do.

sundialsvcs 03-19-2006 12:39 PM

And, say... most motherboards have two IDE-chains which means that you can have three hard-drives in addition to the CD-ROM. If you took the approach of adding a third drive for Linux, you could do the work without altering this somewhat-complex XP configuration in the slightest.

All times are GMT -5. The time now is 01:35 AM.