[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sheflug] hdd cloning



On Tue, 2006-07-04 at 12:47 +0100, Gary Stimson wrote:
> Alex Hudson wrote:
> >>   dd if=/dev/hda of=/dev/hdb
> 
> I notice you've put /dev/hda rather than /dev/hda1 etc. Does this mean
> the dd command above will copy the entire disk sector for sector,
> including bootable flags on partitions and even the Master Boot Record?
> I.e. so it can be used to make one bootable hard disk as a copy of another?

Yeah, it can, modulo the other concerns I noted. It's not a bad idea for
copying the MBR, but there are better tools for other parts of the disk.

For example, to replicate the partition structure, you can do:

	sudo sfdisk -d /dev/hda | sudo sfdisk /dev/hdb

... which creates the same structure on /dev/hdb as is on /dev/hda,
although you could split that pipe and dump the structure to a file,
allowing you to edit it lightly before committing it to the new disc.

Ditto, copying files is better done with tar or rsync or something. For
starters, copying the files only is usually dramatically faster than
copying the entire disc byte-for-byte. If it's a really big disc and a
fresh image, that can get quite boring quite quickly.

Cheers,

Alex.


___________________________________________________________________

Sheffield Linux User's Group -
http://www.sheflug.co.uk/mailfaq.html

  GNU the choice of a complete generation.