Background methodology and approach to UNIX disk
cloning:
After the power cycle worked I was able to boot of off the
default system disk without any problems.
1) Performed an immediate Level 0 Dump of the system disk.
My system disk contains the following partitions
/, swap, /usr, /usr/openwin, /var, and
/export
/opt and /var/mail
are on a separate disk for just
this purpose.
2) Shutdown the system and booted my redundant disk.
The redundant disk is /dev/dsk/c0t1d0s0.
For MY prom mode I simply had to type boot disk1
I seem to recall having to set up this disk1 alias
a while ago, I do not think it is a standard default
Solarisism.
The steps for creating the NVRAM or PROM alias
are detailed at the prom level. But in case
you cannot set up an alias you should be able to
just do the following
boot
/iommu/sbus/espdma@4,8400000/esp@4,8800000/sd@X,0:a
Where 'X' is the SCSI ID of the redundant boot disk.
Likewise, this is the setting for a disk off of SCSI
controller 0.
3) 'ok> boot disk1 -s' and determined I was running Solaris 2.3
Hm...that's kind of out of date so I decided to try running
off of the system disk again (/dev/dsk/c0t3d0s0)
4) From the system disk I ran the format command and then
partitioned my redundant disk /dev/dsk/c0t1d0sX with
partitions of the exact same size.
5) newfs'd each of the new partitions.
6) Installed a boot block with the following command:
/usr/platform/'/usr/sbin/uname
-i'/lib/fs/ufs/bootblk \
/dev/rdsk/c0t1d0s0
/usr/sbin/uname -i responds with the correct platform.
7) Then I did the following:
mount /dev/dsk/c0t1d0s0 /mnt/junk
** /usr/sbin/ufsdump 0f - /dev/rdsk/c0t3d0s0 | \
(cd /mnt/junk; ufsrestore xf - )
**This command comes from the Solaris 2.5.1 man page for
ufsrestore.
I repeated step 7 for EACH of my file systems on my primary
system disk:
/, /usr, /var, /usr/openwin, /export
8) fsck'd each of the NEW file systems after the dump/restore.
9) Mounted /dev/dsk/c0t1d0s0 /mnt/etc and modified
the necessary entries in /mnt/etc/vfstab.
These modifications are necessary to point to the new
swap areas and system disk partitions. If you can do
one substitution then replace /dev/dsk/c0t3d0 with
/dev/dsk/c0t1d0 ****
*** Remember we are changing TWO entries per line.
The device and the RAW device. (I almost forgot)
10) Shut-down the system and then booted disk1
The system came up without a glitch although I'm not sure
some of the permissions are correct in the / (root) partition.
Alternative method:
If my system disk NEVER responded I would have been forced to
do the following:
1) Boot cdrom
2) Choose /dev/dsk/c0t1d0sX as the system install disk.
3) Refer to my printed out hardcopy of the system
configuration. To dupe the disk layout.
(Good Sys Admins have one... :0) You do too don't you
?!!)
The hard copy print outs have the partition sizes, what
each partition correlates to as a file system. And
contains
the starting and ending sector/cylinder for each partition.
4) Install Solaris 2.5.1
5) Refer to my hardcopy PATCH print out regarding what patches
are installed.
6) Download and install the necessary patches.
7) Install any local software. (read Sun Compilers and FDDI driver)
8) Install any necessary Software patches.
9) Re-install Legato Networker base.
10) Restore data through Legato Networker
from the backup archive.
11) Read through list of local
customizations :0)
and duplicate where necessary.
12) Test setup to make sure everything is
functional.
Enclosed Responses:
Dave Haut Wrote:
Hi,
You are on the right track. Use ufsdump piped to ufsrestore.
Example:
# mount /dev/dsk/c0t0d0sx /mnt ( mount one of
the old Sol2.3 partitions )
# cd /mnt
# ufsdump 0f - /dev/dsk/sol2.5.1part | ufsrestore vrf -
Also, You DO need to install the bootblock.
Check out the man page for installboot and use the example that is provided.
A great Script for cloning a UNIX drive
#!/sbin/sh
#
# Clone of the operating system from c0t0d0s0
# to c0t1d0s0
# point from /mnt to /clone.
# define variables
#
primaryosdisk="/dev/rdsk/c0t0d0s0"
secondaryosdisk="/dev/rdsk/c0t1d0s0"
blockdevicename="/dev/dsk/c0t1d0s0"
mountpoint="/clone"
export primaryosdisk secondaryosdisk mountpoint blockdevicename
#
# Newfs the drive before dumping the OS.
/usr/sbin/newfs /dev/rdsk/c0t1d0s0 << EOF
y
EOF
/usr/sbin/fsck -y /dev/rdsk/c0t1d0s0
# mount the secondary O/S disk onto temporary mount point
#
#
mount $blockdevicename $mountpoint
#
# Dump the primary O/S disk to the secondary O/S disk
#
ufsdump 0f - $primaryosdisk | (cd $mountpoint; ufsrestore rf - )
#
# Install the boot block
# Sun 4m architecture only!
#
/usr/sbin/installboot /usr/platform/sun4u/lib/fs/ufs/bootblk $secondaryosdisk
#
rm $mountpoint/restoresymtable
umount $mountpoint