Operating System - HP-UX
1832207 Members
2962 Online
110040 Solutions
New Discussion

Re: replacing swap volumes with new PVs.

 
SOLVED
Go to solution
Stuart Abramson
Trusted Contributor

replacing swap volumes with new PVs.

We are replacing an old Symm with a new Symm.

I have some servers with swap on the Symm (marked below with "==>":

# swapinfo -atm
Mb Mb Mb PCT START
TYPE AVAIL USED FREE USED LIM RESRV PRI NAME
dev 4096 0 4096 0% 0 - 1 /dev/vg00/lvol2
==> dev 8608 0 8608 0% 0 - 0 /dev/vgswap/swap
==> dev 4288 0 4288 0% 0 - 0 /dev/vgswap/swap1
reserve - 10147 -10147
memory 18862 4984 13878 26%
total 35854 15131 20723 42% - 0 -

I have two quetions:

1. Can I "lvextend/lvreduce/vgreduce" the swap out like I would do with
a "normal" VG/LV?:

vgextend /dev/vg01 /dev/dsk/c2t0d2 # extend the VG
lvextend -m 1 /dev/vg01/lvol1 /dev/dsk/c2t0d2
#
lvreduce -m 0 /dev/vg01/lvol1 /dev/dsk/c1t0d0
vgreduce /dev/vg01 /dev/dsk/c1t0d0

2. Our new Symm doesn't have any 4 GB HyperVolumes, like the old Symm did,
as in LV "/dev/vgswap/swap1" above.

Can I use an 8 GB PV to replace a 4 GB PV in LV "/dev/vgswap/swap1" above?
8 REPLIES 8
Jagadeesh Kumar
Advisor
Solution

Re: replacing swap volumes with new PVs.

Stuart,

1. Yes, the mirroring operations(lvextend/lvreduce/vgreduce) can be done on swap lvols as we do in "normal" lvols.

2. Yes, 4GB PV can be replaced by 8GB PV - as long as you do one mirror at a time.

Hope this helps
-Jagadeesh
Pete Randall
Outstanding Contributor

Re: replacing swap volumes with new PVs.

Stuart,

I believe it's going to be a little awkward. Since there is no "swapoff" command, you'll probably need to edit the additional swap devices out of /etc/fstab and reboot before you can remove them. Then you can add in your new PVs and assign swap to them.


Pete

Pete
Victor BERRIDGE
Honored Contributor

Re: replacing swap volumes with new PVs.

Hi,
Im afraid the only way I see here would be to remove these 2 swaps at next reboot, reboot then recreate them on your new Symm


All the best
Victor
TwoProc
Honored Contributor

Re: replacing swap volumes with new PVs.

You can extend swaps, but I think it has to be contiguous. As far as your plan above, I can't see where it would be a problem. Looks fine to me.
Just an fyi though, if you're not doing it now (it appears that you're not from the example script above) - you really should think about leaving swap mirrored. I've always operated on the idea that if a swap area(disk) goes down, the whole server goes down. Therefore, even though it seems like a terrible waste, go ahead an mirror swap.
We are the people our parents warned us about --Jimmy Buffett
Jagadeesh Kumar
Advisor

Re: replacing swap volumes with new PVs.

Stuart,

I don't think you need reboot to do this(as suggested above) - IF you just need to move from old to new SYMM.

As per you plan, this can be done online.

1. Add a new 8GB PV into you VG
2. Mirror swap lvols.
3. lvreduce the old PVs from swap lvols
4. vgreduce to remove the old 4GB PVs.

-Regards
Jagadeesh.
Stuart Abramson
Trusted Contributor

Re: replacing swap volumes with new PVs.

I'm going to try Jagadeesh's suggestion tomorrow. I'll assign points after test.

As pointed out, if you can mirror/lvreduce/vgreduce on the fly, you don't need to reboot.

These are EMC disks and don't need to be LVM mirrored. But I do agree that your "root disk swap" should be mirrored just as much as /opt should be mirrored.
TwoProc
Honored Contributor

Re: replacing swap volumes with new PVs.

Wow, I guess they are mirrored then!
Please excuse the unnecessary comment then.
I also agree that you will be able to do this w/o coming down because the LV is never taken down in proposed process.
We are the people our parents warned us about --Jimmy Buffett
Stuart Abramson
Trusted Contributor

Re: replacing swap volumes with new PVs.

Jagadeesh was absolutely right. I did just what he suggested and I'm good.