I have an old 73gb SAS SCSI drive, so I plugged in a new 73gb SAS SCSI and I want to clone everything from it to the new drive..
I want to clone SCSI hard drive SD20 to SD21.
Is there an easy way to accomplish this in Solaris? I am a Red Hat Linux guy. I am not familiar with Solaris.
If this cannot be done, then I must clone that actual data on that drive..
When I run format I get this:
0. c1t0d0 <SUN36G cyl 24620 alt 2 hd 27 sec 107>
/pci@8,600000/SUNW,qlc@4/fp@0,0/ssd@w21000020378deaf4,0
1. c1t1d0 <SUN36G cyl 24620 alt 2 hd 27 sec 107>
/pci@8,600000/SUNW,qlc@4/fp@0,0/ssd@w21000004cf22de9f,0
2. c2t5d0 <QUANTUM-ATLAS10K3_73_WLS-020W cyl 31014 alt 2 hd 8 sec 579>
/pci@8,700000/scsi@6,1/sd@5,0
3. c2t6d0 <QUANTUM-ATLAS10K3_73_WLS-020W cyl 31014 alt 2 hd 8 sec 579>
/pci@8,700000/scsi@6,1/sd@6,0
I believe that 2 is the old drive (that I want to clone from) and 3 is the new drive (that I want to clone to)
When I look at the partition map (verify) for 2, I get:
Part Tag Flag Cylinders Size Blocks
0 unassigned wm 0 0 (0/0/0) 0
1 unassigned wm 0 0 (0/0/0) 0
2 backup wu 0 - 31013 68.50GB (31014/0/0) 143656848
3 unassigned wm 0 0 (0/0/0) 0
4 unassigned wm 0 - 11318 25.00GB (11319/0/0) 52429608
5 unassigned wm 11319 - 31013 43.50GB (19695/0/0) 91227240
6 unassigned wm 0 0 (0/0/0) 0
7 unassigned wm 0 0 (0/0/0) 0
When I look at the partition map (verify) for 3, I get:
Part Tag Flag Cylinders Size Blocks
0 root wm 0 - 56 128.92MB (57/0/0) 264024
1 swap wu 57 - 113 128.92MB (57/0/0) 264024
2 backup wu 0 - 31013 68.50GB (31014/0/0) 143656848
3 unassigned wm 0 0 (0/0/0) 0
4 unassigned wm 0 0 (0/0/0) 0
5 unassigned wm 0 0 (0/0/0) 0
6 usr wm 114 - 31013 68.25GB (30900/0/0) 143128800
7 unassigned wm 0 0 (0/0/0) 0
Output of df -k command:
Filesystem kbytes used avail capacity Mounted on
/dev/md/dsk/d1 5040814 2947078 2043328 60% /
/proc 0 0 0 0% /proc
fd 0 0 0 0% /dev/fd
mnttab 0 0 0 0% /etc/mnttab
/dev/md/dsk/d3 5040814 1959374 3031032 40% /var
swap 6968984 24 6968960 1% /var/run
swap 6969040 80 6968960 1% /tmp
/dev/md/dsk/d7 25815139 4844450 20712538 19% /d001
/dev/md/dsk/d8 44918294 21617527 22851585 49% /d002
/dev/md/dsk/d4 5040814 3897382 1093024 79% /opt
I believe, based upon the partition map of 2 (above) that /d001 and /d002 are the only partitions mounted from the old disk (that I want to clone from).
If I cannot directly clone the hard drives than maybe I can create the partition map on 3 to be the same as 2 and copy data from /d001 and /d002 to the new drive, which leads me to my biggest question: HOW CAN I VERIFY THAT /d001 and /d002 are the ONLY THING MOUNTED FROM THE OLD DRIVE?!
Best Answer
For some reason, c2t5d0s4 (/d001) and c2t5d0s5 (/d002) are set up as one-way mirrors in SDS. Perhaps someone forgot to
metattach
another disk at some point?To accomplish what you want, there are two methods.
Method 1
As you suggest,
dd
could be used. I would first verify that you don't need the data on c2t6d0s6 by mounting it and reviewing the filesystem contents.You also have two small partitions at the start of the disk. Check with
metadb
that these aren't required by SDS. If they are listed and there are partitions on the other disks in the metadb, remove them:Then you will be able to use
dd
to clone:Method 2
As you already have SDS configured you can use this to complete the mirrors.
First you need to copy the partition table:
Then create metadevices:
Then attach these do the existing mirrors:
Warning: metadevice d71 already has errors logged against it by SDS and has been placed into maintenance. It might refuse to copy this partition.
Periodically check that the mirrors are syncing:
You'll get a progress next to each submirror that is rebuilding. The
State:
field will say Okay once rebuilding has finished.Removing the old drive
Disconnect each partition that is mirrored.
I can't remember if Solaris 8 has
cfgadm
or not, but if it does, run:to check which device you want to remove (probably c2::dsk/c2t5d0), then unconfigure it:
It will then be safe to remove it.
Simple: They're the only partitions on the disk. (Slice 2 is the whole disk, not an actual usable partition.)