From owner-freebsd-questions@FreeBSD.ORG Thu Feb 9 20:50:38 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org 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 9262716A422 for ; Thu, 9 Feb 2006 20:50:38 +0000 (GMT) (envelope-from ertr1013@student.uu.se) Received: from pne-smtpout1-sn1.fre.skanova.net (pne-smtpout1-sn1.fre.skanova.net [81.228.11.98]) by mx1.FreeBSD.org (Postfix) with ESMTP id A58DA43D68 for ; Thu, 9 Feb 2006 20:50:25 +0000 (GMT) (envelope-from ertr1013@student.uu.se) Received: from falcon.midgard.homeip.net (83.253.29.241) by pne-smtpout1-sn1.fre.skanova.net (7.2.070) id 43E9FE420006758E for freebsd-questions@freebsd.org; Thu, 9 Feb 2006 21:50:23 +0100 Received: (qmail 1452 invoked by uid 1001); 9 Feb 2006 21:50:22 +0100 Date: Thu, 9 Feb 2006 21:50:22 +0100 From: Erik Trulsson To: Martin McCormick Message-ID: <20060209205022.GA1405@falcon.midgard.homeip.net> Mail-Followup-To: Martin McCormick , freebsd-questions@freebsd.org References: <200602092036.k19KaIhn086956@dc.cis.okstate.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200602092036.k19KaIhn086956@dc.cis.okstate.edu> User-Agent: Mutt/1.5.11 Cc: freebsd-questions@freebsd.org Subject: Re: Using dd to Make a Clone of a Drive X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2006 20:50:38 -0000 On Thu, Feb 09, 2006 at 02:36:18PM -0600, Martin McCormick wrote: > After installing FreeBSD5.4, the ISC dhcp server and ISC bind > on a hard drive, I wanted to clone that drive to a second drive so as > to generate a second server, using what I had already installed as a > template. I used the following command: > > dd if=/dev/da0 of=/dev/da1 bs=512 > > It turns out that dd defaults to 512-byte blocks so I didn't > really need the bs=512, but I am not sure I haven't made some other > type of mistake. The dd command has been running for about 4 hours on > a very fast system, with a 1-gig processor, 1 gig of RAM and two 31-GB > drives. One would think it should have finished by now, but it is > still running. Is this a valid method of copying the entire contents > of one drive to another? Thank you. The reason it is taking so long is almost certainly because you are using such a small blocksize. As it is 'dd' will read 512 bytes from da0, write those 512 bytes to da1, read another 512 bytes from da0 (which will probably mean waiting a couple of milliseconds for the head to get into the right position since the disk will have rotated sinc the last read), etc. The speed of your CPU, or the amount of RAM you have, is quite irrelevant in this case. If you try with bs=64k I can almost guarantee it will be a lot faster. Otherwise it is a perfectly good way of making a copy of a disk, provided both disks have the same size and geometry. -- Erik Trulsson ertr1013@student.uu.se