[buug] Cloning BSD hard drive

Skip Evans evans at ncseweb.org
Sat Dec 7 17:02:13 PST 2002


Hi all,

I'm in the office today trying to learn how to clone a BSD drive. I've 
got the first machine I installed BSD on for practice, an old 166 mhz
Pentium, and I'm just trying to clone that one to figure out how
to do this before I try anything on our live machine.

I tracked down the script below and am trying to use it. I have
the second drive plugged into the last connector on the end
of the IDE controller, right past the connector for the master
drive. I have the jumpers set so that the existing drive is the master
and the new one (to be cloned) is the slave.

However, when the script runs I can only hear the master drive
heads moving around and the screen just scrolls with lots of
"file already exists" kinds of messages.

Any ideas what I'm doing wrong? I emailed with the author
of this script and he seems to think that it is fine.
-----------------
#!/bin/sh

#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 -R ad1s1 /root/10g-disk
#load in editor to make sure it looks reasonable and give pause
/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 600 -f - / | ( cd /mnt-root ; restore -rf - )
cd /usr ; dump -0 -b 600 -f - /usr | ( cd /mnt-usr ; restore -rf - )
cd /var ; dump -0 -b 600 -f - /var | ( cd /mnt-var ; restore -rf - )
--------------------------------------------------------------------


Skip Evans
Network Project Director
National Center for Science Education
420 40th St, Suite 2
Oakland, CA 94609
510-601-7203 Ext. 308
510-601-7204 (fax)
800-290-6006
evans at ncseweb.org
 http://www.ncseweb.org

NCSE now has a one way broadcast news list. Please note that 
this is NOT a discussion list. You cannot post messages for members
 to receive. We use this list to broadcast news about the 
creationism/evolution issue to interested parties.

To sign up send:
subscribe ncse your at email.address.here
to: majordomo at ncseweb2.org

To unsubscribe send:         
unsubscribe ncse your at email.address.here
to: majordomo at ncseweb2.org





More information about the buug mailing list