Cloning disk with dd

From: durgads@charteredsemi.com
Date: Tue Mar 11 2003 - 04:27:22 EST


Best Regards,
Shanker Durgad,
IT Infrastructure & Operations,
Chartered Semiconductor Manufacturing Ltd.
DID : 63601749

----- Forwarded by DURGAD Shanker/IT/CHRT/ST Group on 11/03/2003 05:32 PM
-----
DURGAD Shanker/IT/CHRT/ST Group 11/03/2003 05:25 PM
                                                                                                                                       
              To: sunmanagers@freehome.ch
              cc: sunmanagers@sunmanagers.org
              Subject: Re:Cloning disk with dd
                                                                                                                                       
                                                                                                                                       
                                                                                                                                       

[This e-mail is confidential and may also be privileged. If you are not the
intended recipient, please delete it and notify us immediately; you should
not copy or use it for any purpose, nor disclose its contents to any other
person. Thank you.]

Hi Andrea,

The other alternative solution is use ufsdump.

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

2) run newfs on /dev/rdsk/c1t0d1s0 disk and mount all file systems as "/mnt
                                                                            
 3) ufsdump 0f - / | ( cd /mnt ;ufsrestore xvf - )
 4) like this restore other all OS file systems
 5) installboot /usr/platform/`uname -i`/lib/fs/ufs/pboot
 /usr/platform/`uname -i`/lib/fs/ufs/bootblk /dev/rdsk/c1t0d1s2
                                                                            

Best Regards,
Shanker Durgad,
IT Infrastructure & Operations,
Chartered Semiconductor Manufacturing Ltd.
DID : 63601749
-----------------------------------------------------------------------
Message: 1
From: "sunmanagers freehome.ch" <sunmanagers@freehome.ch>
To: <sunmanagers@sunmanagers.org>
Subject: Cloning disk with dd
Date: Tue, 11 Mar 2003 00:22:45 +0100
Organization: Privat

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
the run newfs on /dev/rdsk/c1t0d1s0 disk and mount all file systems as
"/mnt

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

[This e-mail is confidential and may also be privileged. If you are not the
intended recipient, please delete it and notify us immediately; you should
not copy or use it for any purpose, nor disclose its contents to any other
person. Thank you.]
_______________________________________________
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