From owner-freebsd-questions Mon Sep 30 14:37:18 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C18A437B401 for ; Mon, 30 Sep 2002 14:37:16 -0700 (PDT) Received: from postal3.es.net (postal3.es.net [198.128.3.207]) by mx1.FreeBSD.org (Postfix) with ESMTP id 16D2243E3B for ; Mon, 30 Sep 2002 14:37:16 -0700 (PDT) (envelope-from oberman@es.net) Received: from ptavv.es.net ([198.128.4.29]) by postal3.es.net (Postal Node 3) with ESMTP id MUA74016; Mon, 30 Sep 2002 14:37:15 -0700 Received: from ptavv (localhost [127.0.0.1]) by ptavv.es.net (Postfix) with ESMTP id 46E515D06; Mon, 30 Sep 2002 14:37:14 -0700 (PDT) To: "Jack L. Stone" Cc: "Pranav A. Desai" , freebsd-questions@FreeBSD.ORG Subject: Re: how to use 'dd' to create image of a hard drive? In-reply-to: Your message of "Mon, 30 Sep 2002 15:55:36 CDT." <3.0.5.32.20020930155536.028ece30@mail.sage-one.net> Date: Mon, 30 Sep 2002 14:37:14 -0700 From: "Kevin Oberman" Message-Id: <20020930213714.46E515D06@ptavv.es.net> Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG > Date: Mon, 30 Sep 2002 15:55:36 -0500 > From: "Jack L. Stone" > 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