Search This Blog

Thursday, May 5, 2011

DRD Root Disk Cloning (Dynamic Root Disk)

It is used while patching the system so that there would not be effect on the orginal root file system:

In this secion, you will check if DRD is installed, identify the disks to do the clone and create a clone of the active system image.

Verify installation of DRD clone software

Check if the DRD software is installed


# swlist –l product DynRootDisk
# Initializing...
# contacting target "rx26-207"...
#
# Target: rx26-207:/
#
# DynRootDisk A.1.1.0.344 Dynamic Root Disk
  DynRootDisk.DRD A.1.1.0.344 Dynamic Root Disk

Identify the available disks in the system

Identify boot and spare disks

# ioscan -fknC disk
Class I H/W Path Driver S/W State H/W Type Description
============================================================================
disk 0 0/0/2/0.0.0.0 sdisk CLAIMED DEVICE TEAC DV-28E-C
/dev/dsk/c0t0d0 /dev/rdsk/c0t0d0
disk 1 0/1/1/0.0.0 sdisk CLAIMED DEVICE HP 73.4GST373453LC
/dev/dsk/c2t0d0 /dev/rdsk/c2t0d0
disk 2 0/1/1/0.1.0 sdisk CLAIMED DEVICE HP 73.4GST373453LC
/dev/dsk/c2t1d0 /dev/dsk/c2t1d0s2 /dev/rdsk/c2t1d0 /dev/rdsk/c2t1d0s2
/dev/dsk/c2t1d0s1 /dev/dsk/c2t1d0s3 /dev/rdsk/c2t1d0s1 /dev/rdsk/c2t1d0s3
disk 3 0/1/1/1.2.0 sdisk CLAIMED DEVICE HP 73.4GST373453LC
/dev/dsk/c3t2d0 /dev/rdsk/c3t2d0

For LVM, use the following commands to identify the root disk and an unused disk which can be used for cloning the root disk.

Display the root disk in vg00 by the following command.

# vgdisplay –v /dev/vg00|grep "PV Name"
PV Name /dev/dsk/c2t1d0s2

Execute the pvdisplay command on the disk to see if it is part of LVM

# pvdisplay –l /dev/dsk/c2t1d0s2
/dev/dsk/c2t1d0s2:LVM_Disk=yes

This is the disk which is used in vg00, this is the root disk.

Execute the pvdisplay command on the second disk and find out if it is part of LVM; if it’s not, we can use it for cloning.

# pvdisplay -l /dev/dsk/c2t0d0
/dev/dsk/c2t1d0:LVM_Disk=no


This disk is not part of a volume group and available to us for cloning.
For VxVM manager disks, you can use the following command to identify the unused disk which can be used for cloning the root disk.

# vxdisk –o alldgs list

Check the size of the target disk by using the preview option to the drd clone command. The preview option –p to the drd command performs analysis and reports errors without executing the command.
The target disk must be large enough to contain all file system in the active system image root volume group, which might be on multiple disks.

# drd clone -p -v -t /dev/dsk/c2t0d0
======= 07/26/07 19:29:07 EDT BEGIN Clone System Image Preview (user=root) (jobid=rx26-207)
* Reading Current System Information
* Selecting System Image To Clone
* Selecting Target Disk
* Selecting Volume Manager For New System Image
* Analyzing For System Image Cloning
======= 07/26/07 19:29:16 EDT END Clone System Image Preview succeeded. (user=root) (jobid=rx26-207)

Clone the root disk using DRD clone

Clone the root volume. Specify the block device of the target disk; for example, /dev/dsk/c2t0d0
This may take about 30 minutes

# drd clone -v -t /dev/dsk/c2t0d0
======= 07/26/07 19:30:03 EDT BEGIN Clone System Image (user=root) (jobid=rx26-207)
* Reading Current System Information
* Selecting System Image To Clone
* Selecting Target Disk
* Selecting Volume Manager For New System Image
* Analyzing For System Image Cloning
* Creating New File Systems
* Copying File Systems To New System Image
* Making New System Image Bootable
* Unmounting New System Image Clone
======= 07/26/07 19:56:46 EDT END Clone System Image succeeded. (user=root) (jobid=rx26-207)

