Académique Documents
Professionnel Documents
Culture Documents
as of: 12/22/2010
This article describes a method that will successfully “break” (copy) the vg00
volume group prior to doing system significant changes (such as patching).
NOTES:
For all versions of HP-UX, to create an alternate boot disk there must be N
free disks (where N = the number of PVs currently in vg00).
2. If necessary, initialize the alternate disk for use as a bootable LVM disk:
# pvcreate –Bf /dev/rdsk/c0t5d0
b. Make /dev/vgroot:
# mkdir /dev/vgroot
c. Check the permissions of the new directory. They should be 640.
Correct if necessary.
d. Make the “group” character device file using the minor number
selected above:
# mknod /dev/vgroot/group c 64 0x020000
8. Determine the lvol sizes in vg00. Use this information in the next step
(lvcreate). For example:
# vgdisplay -v vg00|egrep "LV Name|LV Size"
LV Name /dev/vg00/lvol1
LV Size (Mbytes) 320
LV Name /dev/vg00/lvol2
LV Size (Mbytes) 2048
LV Name /dev/vg00/lvol3
LV Size (Mbytes) 3460
9. Create and extend the root logical volume and the swap logical volume
(you will need to customize the sizes): (-C = contiguous; “-r n” = turn
off bad block relocation)
(Reminder, lvol1 is usually “/stand”, lvol2 is usually swap/dump, lvol3
is usually “/” (root))
# lvcreate -L 320 -C y –r n -n bootlvol /dev/vgroot
# lvcreate -L 2048 -C y –r n -n swaplvol /dev/vgroot
# lvcreate -L 3460 -C y –r n -n rootlvol /dev/vgroot
10. Create all other root disk logical volumes as needed. For example, a
200-Mb lvol5:
# lvcreate -L 200 -n lvol4 /dev/vgroot
11. Update the BDRA (Boot Disk Reserved Area) with the new information
for boot, root, swap and dump logical volumes:
# lvlnboot -b bootlvol /dev/vgroot # this is /stand lvol
# lvlnboot -r rootlvol /dev/vgroot # this is root "/" lvol
# lvlnboot -s swaplvol /dev/vgroot # this is swap lvol
# lvlnboot -d swaplvol /dev/vgroot # this is the default dump lvol
# lvlnboot –v # verify
Examples:
# newfs -F hfs /dev/vgroot/rbootlvol
# newfs -F vxfs /dev/vgroot/rrootlvol
# newfs -F vxfs /dev/vgroot/rlvol4
14. Mount any needed system file systems that are no longer
mounted. For example, to mount /usr:
# mount /usr
15. Create a mount point for the new stand logical volume and
mount it:
# cd /
# mkdir /newstand
# mount /dev/vgroot/bootlvol /newstand
16. Copy over the entire original /stand directory to the new stand directory:
(-xdev = don't cross any file system mount points that exist below the starting point
-depth = traverse sub-directories
-print = current path name will be printed
-p = pass through
-x = store special files
-d = make directories
-u = unconditional copy
-m = preserve modification times
-v = verbose)
# cd /stand
# find . -xdev -depth -print | cpio -pxdumv /newstand
Mount all of the other logical volumes that will contain file systems, and copy over the
files. For example, if /dev/vg00/lvol4 mounted at /opt, then mount /dev/vgroot/lvol4 at
/newroot/opt and copy the files:
# mount /dev/vgroot/lvol4 /newroot/opt
# cd /opt
# find . -xdev -depth -print | cpio -pxdumv /newroot/opt
NOT Because of industry standards and interoperability goals, cpio
E: does not support the archival of files larger than 2 GB or files
that have user/group IDs greater than 60 K. For files > 2 GB use
a utility such as cp or fbackup/frecover.
17. Edit the /newroot/etc/fstab file to reflect the new bootable disks paths:
# vi /newroot/etc/fstab
Add the new root and device swap logical volume and the other logical volumes:
/dev/vgroot/rootlvol
/dev/vgroot/bootlvol
/dev/vgroot/lvol4
NOT Use the same options and syntax for the entries. There is no
E: entry for primary swap, just for device and file system swap.
18. Prepare the new lvol’s to be bootable:
# lvlnboot -r /dev/vgroot/rootlvol
# lvlnboot -b /dev/vgroot/bootlvol
# lvlnboot -s /dev/vgroot/swaplvol
# lvlnboot -d /dev/vgroot/swaplvol
# lvlnboot –R
# lvlnboot -v # to verify the results
If you are doing the above steps to begin using the “alternate disk” as the
new boot disk (perhaps because the original disk is failing or too small),
use the following steps to turn “vgroot” into “vg00”. Recall that LVM
knows that /dev/vgroot exists on c0t5d0, and both “vgroot” and “vg00”
exist.
# lvlnboot -r /dev/vg00/lvol3
# lvlnboot -b /dev/vg00/lvol1
# lvlnboot -s /dev/vg00/lvol2
# lvlnboot -d /dev/vg00/lvol2
# lvlnboot –R
# lvlnboot -v # to verify the results