PDA

View Full Version : Ghosting a hard drive with Linux Live CD


Feek
21-12-2007, 20:36
I've got a secondary drive connected to my system and I want to ghost the main drive onto it. Norton Ghost fails about half way through and just won't have it so I'm looking at using dd

I understand from googling that the correct format should be...

dd if=/dev/sda of=/dev/sdb bs=32768

Because I'm using sata drives.

However, an fdisk -l returns this:

Disk /dev/hda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 60802 488384512 7 HPFS/NTFS

Disk /dev/hdc: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hdc1 * 1 60802 488384512 7 HPFS/NTFS


So therefore should the command be as follows?

dd if=/dev/hda of=/dev/hdc bs=32768

I've tried that and nowt happens. Nothing. Nada.

Using Knoppix 5.1 Live CD.

I really want to get this drive cloned and it's not going well today.

Mark
21-12-2007, 21:19
Drive letters depend entirely on the drivers and whether the BIOS is configured for legacy or AHCI/RAID mode. Make absolutely sure you've got them the right way around first, obviously. :)

I'm not entirely sure about cloning the MBR and partition tables using DD, but then again I don't see why it wouldn't work given that the disks appear to have identical geometry (cloning the partition tables of disks with different geometry is liable to be more problematic). Having said that, as you've had problems this could be why.

I'd use a bigger block size though - the bigger the better really (within reason). I'd suggest bs=1048576

Since the partition tables are already there and match, my first suggestion would be:

dd if=/dev/hda1 of=/dev/hdc1 bs=1048576

You may also have to clone the MBR if Ghost hasn't done that, for which use:

dd if=/dev/hda of=/dev/hdc bs=446 count=1

Daz
21-12-2007, 21:32
I'm not entirely sure about cloning the MBR and partition tables using DD
Done it tons of times, even with disks of different sizes (smaller to larger though obviously) and it's worked like a dream :) I use tiny block sizes though :o

You sure it's not doing anything Feek? dd will just sit there without any progress info while it's working, it'll only say anything if it hits a problem or completes. It will spit out it's current blocks in/out though if you send it a USR1 signal. In another terminal type 'kill -USR1 <pid_of_dd>' (think that's right), and you can find the pid by typing 'ps aux|grep dd', the pid will be on the left somewhere :)

Obviously make sure you get the right source and destination too.

Feek
21-12-2007, 22:03
It doesn't appear to be doing anything - I'm getting no progress info but I'd not really expect that, but the kicker is that I'm getting no drive activity lights which I would expect.

I'll try the USR1 thing. (using a PC downstairs to send this while it's happening upstairs).

Feek
21-12-2007, 22:10
Done that, it's copied 9.1Gb in an hour at a rate of 2.1Mb/sec

That's stupidly slow.

Mark
21-12-2007, 22:31
Yup, it is. Had the same problem when I had to clone a disk a month or so ago.

Feek
21-12-2007, 22:43
I've aborted it, might kick it off pre-bed tomorrow unless I can find another way.

Daz
21-12-2007, 23:32
I've never seen it that slow :/ Mind you, every time I've tried it I've been using an external disk, so it's not a fair comparison, but I still dont know why it's crawling like that.

Feek
22-12-2007, 14:01
Acronis True Image (http://eu.acronis.com/homecomputing/products/trueimage/) did it for me in about 45 minutes.

All done and working :)

Garp
22-12-2007, 14:30
g4l is a good tool :)

http://sourceforge.net/projects/g4l

Used it for imaging at the college, as its free and college were cheap skates ;D It happily reads to and from an FTP server too so we just had a workstation running FileZilla

edit: We had a presentation from Acronis about their software which they were proposing we could use alongside a DDU Disk Array (Data Deduplication) for backups.. sadly it seemed too immature a software for backups, at least on the scale we're talking about. However the product is extremely good and has loads of uses we can find for it at work :) Not least of which is the ability to ghost a server and then convert it to a VMWare image for virtualising.