cancel
Showing results for 
Search instead for 
Did you mean: 

removing the PV...

 
gany59
Regular Advisor

removing the PV...

how to remove the physical volume from the vg
can anybody tell the steps to goahead ?

Thanks in advance!!!!!!!!
8 REPLIES
Steven E. Protter
Exalted Contributor

Re: removing the PV...

Shalom,

umount file systems involved.
lvremove the logical volumes

when pvdisplay shows no extents in use, vgreduce to remove the physical volume from the volume group.

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
SoorajCleris
Honored Contributor

Re: removing the PV...

#umount
#lvreduce -m if mirror
#lvremove if lv with out mirror
#vgreduce
#pvremove...


Enjoy ...

Regards,
Sooraj
"UNIX is basically a simple operating system, but you have to be a genius to understand the simplicity" - Dennis Ritchie
Benoy Daniel
Trusted Contributor

Re: removing the PV...

it depends on different scenarios

1. whether PV is in use or not
2 how many LV's under that particular VG
3. Do you want to remove the LV and free up the PV or not

Simple step is check all these details using vgdispplay -v first

then find out the PV Name from the output and see the Total PE and Free PE under that particular PV. if Total PE and Free PE matches then its not in use and you can go ahead and use vgreduce
singh sanjeev
Trusted Contributor

Re: removing the PV...

Here we go :


First confirm that disk is free which you want to remove from the vg_name.

if disk is not free then use pvmove to move the PE from disk to another disk.

once disk is freed !!!!



and gather the information related to disk from stroage point like ID that should be given to storage team to mask it.

vgreduce vg_name

then you can rmsf to remove hardware_path information from ioscan

rmsf -a /dev/dsk/c?t?d?



Sanjeev Singh
Suraj K Sankari
Honored Contributor

Re: removing the PV...

>>how to remove the physical volume from the vg
There are 2 major things need to check
1.Is it a good disk
2.Or its a bad disk

Which you want to remove from VG.
If its a good disk then you need to check these below steps.

1.Check this disk belongs to which VG from
#strings /etc/lvmtab => look for your disk
2.Do vgdisplay and find out what are the lv is belongs to this vg.
#vgdisplay -v vgname
3.Check lvs are mirrored or not if mirrored then need to break the mirror
#lvreduce -m 0 lvname pvname
4.If not mirrored than lvremove command
#lvremove -A n lvname
5.Last check pvdisplay -v pvname if extents are not in use then
#vgreduce vgname pvname

If your disk is bad then check this below link
http://docs.hp.com/en/5991-1236/When_Good_Disks_Go_Bad_WP.pdf

Suraj
Kranti Mahmud
Honored Contributor
Raj D.
Honored Contributor

Re: removing the PV...

Pl Post# pvdisplay -v | perl -ne 'print if /Dist/../^\s*$/'
" If u think u can , If u think u cannot , - You are always Right . "
P Muralidhar Kini
Honored Contributor

Re: removing the PV...

Hi,

>> how to remove the physical volume from the vg
To remove physical volumes from the LVM volume group, you need to use the
vgreduce command. Check the following link for details of vgreduce command-
http://docs.hp.com/en/B3921-90010/vgreduce.1M.html

Hope this helps.

Regards,
Murali
Let There Be Rock - AC/DC