Examine the log for successful clone creation

# more /var/opt/drd/drd.log
======= 07/26/07 19:30:03 EDT BEGIN Clone System Image (user=root)
(jobid=rx26-207)
* Reading Current System Information
* Selecting System Image To Clone
* Selecting Target Disk
* Selecting Volume Manager For New System Image
* Analyzing For System Image Cloning
* Creating New File Systems
* Copying File Systems To New System Image
* Making New System Image Bootable
* Unmounting New System Image Clone
* System image: "sysimage_001" on disk "/dev/dsk/c2t0d0"
======= 07/26/07 19:56:46 EDT END Clone System Image succeeded. (user=root)
(jobid=rx26-207)

Mount the inactive system image (clone) using the drd mount command so we can make a file system comparison for the vg00 and drd00.

# drd mount
======= 07/26/07 19:59:44 EDT BEGIN Mount Inactive System Image (user=root) (jobid=rx26-207)
* Checking for Valid Inactive System Image
* Locating Inactive System Image
* Mounting Inactive System Image
======= 07/26/07 19:59:57 EDT END Mount Inactive System Image succeeded. (user=root) (jobid=rx26-207)

Verify the effect of cloning using the vgdisplay command; after the successful cloning you will see a drd00 volume group created in the system. Verify using the following command.

# vgdisplay –v
--- Volume groups ---
VG Name /dev/vg00
VG Write Access read/write
VG Status available
.
.
.
--- Physical volumes ---
PV Name /dev/dsk/c2t1d0s2
PV Status available
Total PE 4318
Free PE 2756
Autoswitch On
VG Name /dev/drd00
VG Write Access read/write
VG Status available
Max LV 255
Cur LV 8
Open LV 8
Max PV 16
Cur PV 1
Act PV 1
.
.
.
--- Physical volumes ---
PV Name /dev/dsk/c2t0d0s2
PV Status available
Total PE 4318
Free PE 2756
Autoswitch On

Check the system for comparison using the bdf command.
# bdf
Filesystem kbytes used avail %used Mounted on
/dev/vg00/lvol3 524288 322416 200304 62% /
/dev/vg00/lvol1 589824 151288 435216 26% /stand
/dev/vg00/lvol8 4718592 1797872 2897944 38% /var
/dev/vg00/lvol7 5947392 2646648 3275024 45% /usr
/dev/vg00/lvol4 524288 17232 503232 3% /tmp
/dev/vg00/lvol6 4374528 3765016 604864 86% /opt
/dev/vg00/lvol5 524288 16696 503632 3% /home
/dev/drd00/lvol3 524288 321728 201000 62% /var/opt/drd/mnts/sysimage_001
/dev/drd00/lvol5 524288 16696 503632 3% /var/opt/drd/mnts/sysimage_001/home
/dev/drd00/lvol6 4374528 3765832 603984 86% /var/opt/drd/mnts/sysimage_001/opt
/dev/drd00/lvol1 589824 151224 435216 26% /var/opt/drd/mnts/sysimage_001/stand
/dev/drd00/lvol4 524288 16832 503496 3% /var/opt/drd/mnts/sysimage_001/tmp
/dev/drd00/lvol7 5947392 2645336 3276328 45% /var/opt/drd/mnts/sysimage_001/usr

The clone is mounted on /var/opt/drd/mnts/sysimage_001
Unmount the image

# drd umount
======= 07/26/07 19:57:44 EDT BEGIN Unmount Inactive System Image (user=root) (jobid=rx26-207)
* Checking for Valid Inactive System Image
* Locating Inactive System Image
* Unmounting Inactive System Image
======= 07/26/07 19:57:57 EDT END Mount Inactive System Image succeeded. (user=root) (jobid=rx26-207)

Activate the Clone System Image

In this section, you will note the current boot path and activate the inactive system image.

Activate the clone root disk


Verify the boot path

# setboot –v

Primary bootpath : 0/1/1/0.1.0
HA Alternate bootpath : <none>
Alternate bootpath : 0

Activate the inactive system image with the command drd activate. This command modifies stable storage to indicate that the inactive system image should become the active system image when the system boots. It activates the image and reboots the system immediately if the reboot=true flag is supplied on the command line. After the reboot, the formerly inactivate system image is the active system image and the formerly active system image becomes inactive.

