Operating System - HP-UX
1821246 Members
2709 Online
109632 Solutions
New Discussion юеВ

Deleting and recreating a logical volume in a Service Guard environment

 
Morris Makuch
Advisor

Deleting and recreating a logical volume in a Service Guard environment

Hello. I have a 100GB logical volume that is spread out over 7 18GB Luns on a VA7400. For some reason this volume has become corrupt because it hangs my server whenever I copy a file to it. HP has suggested to just delete and recreate the volume to see if it solves the problem. I am unsure of the proper steps involved in doing this procedure. This LV is part of a service guard package in a 2 node cluster. Scheduling downtime to take down the package and perform this procedure is not a problem. Any help would be appreciated. Thanks
4 REPLIES 4
John Poff
Honored Contributor

Re: Deleting and recreating a logical volume in a Service Guard environment

Hi,

Here is one way to try it. I would probably try it without taking down the cluster or the package. I would stop any applications running the package first. Then,

umount /your/filesys
lvremove /dev/vg_whatever/lvol##
lvcreate -L 100000 -n lvol## /dev/vg_whatever
mount /dev/vg_whatever/lvol## /your/filesys

Using the '-n' option on the lvcreate command will let you recreate the logical volume with the same name as the old one, which will save you having to edit any package control scripts.


If you decide to be really safe and do it with the package down, you'll have to add a couple of extra steps. First, you'll probably have to activate your volume group

vgchange -a e /dev/vg_whatever
lvremove /dev/vg_whatever/lvol##
lvcreate -L 100000 -n lvol## /dev/vg_whatever
vgchange -a n /dev/vg_whatever

Then restart your cluster and package.


If it were me, I'd do it with the package up so that you don't have to worry about the vgchange commands on the volume group. Plus, if there is a problem with the disk array, my guess is that it will show up when you do the 'lvcreate' command.

JP
Ashwani Kashyap
Honored Contributor

Re: Deleting and recreating a logical volume in a Service Guard environment

Stop all apps . Unmount the file system mounted on that logical volume .

Remove the logical volume .
#lvremove /dev/vg_name/lv_name.

Create the logical volume :
#lvcreate -L 100000 -n lv_name /dev/vg_name .

Create the file sstem on the LV :
#newfs -F vxfs -o -b /dev/vg_name/rlv_name .

#mount you File system .

Son't have to halt the package at all .

If you want to halt the package . Then shutdown you cluster . Take your VG away from the cluster :
#vgchange -c n /dev/vg_name .
Activate the VG normally :
#vgchange -a y /dev/vg_name .

Remove and recreate the LV as expalined above and also create the file system .
Deactivate the volume group.
#vghange -a n /dev/vg_name
Put the VG back in the cluster :
#vgchange -c y /dev/vg_name .
Restart your package .

Elif Gius
Valued Contributor

Re: Deleting and recreating a logical volume in a Service Guard environment

Most LVM modifications can be made while cluster is up and running. Only when you add or remove a shared volume group or modificate the config of the cluster lock.
All other LVM changes can be done while the cluster is up.

The vgimport needs to be executed any time when a "new" LVM device file was created, e.g. as it would happen when you create a new lvol.
You have to use vgexport and vgimport on the other cluster node.Pls think of to create a new mapfile!!!

So your cluster can be up and running, just your package has to be down !!!
Morris Makuch
Advisor

Re: Deleting and recreating a logical volume in a Service Guard environment

Thanks. It work like a charm. Thanks for all your replies.

Morris