From owner-freebsd-hackers Thu Oct 25 5:10:13 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from smtp1.sentex.ca (smtp1.sentex.ca [199.212.134.4]) by hub.freebsd.org (Postfix) with ESMTP id AD30137B40A for ; Thu, 25 Oct 2001 05:10:00 -0700 (PDT) Received: from chimp.simianscience.com (cage.simianscience.com [64.7.134.1]) by smtp1.sentex.ca (8.11.6/8.11.6) with SMTP id f9PC7Qk32601; Thu, 25 Oct 2001 08:07:26 -0400 (EDT) (envelope-from mike@sentex.net) From: Mike Tancsa To: mlsmith@mitre.org ("PSI, Mike Smith") Cc: hackers@freebsd.org Subject: Re: Duping a hard disk Date: Thu, 25 Oct 2001 08:07:26 -0400 Message-ID: <2svftt8jrro366houev51k52234dgft63e@4ax.com> References: In-Reply-To: X-Mailer: Forte Agent 1.8/32.548 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Tue, 23 Oct 2001 12:27:55 +0000 (UTC), in sentex.lists.freebsd.hackers you wrote: >But alas, I cannot find any procedures for doing this. Does anyone know >how to duplicate a master disk to a "new" slave disk??? It would REALLY >make my life much easier. Test it to make sure it works, but roughly the below for a master in ad0 and a target in ad1. This is on 4.x so you need to modify it for 3.x. #blow away all data one ad1 /bin/dd if=3D/dev/zero of=3D/dev/ad1 bs=3D512 count=3D32 # do the fdisk /sbin/fdisk -BI ad1 #create a bootable drive with disk label /sbin/disklabel -w -r -B ad1s1 auto #read in 10g disklable /sbin/disklabel ad0 > /root/my-master-disklab /sbin/disklabel -R ad1s1 /root/my-master-disklab #load in editor to make sure it looks reasonable /sbin/disklabel -e ad1s1 #newfs the slices /sbin/newfs /dev/rad1s1a /sbin/newfs /dev/rad1s1e /sbin/newfs /dev/rad1s1f #enable soft updates /sbin/tunefs -n enable ad1s1e /sbin/tunefs -n enable ad1s1f #mount them up=20 /sbin/mount -o async /dev/ad1s1a /mnt-root /sbin/mount /dev/ad1s1e /mnt-var /sbin/mount /dev/ad1s1f /mnt-usr #dump / restore them cd / ; dump -0 -b 200 -f - / | ( cd /mnt-root ; restore -rf - ) cd /usr ; dump -0 -b 200 -f - /usr | ( cd /mnt-usr ; restore -rf - ) cd /var ; dump -0 -b 200 -f - /var | ( cd /mnt-var ; restore -rf - ) ---Mike Mike Tancsa (mdtancsa@sentex.net) =09 Sentex Communications Corp, =09 Waterloo, Ontario, Canada "Given enough time, 100 monkeys on 100 routers=20 could setup a national IP network." (KDW2) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message