From owner-freebsd-stable Tue Oct 29 13:18:58 2002 Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DB00737B401 for ; Tue, 29 Oct 2002 13:18:56 -0800 (PST) Received: from apollo.backplane.com (apollo.backplane.com [216.240.41.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 871FA43E77 for ; Tue, 29 Oct 2002 13:18:56 -0800 (PST) (envelope-from dillon@apollo.backplane.com) Received: from apollo.backplane.com (localhost [127.0.0.1]) by apollo.backplane.com (8.12.5/8.12.5) with ESMTP id g9TLItFC010761; Tue, 29 Oct 2002 13:18:56 -0800 (PST) (envelope-from dillon@apollo.backplane.com) Received: (from dillon@localhost) by apollo.backplane.com (8.12.5/8.12.5/Submit) id g9TLIt49010760; Tue, 29 Oct 2002 13:18:55 -0800 (PST) (envelope-from dillon) Date: Tue, 29 Oct 2002 13:18:55 -0800 (PST) From: Matthew Dillon Message-Id: <200210292118.g9TLIt49010760@apollo.backplane.com> To: Mike Hogsett Cc: "Mr. Darren" , freebsd Subject: Re: copy harddrive image References: <200210292048.g9TKmG1J015723@axp.csl.sri.com> Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG :> I have had a harddrive which is doing the SMART imminent failure thing :> for the last little while. I had western digital send me a new drive so :> I could copy all my data over. I am wondering what the best way to do :> this is? "dd if=ad0 of=ad1" doesn't seem to be like a good method.. :> any input? : :That method has worked great for me in the past. But I have usually done :this with brand new disks (source being freshly installed). Also no :partitions on either disk were mounted. : :I would add the argument bs=131072 : : - Mike What I usually do is fdisk and disklabel the new disk, which gives me a chance to adjust the size of the partitions. I then dd each partition across (e.g. dd if=ad0s1a of=ad1s1a) for those partitions whos sizes didn't change, fsck them after I'm done, and use 'cpdup' (/usr/ports/sysutils/cpdup) to copy the rest via mounts. The advantage of using cpdup is that you can do it on a live system, take the system down to single user, do cpdup again to catch whatever changes from the first run (usually very little, so cpdup only takes a few seconds the second time), then power off, swap the drives, and reboot. Total actual down time: 5 minutes or less. DDing the entire disk works too, at least if the system is idle. Be sure to fsck the destination drive though before mounting it. -Matt To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message