Operating System - HP-UX
1819805 Members
2865 Online
109607 Solutions
New Discussion юеВ

Removing a LV with lvremove

 
Jonathan Caplette_1
Super Advisor

Removing a LV with lvremove

Hi guys,

I tried to remove some LV's from my vg01, I got this error for each lv:

[jcaplett@morpheus]$ sudo /usr/sbin/lvremove -f /dev/vg01/lvl89rw1
Current path "/dev/dsk/c24t0d0" is an alternate link, skip.
Current path "/dev/dsk/c26t0d3" is an alternate link, skip.
lvremove: Couldn't delete logical volume "/dev/vg01/lvl89rw1":
The specified logical volume is open, or
a sparing operation is in progress.
Volume Group configuration for /dev/vg01 has been saved in /etc/lvmconf/vg01.conf

I check they're not mount on a FS, they have no open file or process using these LV's, they're all part of a PV, and I have some data on my vg01 that I don't wanna lose!!

Own can I remove my LV's???
8 REPLIES 8
Ashwani Kashyap
Honored Contributor

Re: Removing a LV with lvremove

Looks like a patching issue . are you uptodate on LVM patches . LVM is pretty stable unless there is some patch issues .

If this is HPUX11.0 try this patch PHKL_30553 or superceeded .
Mel Burslan
Honored Contributor

Re: Removing a LV with lvremove

if your vg01 contained one or more physical volumes from a disk array of some sort which was configured with a hot spare, and this logical volume has a hook to this hot spare, this may cause you the headache.

vgdisplay -v vg01
lvdisplay /dev/vg01/lvl89rw1
pvdisplay -v (all volumes in vg01 here one by one until the line :
--- Physical extents ---
encountered)

if you can post this info, it can be a great help understanding your disk topology.
________________________________
UNIX because I majored in cryptology...
Sridhar Bhaskarla
Honored Contributor

Re: Removing a LV with lvremove

Hi Jonathan,

Try issuing the command "umount /dev/vg01/lvol90rw1" and see. Also recreate /etc/mnttab by

#mv /etc/mnttab /etc/mnttab.sav
#bdf
#umount /dev/vg01/lvol90rw1

If that doesn't work, try

#fuser /dev/vg01/lvol90rw1
#fuser /dev/vg01/rlvol90rw1

And see if they are being opened. You can also try "lsof" and see if this logical volume is in use.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
pap
Respected Contributor

Re: Removing a LV with lvremove

do following which might help

fuser -ck /file_sys_name
then do lvremove on those Lvs.

thanks,
-pap
"Winners don't do different things , they do things differently"
chapaya_1
Frequent Advisor

Re: Removing a LV with lvremove

Hi ,

Try using lsof ,

you will see which file is open by who ...

Bye.
iminus
Frequent Advisor

Re: Removing a LV with lvremove

Probably because they are still mounted or open? You need to unmount your logical volumes before you can remove them. Do a bdf or df to check if they are mounted or not. If they are mounted, do a
ps -ef | grep
to see if there's anything runs on it. If they are not mounted, check if the logical volume is used for mirror or not.
hope it helps
Jonathan Caplette_1
Super Advisor

Re: Removing a LV with lvremove

Thanks for the help!! I double check what it was, I found that was a application using raw device!! :S

Sorry!! but thanks for the answer!!
Susan Dietz
Occasional Advisor

Re: Removing a LV with lvremove

I am having the same open error when trying to remove a raw logical volume.

How did you get the logical volume to delete?