Operating System - HP-UX
1832617 Members
2538 Online
110043 Solutions
New Discussion

Re: How to remove a LV & reduce the volume group

 
praveen.
Occasional Contributor

How to remove a LV & reduce the volume group

Hi,
I need to delete some logical volumes & reduce the some LUNs from that volume group.

how to do it?
#umount /praveen/oracle/data
#lvremove /dev/vg44/praveen_oracle_data
#vgreduce /dev/vg44 /dev/dsk/c26t11d0 /dev/dsk/c23t11d0

this volume group contains more Logical volume, I need to free some luns for the creation of new volume group
5 REPLIES 5
Steven E. Protter
Exalted Contributor

Re: How to remove a LV & reduce the volume group

Shalom praveen,

You are on the right track.

1) umount the filesystem the logical volume has on it.
2) lvremove the logical volume
3) vgreduce when a while LUN is free.

pvdisplay -v /dev/dsk/ | more

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
A. Clay Stephenson
Acclaimed Contributor

Re: How to remove a LV & reduce the volume group

First do an lvdisplay -v /dev/vg44/praveen_oracle_data

This will enable you to see which PV('s) this LVOL actually occupies.

Next comes the umount, lvremove, and the vgreduce using the PV's found in the initial lvdisplay. Above all, be careful. You can get yourself into trouble much faster than you can get yourself out. (e.g. one wrong character in a device node name).

If it ain't broke, I can fix that.
Jakes Louw
Trusted Contributor

Re: How to remove a LV & reduce the volume group

If there fragments of an LVOL spread across more than 1 disk, use PVMOVE to get those fragments off the disk you want to remove. The only catch is that LVM needs enough space on other disks in the VG to relocate these disk extents to.
Trying is the first step to failure - Homer Simpson
Adisuria Wangsadinata_1
Honored Contributor

Re: How to remove a LV & reduce the volume group

Hi Praveen,

The steps is correct.

But before you execute 'vgreduce', you need to make sure that only '/dev/vg44/praveen_oracle_data' that use the disk 'c26t11d0' and 'c23t11d0'.

Use pvdisplay command for this purpose :

# pvdisplay -v /dev/dsk/c26t11d0
# pvdisplay -v /dev/dsk/c23t11d0

If only '/dev/vg44/praveen_oracle_data' on both disk (c26t11d0 & c23t11d0), you're safe to execute the 'vgreduce' command.

Hope this information can help you.

Cheers,
AW
now working, next not working ... that's unix
Indrajit_1
Valued Contributor

Re: How to remove a LV & reduce the volume group

Hi Praveen;

u r right..

unmount the filesystem

#umount /praveen/oracle/data
if it show, filesystem is busy..
#fuser -cu /praveen/oracle/data
#fuser -ku /praveen/oracle/data (to kill)
#lvremove /dev/vg44/praveen_oracle_data
#vgreduce /dev/vg44 /dev/dsk/cxtxdx

#vgdisplay -v vg_name |pg

And also remove the entry from /etc/fstab file and /etc/lvmpvg

#vi /etc/fstab
#vi /etc/lvmpvg

...

cheers
indrajit
Never Ever Give Up