Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 30 Sep 2002 14:37:14 -0700
From:      "Kevin Oberman" <oberman@es.net>
To:        "Jack L. Stone" <jackstone@sage-one.net>
Cc:        "Pranav A. Desai" <pdesai1@cs.uh.edu>, freebsd-questions@FreeBSD.ORG
Subject:   Re: how to use 'dd' to create image of a hard drive? 
Message-ID:  <20020930213714.46E515D06@ptavv.es.net>
In-Reply-To: Your message of "Mon, 30 Sep 2002 15:55:36 CDT." <3.0.5.32.20020930155536.028ece30@mail.sage-one.net> 

next in thread | previous in thread | raw e-mail | index | archive | help
> Date: Mon, 30 Sep 2002 15:55:36 -0500
> From: "Jack L. Stone" <jackstone@sage-one.net>
> Sender: owner-freebsd-questions@FreeBSD.ORG
> 
> At 03:50 PM 9.30.2002 -0500, Pranav A. Desai wrote:
> >
> >Hi all!
> >
> >	Can I use something like
> >
> >dd if=/dev/ad0 of=/dev/ad1
> >
> >to copy every thing from first drive to the second and be able to boot
> >from the second drive? Do I need to specify block size ? The second drive
> >doesnt have anything on it (filesystem or slices).
> >
> >Thanks
> >
> >-Pranav
> >
> 
> You would use this for IDE HDs:
> # dd if=/dev/ad0 of=/dev/ad1 bs=8192 #Change the "bs" switch to something
> that works best for you.
> 
> Of importance is that ad1 be equal to or larger than ad0. If larger, then
> that larger portion will be unusable.

You can also use dd(1) on a slice:
dd bs=8192 if=/dev/ad0s1 of=/dev/ad2s2

Same size caveats apply. The output slice must fit and will be the
same size as the input slice. This is handy because you can copy one or
two slices to a smaller disk (as long as it has room for the slices)
and you can re-order slices.

I used to regularly backup my 12 GB drive to a 6 GB drive by copying
the first two slices, one Windows and one FreeBSD. Both were bootable
if I installed the disk in place of ad0. (Actually, it was bootable
from ad2, but required a stand alone boot to edit the fstab.)

R. Kevin Oberman, Network Engineer
Energy Sciences Network (ESnet)
Ernest O. Lawrence Berkeley National Laboratory (Berkeley Lab)
E-mail: oberman@es.net			Phone: +1 510 486-8634

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020930213714.46E515D06>