# drd activate -x reboot=true

======= 07/26/07 20:17:55 EDT BEGIN Activate Inactive System Image (user=root) (jobid=rx26-207)
* Checking for Valid Inactive System Image
* Reading Current System Information
* Locating Inactive System Image
* Determining Bootpath Status
* Primary bootpath : 0/1/1/0.1.0 [/dev/dsk/c2t1d0] before activate.
* Primary bootpath : 0/1/1/0.0.0 [/dev/dsk/c2t0d0] after activate.
* Alternate bootpath : 0 [unknown] before activate.
* Alternate bootpath : 0 [unknown] after activate.
* HA Alternate bootpath : <none> [] before activate.
* HA Alternate bootpath : <none> [] after activate.
* Activating Inactive System Image
* Rebooting System
SHUTDOWN PROGRAM
07/26/07 20:18:11 EDT
Broadcast Message from ??? (???) Thu Jul 26 20:18:11...
SYSTEM BEING BROUGHT DOWN NOW !! !
/sbin/auto_parms: DHCP access is disabled (see /etc/auto_parms.log)
System shutdown in progress

Stopping the Virtual Network Computing (VNC) .................... OK
Stop Highly Available cluster ................................... N/A
Stopping Control Daemon ......................................... N/A
Stopping OVTrcSrv... ............................................ OK
Stop CDE login server ........................................... OK
Stop kwdbd ...................................................... N/A
Stopping HP-UX Apache-based Web Server .......................... OK
Stopping HP-UX Tomcat-based Servlet Engine. ..................... N/A
Stopping HP-UX Webmin-based Admin ............................... OK
Stopping the HPUX Webproxy subsystem ............................ OK
Stopping HP-UX XML Web Server Tools ............................. OK
Stop X print server(s) .......................................... N/A
Stop NFS server subsystem ....................................... OK
Shutting down CIFS Client ....................................... N/A
Stopping Event Monitoring Service ............................... OK
Shutting down the Winbind Daemon ................................ OK
Unload/Uninstall XF86 DLKM Helper Modules ....................... OK
Stopping the gWLM Agent ......................................... OK
Stop Workload Manager subsystem ................................. OK
Reset PRM and shut down PRM daemons ............................. OK
Shutting down the System Management HomePage server ............. OK
Shutting down OVPA performance software .........................
Value of TERM has been set to "xterm".
WARNING: YOU ARE SUPERUSER !!

Verify the boot path of the booted system again

# setboot -v

Primary bootpath : 0/1/1/0.0.0
HA Alternate bootpath : <none>
Alternate bootpath : 0

Mount the inactive system image (clone) using the drd mount command so we can make a physical volume comparison for the vg00 and drd00.

# drd mount

======= 07/26/07 20:10:15 EDT BEGIN Mount Inactive System Image (user=root) (jobid=rx26-207)
* Checking for Valid Inactive System Image
* Locating Inactive System Image
* Mounting Inactive System Image
======= 07/26/07 20:10:15 EDT END Mount Inactive System Image succeeded. (user=root) (jobid=rx26-207)

Verify the effect of booting the clone using the vgdisplay command.

# vgdisplay –v
--- Volume groups ---
VG Name /dev/vg00
VG Write Access read/write
VG Status available
.
.
.
--- Physical volumes ---
PV Name /dev/dsk/c2t0d0s2
PV Status available
Total PE 4318
Free PE 2756
Autoswitch On
VG Name /dev/drd00
VG Write Access read/write
VG Status available
Max LV 255
Cur LV 8
Open LV 8
Max PV 16
Cur PV 1
Act PV 1
.
.
.
--- Physical volumes ---
PV Name /dev/dsk/c2t1d0s2
PV Status available
Total PE 4318
Free PE 2756
Autoswitch On

Compare the output with the previous output

When a clone created by drd clone command is activated and booted, the formerly inactive system image becomes active image and the formerly active system image become inactive, any inactive system image can be manipulated using drd safe commands, drd runcmd, drd mount, drd umount. The now inacitive original system is mount under /var/opt/drd/mnts/sysimage_000.

No comments:

Post a Comment