about using dd command to copy hard drives
strick at covad.net
Thu Aug 21 23:32:32 PDT 2003
On Fri, 22 Aug 2003, dvelez502 at verizon.net wrote:
> I'm using freebsd 5.0 Jan 2003 series
> I know that dd is good at copying block devices when they
> are at identical sizes. But if they're different sizes will it
> copy correctly?
> I want to copy my entire freebsd hard disk which is 6 GB
> to a new hard disk at 20 GB.
> I read the man pages but still can't understand it. I'm only a user
> not a programmer nor sys admin. If you have any comments or
> suggestions, I would surely appreciate it.
You could copy your small disk image onto the beginning of your hard
disk, fixup your partition tables by running fdisk and disklabel, and
perhaps expand some of your old file systems with the growfs command,
but I advise against it.
It would be easier, though perhaps slower, to use fdisk, disklabel and
newfs to create new partitions and file systems on the new drive and
to copy the old file systems with dump/restore. If you do it this way,
the files in the new file systems will be much closer to contiguous
(a good thing). It will be much easier to expand the size of file
systems other than the last one on your old disk. You will have the
opportunity to reorganize your file systems and the new file systems
will be better organized internally.
I gather that the disk you intend to copy is a bootstrap disk. Don't
forget to install the MBR bootstrap and the FreeBSD slice bootstrap.
You might find it most convenient to create the new disk slices and
FreeBSD partitions with /stand/sysinstall. I recall that there is
an underdocumented "W" command that you can give when in the disk
slice and partition creation menus that will cause the new partition
tables and bootstraps to be written when you exit the menus so that
you don't have to do an installation "commit". I usually do this
kind of thing when booted from FreeBSD installation media, but I gather
that it works ok when running multiuser. The man page is "sysinstall".
strick at covad.net
More information about the freebsd-questions