From owner-freebsd-questions@FreeBSD.ORG Mon Feb 22 15:04:03 2010 Return-Path: Delivered-To: questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1E2FC1065679 for ; Mon, 22 Feb 2010 15:04:03 +0000 (UTC) (envelope-from jerrymc@gizmo.acns.msu.edu) Received: from gizmo.acns.msu.edu (gizmo.acns.msu.edu [35.8.1.43]) by mx1.freebsd.org (Postfix) with ESMTP id CF4C78FC17 for ; Mon, 22 Feb 2010 15:04:02 +0000 (UTC) Received: from gizmo.acns.msu.edu (localhost [127.0.0.1]) by gizmo.acns.msu.edu (8.13.6/8.13.6) with ESMTP id o1MEuQmt043863; Mon, 22 Feb 2010 09:56:26 -0500 (EST) (envelope-from jerrymc@gizmo.acns.msu.edu) Received: (from jerrymc@localhost) by gizmo.acns.msu.edu (8.13.6/8.13.6/Submit) id o1MEuITw043862; Mon, 22 Feb 2010 09:56:18 -0500 (EST) (envelope-from jerrymc) Date: Mon, 22 Feb 2010 09:56:18 -0500 From: Jerry McAllister To: Aiza Message-ID: <20100222145618.GD43687@gizmo.acns.msu.edu> References: <4B82416B.7050001@comclark.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4B82416B.7050001@comclark.com> User-Agent: Mutt/1.4.2.2i Cc: freebsd-questions Subject: Re: Dump/restore to clone disk 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: Mon, 22 Feb 2010 15:04:03 -0000 On Mon, Feb 22, 2010 at 04:33:47PM +0800, Aiza wrote: > I have seen this posted in the questions archives to be > used to clone a active system hard drive to a > USB cabled hard drive. > > > > Prepare the target > #dd if=/dev/zero of=/dev/da0 count=2 > # fdisk -BI /dev/da0 > # bsdlabel -B -w da0s1 > # newfs ?U /dev/da0s1a # / > # newfs -U /dev/da0s1d # /var > # newfs -U /dev/da0s1e # /tmp > # newfs -U /dev/da0s1f # /usr > > Mount target file system ?a? > # mount /dev/da0s1a /mnt > # cd /mnt > # dump -0Lauf - /dev/ad1s1a | restore -rf - > # cd / > # umount /mnt > > Mount target file system ?d? > # mount /dev/da0s1d /mnt > # cd /mnt > # dump -0Lauf - /dev/ad1s1d | restore -rf - > # cd / > # umount /mnt > > Mount target file system ?e? > # mount /dev/da0s1e /mnt > # cd /mnt > # dump -0Lauf - /dev/ad1s1e | restore -rf - > # cd / > # umount /mnt > > Mount target file system ?f? > # mount /dev/da0s1f /mnt > # cd /mnt > # dump -0Lauf - /dev/ad1s1f | restore -rf - > # cd / > # umount /mnt > > > I have questions about this method. Some of these questions sound like you have not been studying the documentation as you should. People on this list will quickly lose patience if you do not do your own homework before asking questions. There is nothing so futile as trying to trying to explain something to someone who has not done their homework. > > What happened to swap? The fstab will be showing it as > the first file system on the hard drive slice. > Is something missing here? Swap is never backed up. It makes no sense to back up swap. It is just scratch space used by the OS and completely irrelevant to any other system. Try looking in to the documentation. > > What about the file system sizes. > Will the restored hard drive have the same > file system sizes as the source file system? Read the documentation. They will have the same size as what you make them. Dump/restore do no create filesystems. They just back up and restore data withing filesystems. You create the partitions yourself. A filesystem is an identifiable - most likely a partition, could be a whole disk, that has had newfs run on it to create a filesystem structure and then mounted to some mount point you have created with mkdir. > Is there some way to allocate larger file systems > on the target without using sysinstall to prepare > the target beforehand? Yes, you use fdisk and bsdlabel and finally newfs. But, you cannot do this willy-nilly on a disk that is already in use. This is well documented. > > Is there some command to display > the file system allocation size? > Oh come on. This is all over the documentation. Try: df -k There are lots of other ways you can look up too. ////jerry > > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org" >