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

Re: cloning hard disk

On Sun, Feb 13, 2005 at 09:12:35PM -0700, Allasso Travesser wrote:
> Hello,
> I would like to clone my Debian Woody system onto a second larger hard disk. 
> It seems to me that it would just be a matter of cleaning off the second 
> disk, partioning using fdisk, and then running:
> dd if=/dev/hdc of=/dev/hda
> where hdc is the drive from which I am copying my current system, and hda is 
> the drive I want to put this system on.

That only works properly if hdc and hda are identical in size and
geometry. Similarly with partitions: dd if=/dev/hdc2 of=/dev/hda2 is
only sensible if the partitions are identical in size. I'd be doing
something like this:

(boot off hdc)
# cfdisk /dev/hda
(set up partitions)
# mke2fs /dev/hda2
# mount /dev/hda2 /mnt
# cd /
# for x in `ls -1 / | grep -v mnt`; do cp -a /$x /mnt; done

Other people have their own favourite recipes involving tar and/or
cpio which will be in the list archives somewhere.

BTW your partitioning scheme could do with a little modification -
it's customary to make the swap partition the first partition on the
disk, not the last, as access to the outer part of a disk is faster.


Be kind to pigeons
Get my GPG key here: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x21C61F7F

Attachment: signature.asc
Description: Digital signature

Reply to: