System Admin Mirrorvg without locking the volume group

When you run the mirrorvg command, you will (by default) lock the volume group it is run against. This way, you have no way of knowing what the status is of the sync process that occurs after mirrorvg has run the mklvcopy commands for all the logical volumes in the volume group. Especially with very large volume groups, this can be a problem.

The solution however is easy: Make sure to run the mirrorvg command with the -s option, to prevent it to run the sync. Then, when mirrorvg has completed, run the syncvg yourself with the -P option.

For example, if you wish to mirror the rootvg from hdisk0 to hdisk1:

# mirrorvg -s rootvg hdisk1

Of course, make sure the new disk is included in the boot list for the rootvg:

# bootlist -m normal hdisk0 hdisk1

Now rootvg is mirrored, but not yet synced. Run "lsvg -l rootvg", and you'll see this. So run the syncvg command yourself. With the -P option you can specify the number of threads that should be started to perform the sync process. Usually, you can specify at least 2 to 3 times the number of cores in the system. Using the -P option has an extra feature: there will be no lock on the volume group, allowing you to run "lsvg rootvg" within another window, to check the status of the sync process.

# syncvg -P 4 -v rootvg

And in another window:

# lsvg rootvg | grep STALE | xargs
STALE PVs: 1 STALE PPs: 73



source: https://unixhealthcheck.com/blog?id=316
Attachments
There are no attachments for this article.
Related Articles RSS Feed
How to Investigate a System Reboot
Viewed 4765 times since Mon, Jul 16, 2018
Creating Normal,Big,Scalable VG on AIX
Viewed 15400 times since Fri, Feb 1, 2019
AIX 7.2 running on my Macbook?
Viewed 12775 times since Mon, Jun 3, 2019
AIX, Red Hat, Security, System Admin↑ System-wide separated shell history files for each user and session
Viewed 2421 times since Fri, Apr 19, 2019
Online Backups and Recovery in a Snap AIX
Viewed 5377 times since Wed, May 30, 2018
AIX Cloning a rootvg using alternate disk installation
Viewed 11841 times since Sun, Jun 30, 2019
Script to make mksysb backup from NIM to LPAR
Viewed 3818 times since Thu, Feb 21, 2019
Script to download TL and SP for AIX using NIM and SUMA
Viewed 9427 times since Thu, Feb 21, 2019
AIX QHA
Viewed 11291 times since Mon, Jun 3, 2019
n a perfect world....rootvg would always reside on hdisk0
Viewed 2464 times since Thu, Jun 6, 2019