disk cloning with dd

View: New views
13 Messages — Rating Filter:   Alert me  

disk cloning with dd

by Alphonse Ogulla :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi all,
Can I simply use dd to clone my failing hard disk (hda) onto another
(hdb) of the same size as follows:

# dd if=/dev/hda of=/dev/hdb bs=512

Or will norton ghost do a better job? Btw, what advantages does ghost
have over dd or vice versa?

Thanks,
Alphonse Ogulla
Nairobi, Kenya.


Re: disk cloning with dd

by Jochen Schulz :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

* Alphonse Ogulla:
>
> Can I simply use dd to clone my failing hard disk (hda) onto another
> (hdb) of the same size as follows:
>
> # dd if=/dev/hda of=/dev/hdb bs=512

If it's exactly the same size, then yes. Keep in mind that you don't
copy files but the whole hard disk - including boot sectors and the
partition table. And, of course, if some of your data is already
corrupt, you are going to have a corrupt copy as well.

BTW: if I were you, I'd take the time to plug one of the drives on the
secondary ide controller (if your machine has one). Copying between two
IDE devices on the same controller is awfully slow.

> Or will norton ghost do a better job? Btw, what advantages does ghost
> have over dd or vice versa?

Dunno.

J.
--
Atrocities committed in Rwanda pervade my mind when I am discussing
mundanities with acquaintances.
[Agree]   [Disagree]
                 <http://www.slowlydownward.com/NODATA/data_enter2.html>


--
To UNSUBSCRIBE, email to debian-user-REQUEST@...
with a subject of "unsubscribe". Trouble? Contact listmaster@...


Re: disk cloning with dd

by Norman Hooper :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Alphonse

> Can I simply use dd to clone my failing hard disk (hda) onto another
> (hdb) of the same size as follows:
>
> # dd if=/dev/hda of=/dev/hdb bs=512
>
> Or will norton ghost do a better job? Btw, what advantages does ghost
> have over dd or vice versa?

If they're identical, I'm sure dd will work. Check out partimage too. It
doesn't require identical drives, and works similarly to Norton Ghost.

Cheers,

Norman.



--
To UNSUBSCRIBE, email to debian-user-REQUEST@...
with a subject of "unsubscribe". Trouble? Contact listmaster@...


Re: disk cloning with dd

by Werner Otto :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Norman Hooper wrote:

>Hi Alphonse
>
>  
>
>>Can I simply use dd to clone my failing hard disk (hda) onto another
>>(hdb) of the same size as follows:
>>
>># dd if=/dev/hda of=/dev/hdb bs=512
>>
>>Or will norton ghost do a better job? Btw, what advantages does ghost
>>have over dd or vice versa?
>>    
>>
>
>If they're identical, I'm sure dd will work. Check out partimage too. It
>doesn't require identical drives, and works similarly to Norton Ghost.
>
>Cheers,
>
>Norman.
>
>
>
>  
>
Can one use dd on a mounted partition, if so will it clone the boot
partition aswell and good to boot from?

Regards
Werner


--
To UNSUBSCRIBE, email to debian-user-REQUEST@...
with a subject of "unsubscribe". Trouble? Contact listmaster@...


Re: disk cloning with dd

by David-243 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Fri, May 06, 2005 at 04:07:17PM +0300, Alphonse Ogulla wrote:
> Hi all,
> Can I simply use dd to clone my failing hard disk (hda) onto another
> (hdb) of the same size as follows:
>
> # dd if=/dev/hda of=/dev/hdb bs=512

I'd prefer to go another route, any of which would require first
creating your partitions on the new HD, but I think any of these might
produce a more satisfactory result.

1. I believe I've seen it recommended on this list that you can use "cp"
   with appropriate options.
2. You could probably do this with "rsync"
3. Personally, I've used tar to recreate the partitions.  I'm doing
   this off the top of my head, so it may not be perfect, but the way to
   do this would be to first create the partition on the new HD.  mount
   this partition on, say, "/mnt".  To duplicate /home, for instance,
   I'd "cd /home", then issue the command
   
          tar --one-file-system -cf - . | tar -C /mnt  -xf -

   (I think this is correct).

   note that with the --one-file-system option, any partitions mounted
   under the current structure won't be copied in this pass.  You will
   have to repeat this process for each partition you need to copy
   unless you wanted to get crafty and perhaps set up a mount system
   within the "/mnt" structure which duplicates your current system.

   After a quick "cp --help", I see that it, too has a --one-file-system
   option, so no doubt you could use an identical strategy using "cp" as
   with "tar".

4. One other option comes to mind.  If time is not of ultimate essence,
   you might want to consider backing up all personal (non-system) files
   you wish to keep and then do a re-install.  I know this sounds
   Windows-ish, but this way, you could insure that you do, indeed have
   a fresh install and none of the system files would be corrupted in
   the event that you had bad blocks containing any of these files on
   your old HD.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@...
with a subject of "unsubscribe". Trouble? Contact listmaster@...


Re: disk cloning with dd

by marty-17 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

David wrote:

>    After a quick "cp --help", I see that it, too has a --one-file-system
>    option, so no doubt you could use an identical strategy using "cp" as
>    with "tar".

If drives /dev/hda and /dev/hdb are identical models, then
"cp /dev/hda /dev/hdb" works and insures an exact sector for
sector mirror copy of all the partitions.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@...
with a subject of "unsubscribe". Trouble? Contact listmaster@...


Re: disk cloning with dd

by tomi :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Werner Otto wrote:
Can one use dd on a mounted partition, if so will it clone the boot
partition aswell and good to boot from?
Don't use dd on a mounted partition. Any files that change while dd is running will end up corrupted on the new drive, and likely the filesystem itself will be corrupted. Boot from a CD or another drive, or at least unmount the partition being copied. Or better use rsync, which will work correctly even with mounted partition.

