1834798 Members
2859 Online
110070 Solutions
New Discussion

lvreduce and PVG-Strict

 
SOLVED
Go to solution
Robin King_1
Regular Advisor

lvreduce and PVG-Strict

Happy New Year everyone!

I am trying to write a simple procedure for one of Operators to complete at the weekend, and was wondering if somebody could check what I'm saying to them. I haven't got the opportunity to play around with it, and it's something I haven't done for a long time.
/dev/vg03/lvswap is on c1t13d0 and c1t14d0 (PVG0), this is mirrored on c7t14d0 (Part of PVG1). I need to break the mirror, and reinstate the mirror using all of PVG1 (c7t14d0 and c7t13d0)

lvreduce -m 0 /dev/vg03/lvswap /dev/dsk/c7t14d0

then

lvextend -m 1 /dev/vg03/lvswap pvg1

I think this looks right, but if the lv is PVG-Strict will I be able to lvreduce using the specific disk or will I have to lvreduce PVG1?

Hope that all makes sense.

Thanks

Rob
4 REPLIES 4
Stefan Farrelly
Honored Contributor
Solution

Re: lvreduce and PVG-Strict

You dont need to worry with the /dev/dsk/c7t14d0 entry when you do the lvreduce -m 0, it will do that automatically, so the lvreduce -m 0 only will work fine.

Even if you use pgv1 on the mirror re-establish you can still use the /dev/dsk entry to force it to use that disk(s) for the mirror - as long as there is enough contiguous space for the swap area, so the re-establish may fail. But if it does then you can sort if out when back from the weekend.
Im from Palmerston North, New Zealand, but somehow ended up in London...
Dietmar Konermann
Honored Contributor

Re: lvreduce and PVG-Strict

Hi, Rob!

With lvreduce you must specify individual disks... it simply does not support PVGs as argument yet.

Assuming that the complete mirror copy resides on c7t14d0 only, your procedure looks fine for me.

Best regards...
Dietmar.

"Logic is the beginning of wisdom; not the end." -- Spock (Star Trek VI: The Undiscovered Country)
Sridhar Bhaskarla
Honored Contributor

Re: lvreduce and PVG-Strict

Hi Rob,

Your lvreduce command will work irrespective of lv is PVG-Strict or not.

And if your lv is PVG-Strict, you don't need to specify pvg1 with your lvextend -m 1 command. It will automatically use the disks out of pvg1 due to it's PVG strict allocation policy.

If your lv is not PVG Strict, you can make it so by executing the command lvchange -s g /dev/vg03/lvswap.

Once it is PVG strict, you can drop pvg1 from the lvextend command.

Use lvdisplay command and look fot "Allocation" policy. It should say "PVG-strict"


-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Robin King_1
Regular Advisor

Re: lvreduce and PVG-Strict

Thanks guys.
This is what I'm planning to send them (bear in mind the lv is currently being used for swap)

Check the current status of the logical volume, at the bottom of the first screen you should see that it is currently using three disks, c1t13d0, c1t14d0 and c7t14d0:
lvdisplay -v /dev/vg03/lvswap6 | more

Comment out the logical volume in /etc/fstab:
vi /etc/fstab

#/dev/vg03/lvswap6 ... swap pri=1 0 0

Shutdown the server to single user mode:
Shutdown 0

Remove the mirror:
lvreduce -m 0 /dev/vg03/lvswap6 /dev/dsk/c7t14d0

Reinstate the mirror using both c7t13d0 and c7t14d0 (PVG1)
lextend -m 1 /dev/vg03/lvswap6

Remove the comment from the /etc/fstab file:
/dev/vg03/lvswap6 ... swap pri=1 0 0

Reboot:
shutdown -ry 0

Check the changes have been completed successfully, you should now see that it is using the four disks, c1t13d0, c1t14d0, c7t13d0 and c7t14d0:
lvdisplay -v /dev/vg03/lvswap6 | more