Cloning disk with dd

From: sunmanagers freehome.ch (sunmanagers@freehome.ch)
Date: Mon Mar 10 2003 - 18:22:45 EST


Hi Sunmanagers

Now I would like to clone a bootable disk to another disk that after the
cloning the new disk would be also bootable and includes all information
from all slices like the original disk (absolutly identical). Now I was
looking in doc.sun.com and also in sunmanagers archiv and found several
information about dd. Now first question; for that what I would like to do
is the dd command the right way? Second question would be.... if dd is the
correct way is the following the correct way:

The disk involved are:

        c1t0d0 Source disk
        c1t0d1 Cloning disk
        c1t2d0 working disk

The working disk means a disk which I can boot and set the command for
cloning the source disk to the cloning disk. It means the source and cloning
disk are not active! I now it can be also done by booting cdrom in single
user mode but anyway I have this third disk with an OS installed on it.....

All below commands where done on the third disk!

First I prepare the cloning disk that this disk haves absolutly the same
layout like the source disk:

        # prtvtoc /dev/rdsk/c1t0d0s0 > /tmp/z
        # fmthard -s /tmp/z /dev/rdsk/c1t0d1s0

Controlling over the command format if it is so:

        Part Tag Flag Cylinders Size Blocks
          0 root wm 0 - 634 471.29MB (635/0/0)
965200
          1 var wm 635 - 2014 1.00GB (1380/0/0)
2097600
          2 backup wm 0 - 2732 1.98GB (2733/0/0)
4154160
          3 swap wu 2015 - 2704 512.11MB (690/0/0)
1048800
          4 unassigned wm 2705 - 2718 10.39MB (14/0/0)
21280
          5 unassigned wm 2719 - 2732 10.39MB (14/0/0)
21280
          6 unassigned wm 0 0 (0/0/0)
0
          7 unassigned wm 0 0 (0/0/0)
0

Set now the comand "dd" for each slice with blocksize 64k

        # dd if=/dev/rdsk/c1t0d0s0 of=/dev/rdsk/c1t0d1s0 bs=64k
7540+1 records in
7540+1 records out

        # dd if=/dev/rdsk/c1t0d0s1 of=/dev/rdsk/c1t0d1s1 bs=64k
16387+1 records in
16387+1 records out

        # dd if=/dev/rdsk/c1t0d0s2 of=/dev/rdsk/c1t0d1s2 bs=64k
32454+1 records in
32454+1 records out

        # dd if=/dev/rdsk/c1t0d0s3 of=/dev/rdsk/c1t0d1s3 bs=64k
8193+1 records in
8193+1 records out

        # dd if=/dev/rdsk/c1t0d0s4 of=/dev/rdsk/c1t0d1s4 bs=64k
166+1 records in
166+1 records out

        # dd if=/dev/rdsk/c1t0d0s5 of=/dev/rdsk/c1t0d1s5 bs=64k
166+1 records in
166+1 records out

fsck /dev/rdsk/c1t0d1s0 (and also for all other slices)

The fsck comand gives me no error back....

No error occours! Now I'm booting the cloned disk with the option -r (rescan
for reconfigure). A lot of errors occurs like slice 0 is not OK mounting not
possible. At the end a login is not possible because the OS boots not
correctly. What did I not correct...is it the blocksize? Would you suggest
other options? If any information I forgot please mail me what you would
like to now....Will summary....

Kind regards

Andrea
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:25:58 EDT