Re: disk cloning with dd

by Scott Wolchok :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 5/6/05, Jochen Schulz <usenet-nospam@...> wrote:

> * Alphonse Ogulla:
> >
> > Can I simply use dd to clone my failing hard disk (hda) onto another
> > (hdb) of the same size as follows:
> >
> > # dd if=/dev/hda of=/dev/hdb bs=512
>
> If it's exactly the same size, then yes. Keep in mind that you don't
> copy files but the whole hard disk - including boot sectors and the
> partition table. And, of course, if some of your data is already
> corrupt, you are going to have a corrupt copy as well.
>
> BTW: if I were you, I'd take the time to plug one of the drives on the
> secondary ide controller (if your machine has one). Copying between two
> IDE devices on the same controller is awfully slow.

Don't you mean the same IDE channel? I don't understand why anyone
would have two IDE controllers.


Re: disk cloning with dd

by Jochen Schulz :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

* Scott Wolchok:
> On 5/6/05, Jochen Schulz <usenet-nospam@...> wrote:
>>
>> BTW: if I were you, I'd take the time to plug one of the drives on the
>> secondary ide controller (if your machine has one). Copying between two
>> IDE devices on the same controller is awfully slow.
>
> Don't you mean the same IDE channel? I don't understand why anyone
> would have two IDE controllers.

Maybe that was a misnomer on my side. In Germany we always talk about
"primary" and "secondary" controllers when we mean the two IDE
connectors on standard mainboards. I think that's also how it's printed
on the mainboards themselves and in the manuals.

However, it's usually faster to copy from hda to hdc, than to copy from
hda to hdb.

J.
--
When standing at the top of beachy head I find the rocks below very
attractive.
[Agree]   [Disagree]
                 <http://www.slowlydownward.com/NODATA/data_enter2.html>


--
To UNSUBSCRIBE, email to debian-user-REQUEST@...
with a subject of "unsubscribe". Trouble? Contact listmaster@...


Re: disk cloning with dd

by Lee Braiden :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Saturday 07 May 2005 09:53, Jochen Schulz wrote:
> Maybe that was a misnomer on my side. In Germany we always talk about
> "primary" and "secondary" controllers when we mean the two IDE
> connectors on standard mainboards. I think that's also how it's printed
> on the mainboards themselves and in the manuals.

We call them primary and secondary too, but channels and controllers are
different.  A controller is the chip on the *motherboard* that the sockets on
the motherboard connect to.  There is one controller in a typical PC --
usually with two (primary + secondary) IDE channels.  Each channel can have a
master and a slave device.

If you added another IDE controller card in a PCI slot, you'd have four IDE
channels, for a maximum of eight devices.  Of course, special controller
cards might provide even more.

--
Lee.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@...
with a subject of "unsubscribe". Trouble? Contact listmaster@...


Re: disk cloning with dd

by Jochen Schulz :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

* Lee Braiden:

> On Saturday 07 May 2005 09:53, Jochen Schulz wrote:
>
>> Maybe that was a misnomer on my side. In Germany we always talk about
>> "primary" and "secondary" controllers when we mean the two IDE
>> connectors on standard mainboards. I think that's also how it's printed
>> on the mainboards themselves and in the manuals.
>
> We call them primary and secondary too, but channels and controllers are
> different.  A controller is the chip on the *motherboard* that the sockets on
> the motherboard connect to.  There is one controller in a typical PC --
> usually with two (primary + secondary) IDE channels.  Each channel can have a
> master and a slave device.

Ah, thanks for the clarification. There's too much pseudo-english in
this country. :-)

J.
--
A passionate argument means more to me than a blockbuster movie.
[Agree]   [Disagree]
                 <http://www.slowlydownward.com/NODATA/data_enter2.html>


--
To UNSUBSCRIBE, email to debian-user-REQUEST@...
with a subject of "unsubscribe". Trouble? Contact listmaster@...


Parent Message unknown Re: disk cloning with dd

by dovidhalevi :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Friday 06 May 2005 17:54, debian-user-digest-request@...
wrote:

> > Can I simply use dd to clone my failing hard disk (hda) onto another
> > (hdb) of the same size as follows:
> >
> > # dd if=/dev/hda of=/dev/hdb bs=512
> >
> > Or will norton ghost do a better job? Btw, what advantages does ghost
> > have over dd or vice versa?
>
> If they're identical, I'm sure dd will work. Check out partimage too. It
> doesn't require identical drives, and works similarly to Norton Ghost.

Warning: Partimage insists upon the full destination disk size even though the
actual data only occupies a small fraction of the size and will fit easily on
the target. I did not try dd.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@...
with a subject of "unsubscribe". Trouble? Contact listmaster@...


Re: disk cloning with dd

by Nacho-9 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Fri, May 06, 2005 at 03:43:03PM +0200, Jochen Schulz wrote:
> If it's exactly the same size, then yes. Keep in mind that you don't
> copy files but the whole hard disk - including boot sectors and the
> partition table. And, of course, if some of your data is already
> corrupt, you are going to have a corrupt copy as well.

Correct me if I'm wrong, but I think you don't need the disks are the same
size, I mean, you can use dd to "clone" just the filesystems to files on
another disk; you would use /dev/hda1 and so instead of /dev/hda...

In this way you can mount the resulting files as if they were filesystems on a
disk (using the loopback device).

Regards:

Nacho

--
No book comes out of a vacuum (G. Buehler)
http://www.lascartasdelavida.com


--
To UNSUBSCRIBE, email to debian-user-REQUEST@...
with a subject of "unsubscribe". Trouble? Contact listmaster@...