From owner-freebsd-stable Tue Oct 29 14:39:27 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 9515437B401 for ; Tue, 29 Oct 2002 14:39:25 -0800 (PST) Received: from apollo.backplane.com (apollo.backplane.com [216.240.41.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1B33F43E42 for ; Tue, 29 Oct 2002 14:39:25 -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 g9TMdOFC011367; Tue, 29 Oct 2002 14:39:24 -0800 (PST) (envelope-from dillon@apollo.backplane.com) Received: (from dillon@localhost) by apollo.backplane.com (8.12.5/8.12.5/Submit) id g9TMdO64011366; Tue, 29 Oct 2002 14:39:24 -0800 (PST) (envelope-from dillon) Date: Tue, 29 Oct 2002 14:39:24 -0800 (PST) From: Matthew Dillon Message-Id: <200210292239.g9TMdO64011366@apollo.backplane.com> To: "Jack L. Stone" Cc: Mike Hogsett , "Mr. Darren" , freebsd Subject: Re: copy harddrive image References: <200210292048.g9TKmG1J015723@axp.csl.sri.com> <3.0.5.32.20021029162139.010ec928@mail.sage-one.net> 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 :Hi, Matt: I've never tried your "cpdup" program I just installed the port :to try it. :....and wonder: : :1) why you prefer it to ole dump/restore? cpdup is not a replacement for dump/restore. That is, the programs do different things. cpdup does not produce an archive, for example, it's just a glorified copy that is able to retain softlinks, hardlinks, and other special features of files. On the otherhand, cpdup works quite well on live filesystems and cpdup works incrementally, meaning you can ^C it and restart it at any time and it will pick up where it left off. dump does not work well at all on a live filesystem and if you kill it you have to rerun it from scratch. :2) what would be the typical syntax of the line command you use to copy :over the ad0s1f to ad1s1f partition for example. : :I like your dd/cpdup combo approach and would like to try it on a test box. : :Best regards, :Jack L. Stone, :Administrator Just do a 'man cpdup', or run cpdup without options. I typically just use 'cpdup srcdir destdir'. Remember, cpdup will remove items from the destination that do not exist in the source. It will ask first by default. Fdisk/disklabel/newfs the new disk Mount newdisk partitions in /mnt, mimicking your normal mounts. for example: mount /dev/ad1s1a /mnt mkdir /mnt/usr mount /dev/ad1s1d /mnt/usr mkdir /mnt/var etc... cpdup / /mnt cpdup /usr /mnt/usr cpdup /var /mnt/var (go into single user) cpdup them all again shutdown, swap disks, reboot. For dd the person who posted the comment in regards to block size is absolutely correct. It is safest to run dd only on idle filesystems, leaving the source filesystems mounted and the destination partitions unmounted (of course). This way if you accidently specify a source filesystem as a destination the OS will not allow the source to be openned for writing (it will return a 'device busy' error), which can save your ass if you make a mistake. But it also means you have to be sure the source filesystem are idle and sync'd up (sync; sync; sync; sync; ...), and that you have to fsck the destination partitions after the dd finishes. # example dd if=/dev/ad0s1a of=/dev/ad1s1a bs=1m Using dd can be dangerous. Be sure not to accidently specify a destination that winds up overwriting your source drive! Leaving the source mounted mitigates the risk of accidently blowing something important away. -Matt To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message