Operating System - HP-UX
1753706 Members
4973 Online
108799 Solutions
New Discussion юеВ

Re: How to mirror a logical volume ?

 
Michal Kapalka (mikap)
Honored Contributor

Re: How to mirror a logical volume ?

hi,

to mirror ( duplicate ) is the best practice,

for production system.

If something happend to your disk where is your swap located, and you don't have a mirror, your system will go down.

mirroring and duplicating is to prevent SPOF

Single point of failure

mikap
Sunny123_1
Esteemed Contributor

Re: How to mirror a logical volume ?

hi

I think you can go ahead to add new swap disk instead of mirroring old swap disk.

Regards
Sunny
amreek bansal
Frequent Advisor

Re: How to mirror a logical volume ?


Okay, I see Sunny is suggesting to set up new swap on the new disk, howver I think I would prefer to duplicate (mirror existing one), so what would the commands be pls ?

Thanks
James R. Ferguson
Acclaimed Contributor

Re: How to mirror a logical volume ?

Hi:

> So from some of the replies, I'm doubting whether mirroring the secondary swap is actually needed? Can someone confirm this pls ... is it not normal practice to mirror secondary swap ? does it serve any purpose then ?

Yes, you _do_ want to mirror your secondary swap. To not mirror it might mean that you have a server crash in the event that the disk on which the swap device exists fails.

If you don't care about high availablity then don't mirror in the first place.

Regards!

...JRF...
Patrick Wallek
Honored Contributor

Re: How to mirror a logical volume ?

YES YES YES YES YES!!!!!! YOU ABSOLUTELY WANT TO MIRROR YOUR SWAP!!!!!!!!

Consider this --- You have a swap LV that is not mirrored and resides on a single disk. Your server is cruising along without any apparent problems. Suddenly it crashes. The cause? The disk your swap is on went bad and you didn't know. When your sever tried to actually page out to that device, it couldn't, so your server crashed!

Now, if that swap LV were mirrored, the server would not have crashed.

Having multiple swap areas is NOT THE SAME as having your swap areas mirrored.

Mirroring your swap areas provides redundancy and prevents a single point of failure (which everyone usually wants).

Adding additional swap areas provides just that, more swap that is NOT redundant.
amreek bansal
Frequent Advisor

Re: How to mirror a logical volume ?


Thanks alot for the last replies, I understand now that I should mirror the swap, can any one be kind enough to show the steps in completing the task of mirroring.

Thanks

Patrick Wallek
Honored Contributor

Re: How to mirror a logical volume ?

You were given lots of advice on how to do this above, but in a nutshell:

Assume new disk is c1t3d0 (substitute whatever your disk is)

Assume swap is vg01/lvol1 (substitute whatever yours is)

# pvcreate /dev/rdsk/c1t3d0
# vgextend vg01 /dev/dsk/c1t3d0
# lvextend -m 1 /dev/vg01/lvol1 /dev/dsk/c1t3d0

Wait......

Once the mirror finishes syncing you are done.

NOTE: Depending on the size of your swap LV, this may take a while.
amreek bansal
Frequent Advisor

Re: How to mirror a logical volume ?


Thanks Patrick, I understand your steps. I will do this now. Thanks for your help.