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=/dev/zero of=/dev/ad1 bs=512 count=32
# 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 
/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  ([EMAIL PROTECTED])              
Sentex Communications Corp,             
Waterloo, Ontario, Canada
"Given enough time, 100 monkeys on 100 routers 
could setup a national IP network." (KDW2)

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to