August 27th, 2011, 11:37 PM
Your major problem, or one of them at least, is in the copying of the disk layout from source to target. Doing this is a good idea if the disks are the same, but doing so going from a 20GB disk to a 120GB disk means you end up with the second disk only being setup' to be 20GB. You can go back later and mess with the partitions to resize them, but tread carefully. It's been a while since I messed with disks in Solaris and I was wary even when I thought I knew what I was doing!
Whilst the script duplicates the disk layout from source to target it only copies whatever is mounted on sections 0 and 3 (root and usr I think are the defaults for those). Section 1 tends to be swap (generally don't copy that!), section 2 is 'whole disk' - great to backup entire disk if you are using dd or something similar, sections 4, 5, 6 and 7 - if used - would be for stuff like /var, /home (or /export/home), etc.
I have not used cpio a great deal, but that looks like it would deal with directories, so long as they are within the file system (partition) being copied.
If there are other mounted file systems on the source disk you'll want to include the section names in the variable SLICES.
The moon on the one hand, the dawn on the other:
The moon is my sister, the dawn is my brother.
The moon on my left and the dawn on my right.
My brother, good morning: my sister, good night.
-- Hilaire Belloc