From owner-freebsd-questions Mon Sep 30 14:16:36 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 9400737B401 for ; Mon, 30 Sep 2002 14:16:34 -0700 (PDT) Received: from spin.web.net (spin.web.net [192.139.37.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id E841C43E6E for ; Mon, 30 Sep 2002 14:16:33 -0700 (PDT) (envelope-from rob@web.net) Received: by spin.web.net (Postfix, from userid 1000) id 2BAF412E4BB; Mon, 30 Sep 2002 17:16:27 -0400 (EDT) Date: Mon, 30 Sep 2002 17:16:26 -0400 From: Rob Ellis To: freebsd-questions@FreeBSD.ORG Subject: Re: how to use 'dd' to create image of a hard drive? Message-ID: <20020930211626.GS28962@web.ca> Mail-Followup-To: Rob Ellis , freebsd-questions@FreeBSD.ORG References: <3.0.5.32.20020930155536.028ece30@mail.sage-one.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3.0.5.32.20020930155536.028ece30@mail.sage-one.net> User-Agent: Mutt/1.3.28i 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 On Mon, Sep 30, 2002 at 03:55:36PM -0500, Jack L. Stone wrote: > 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. > To make the new disk bootable you want to copy the disklabel and bootstrap code -- but then you probably also want to do that on a slice rather than the disk device (e.g., "ad0s1" rather than "ad0") -- check your setup. So you might do something like this: # example only, don't cut & paste dd if=/dev/ad0s1 of=/dev/ad1s1 bs=128k # for ata disklabel /dev/ad0s1 > disklabel.ad0s1 disklabel -R -B /dev/ad1s1 disklabel.ad0s1 - Rob -- Rob Ellis System Administrator, Web Networks To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message