Adding a new disk to a HP-UX system that is using Veritas Volume Manager is not difficult. It does require some extra steps, but if you follow along there are no problems.
Note well that this discussion does not have anything to do with LVM whatsoever, and the use of the Veritas File System (VxFS) is a minor tangent – other filesytems (like HFS) can be used – but if you’re not using OnlineJFS (which is nearly all of VxFS and its capabilities), the question would be why?
First of all, the usual steps for adding a disk to HP-UX are necessary:
- Run
ioscan
to scan for the new disk and to allocate resources in the kernel for it. My actual favorite invocation for this command isioscan -fnC disk
- Next, run the
insf
command to create device files. I prefer to useioscan -eC disk
in this instance.
Now we add the disk to the Veritas Volume Manager. Run these commands:
vxdctl enable
vxdisk scandisks
At this point, there is now an additional disk available for use by vxvm but which is not a part of any disk groups yet.
To add the disk to a disk group, use vxdiskadm
and option 1. You can use "list" here to get the name of the unallocated disk. Enter the name of the disk and answer the prompts; in most cases you will want the default.
Now to extend a file system in the volume group to use the new disk, you have to figure the amount of space available to use. You can use the command vxdg -g diskgroup free
to find the free space in the disk group "diskgroup" - but this does not tell you the actual amount of space you can extend by; that is, it does not include striping and other restrictions - it only includes a flat number of unallocated blocks.
To get the amount of disk space you can grow a volume by, use the command vxassist -g diskgroup maxgrow volume
. This will give you the actual amounts (if it is possible to grow). Replace the diskgroup and volume with the actual names of your disk group and volume respectively.
To actually grow the filesystem, you can do the following:
vxresize -b -F vxfs -t mytag group 999999
Fill in with the appropriate information instead of mytag (a tag to identify background vxvm operations), instead of group (disk group), and instead of 999999 (use the max amount of growth - or other appropriate number - identified by the maxgrow operation).
VxVM is aware of VxFS, so resizing the volume will also resize the filesystem as well; it uses fsadm
in the case of OnlineJFS.