From owner-freebsd-questions@FreeBSD.ORG Mon Feb 22 08:33:55 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 CD77B1065679 for ; Mon, 22 Feb 2010 08:33:55 +0000 (UTC) (envelope-from aiza21@comclark.com) Received: from avmxsmtp3.comclark.com (avmxsmtp3.comclark.com [202.69.191.117]) by mx1.freebsd.org (Postfix) with ESMTP id 18E218FC16 for ; Mon, 22 Feb 2010 08:33:54 +0000 (UTC) Received: (qmail 5691 invoked by uid 89); 22 Feb 2010 08:14:24 -0000 Received: by simscan 1.3.1 ppid: 5674, pid: 5687, t: 0.0541s scanners: attach: 1.3.1 clamav: 0.91.2/m: Received: from unknown (HELO ?10.0.10.3?) (202.69.173.143) by avmxsmtp3.comclark.com with SMTP; 22 Feb 2010 08:14:24 -0000 Message-ID: <4B82416B.7050001@comclark.com> Date: Mon, 22 Feb 2010 16:33:47 +0800 From: Aiza User-Agent: Thunderbird 2.0.0.17 (Windows/20080914) MIME-Version: 1.0 To: freebsd-questions Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit Cc: Subject: 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 08:33:55 -0000 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. What happened to swap? The fstab will be showing it as the first file system on the hard drive slice. Is something missing here? What about the file system sizes. Will the restored hard drive have the same file system sizes as the source file system? Is there some way to allocate larger file systems on the target without using sysinstall to prepare the target beforehand? Is there some command to display the file system allocation size?