How-To: Leverage DRD on HP-UX to expand the root file system (vg00/lvol3) WITHOUT re-igniting a system.
DRD is highly effective in applying patches and making changes to the kernel and keeping a current working copy of the kernel, so if something does not work as expected a simple reboot and you are returned to pre-change state. DRD is a free tool supplied by HP and works on 11.23 and 11.31 servers.
The DRD clone can be used for other purposes as well, like extending lvol3 in vg00 without re-igniting the server. Here are the high level steps required, and most are basic lvm commands. In this illustration we are expanding lvol3, typically the root file system, although any file system in vg00 can be expanded using this technique.
In this example we are expanding lvol 3. The assumption is that it is nearing its size limitations and this example can be modified to any lvol in vg00.
If the original size disk/LUN is to be reused as the boot disk after the extend, then the extend would be limited by the number of free physical extents residing on this boot disk/LUN. If the extend is going to be larger then the available free extents, then a larger boot disk would have to be obtained and put in place before the DRD is cloned back to the boot disk.
First a DRD clone must be made to a disk or lun that is as large or larger than the primary boot disk. An additional second disk just makes it easier. We shall use disk8 for the DRD and disk 9 as the extra disk for this example.
The basic command to create a DRD is below:
# /opt/drd/bin/drd clone -vv -x overwrite=true -t /dev/disk/disk8 Do not activate nor reboot onto the newly created disk as this is the disk we will work with to extend vg00/lvol3.
Mount the DRD clone as a stand alone VG for access:
# mkdir /dev/drd00
# mknod /dev/drd00/group c 64 0x0X0000
==> X is selected from available vg unique numbers.
# vgimport /dev/drd00 /dev/disk/disk8
Verify that the mount point has information:
# ll /dev/drd00
this should have the exact same listing as vg00.
Using an extra disk in the next step is very handy in keeping things straight. However, if the new LUN is large enough the same disk could be used as an intermediary storage space.
Using a different disk as a temporary storage for lvol 4:
# pvcreate -f /dev/rdisk/disk9
Activate the drd_clone_vg and vgextend the new disk into the drd_clone_vg:
# vgchange -a y /dev/drd00
# vgextend /dev/drd00 /dev/disk/disk9
Now we must move lvol4 to a free space. Here we will move it to the new disk:
# pvmove -n /dev/drd00/lvol4 /dev/disk/disk8 /dev/disk/disk9
to verify that all extents have been moved use the lvdisplay -v command:
# lvdisplay -v /dev/drd00/lvol4
Now the space on vg00 has been freed up immediately following lvol3 so we can accomplish the extending. Remember, lvol3 must be contiguous on an HPUX server. Extending lvol3 up to a maximum size equal to lvol3 plus lvol4 in number of extents. Then extend the file system to use this space.
# lvextend -l 250 /dev/drd00/lvol3
# extendfs -F vxfs /dev/drd00/lvol3
The lvol has been extended, now we clean up by moving lvol 4 back to the original DRD disk and reducing the temporary LUN.
# pvmove -n /dev/drd00/lvol4 /dev/disk/disk9 /dev/disk/disk8
# vgreduce /dev/drd00 /dev/disk/disk9
De-activate the VG and return to normal DRD status
# vgchange -a n /dev/drd00
# vgexport /dev/drd00
Activate the DRD to boot.
# /opt/drd/bin/drd activate -x reboot=true
Verify on boot that the size has been changed and booted off of disk8.
# strings /etc/lvmtab
This has moved your boot disk to the DRD copy. If you want to move back to the original disk just make a new DRD clone on it. Make no changes to the DRD side, activate and reboot. This would bring your server back to original boot disk with a larger lvol3.
“Every system configuration is unique. Beechglen can help you evaluate your exact configuration and requirements to help guide you through the exact steps required.”
A great resource for all HP-UX can be found at this location: http://wiki-ux.info/wiki/Main_Page