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

Cant remove a logical volume

 
SOLVED
Go to solution
Ian Foster
Advisor

Cant remove a logical volume

I have been trying for about an hour or so now to remove a logical volume from our HP K class (now running HP-UX 11i).

Each time I try to remove it using either SAM or from the command line
(lvremove -f /dev/testvg/lvol1)
I get 'can not delete the logical volume - the volume is open or a sparing operation is in progress'

I have unmounted the filesystem and ran lvchange -a n /dev/testvg/lvol1 first but this has made no difference.

What gives ? ?

Also I have an o.s. upgrade looming on our L class this weekend, prior to which we plan to split the mirrored root volumes and prove that we can reboot the box from the mirror disk if necessary.

I have a (very vague) idea of the procedure for this but if anybody has any pointers they would be much appreciated.
Great, another box to fill in
22 REPLIES 22
Helen French
Honored Contributor
Solution

Re: Cant remove a logical volume

Check if any process is still trying get hold of the file system. You can use fuser, lsof or ps commands to check it. Check the output of lvdisplay and see the LV status.
Life is a promise, fulfill it!
RAC_1
Honored Contributor

Re: Cant remove a logical volume

using lsof or fuser check if there are any processes attached to it.

after lvchange -a n check lvdisplay.

Then lvremove should work.
There is no substitute to HARDWORK
Helen French
Honored Contributor

Re: Cant remove a logical volume

For the OS upgrade question, this thread was very useful for me:

http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0xf1c5a2db8513d6118ff40090279cd0f9,00.html
Life is a promise, fulfill it!
Ian Foster
Advisor

Re: Cant remove a logical volume

Thanks for the prompt responses guys.

Unfortunately I have not been able to resolve this yet. I can not identify anything which may be trying to access the volume using fuser, and lvdisplay shows it as unavailable following the status change using lvchange.

Any more ideas ?
Great, another box to fill in
Helen French
Honored Contributor

Re: Cant remove a logical volume

You don't need to change the LV status with lvchange for removing a LV. Make it available for operation and try removing it.

Another good possibily can be the patches. Are you up to date with patches? what about LVM patches
Life is a promise, fulfill it!
Helen French
Honored Contributor

Re: Cant remove a logical volume

Also, can you post the error message you are getting and the command you applied?
Life is a promise, fulfill it!
pap
Respected Contributor

Re: Cant remove a logical volume

Hi Ian,

Please do following that might helps.

1. activate your lv. (make the sattus of LV vailable.)
2. If you have mirrored this LV , please remove the mirror copy.
3. Try to remove the LV using simple lvremove command.
4. If you are unable to do so, please post the vgdisplay -v out put and lvdisplay -v output to understand your problem in better way.

Thanks,

-pap

"Winners don't do different things , they do things differently"
pap
Respected Contributor

Re: Cant remove a logical volume

Hi Ian,
If at all you are not able to remove the LV from VG01 , I suggest to boot the system into lvm maintenance mode and perform following actions :

ISL> hpux -lm

# vgchange -a y vg00
# mount -a
# vgchange -a y /dev/testvg
# umount /dev/testvg/lvol1
# lvremove /dev/testvg/lvol1

I am sure that will work.

Thanks,
-pap
"Winners don't do different things , they do things differently"
pap
Respected Contributor

Re: Cant remove a logical volume

Hi Ian,
If at all you are not able to remove the LV from TESTVG , I suggest to boot the system into lvm maintenance mode and perform following actions :

ISL> hpux -lm

# vgchange -a y vg00
# mount -a
# vgchange -a y /dev/testvg
# umount /dev/testvg/lvol1
# lvremove /dev/testvg/lvol1

I am sure that will work.

Thanks,
-pap
"Winners don't do different things , they do things differently"
Ian Foster
Advisor

Re: Cant remove a logical volume

All good suggestions. I have tried them all (except booting to LVM maintenance mode - this will have to wait until I can get on-site with the machine and schedule an outage on the server). Problem still remains so I am inclined to think maybe there might be a patching issue as suggested. I have checked that volume is not mirrored. The output is attached FYI.

Great, another box to fill in
Robert-Jan Goossens
Honored Contributor

Re: Cant remove a logical volume

Hi Ian,

Just a thought, why not remove the volume group, noticed that you have only one lvol in this group.

# vgexport testvg

Robert-Jan.
Armin Feller
Honored Contributor

Re: Cant remove a logical volume

Check who keeps the lvol open:

# fuser /dev/testvg/rlvol1
# ps -fp
end the process which keeps the file open

Please also check if the newest VxFS patch is installed on the system, for HP-UX 11.00 min. PHKL_27212

Ian Foster
Advisor

Re: Cant remove a logical volume

Nice idea, Robert-Jan. Unfortunately this wouldn't work either :

# vgexport /dev/testvg
vgexport: Volume group "/dev/testvg" is still active.
vgexport: Couldn't export volume group "/dev/testvg".

# vgchange -a n /dev/testvg
vgchange: Couldn't deactivate volume group "/dev/testvg":
Device busy

Good, isn't it ?!

It would certainly appear that despite the fact the filesystem is not mounted and I can make the only remaining logical volume unavailable, the system thinks that testvg or the underlying disk is busy, though I'll be damned if I can see why ! Maybe a reboot will cure it ?
Great, another box to fill in
Juan Manuel L├│pez
Valued Contributor

Re: Cant remove a logical volume

Use fuser command over lv name to get the proccess running on it.
Then you can kill the process on lv.

I hope this help you.

Juanma.
I would like to be lie on a beautiful beach spending my life doing nothing, so someboby has to make this job.
Armin Feller
Honored Contributor

Re: Cant remove a logical volume

Yes, a reboot will help here, but in my mind you should find the process which keeps the lvol open with fuser command and if you stop/kill this process you should be able to remove the lvol without reboot.

Regards ...
Armin
Ian Foster
Advisor

Re: Cant remove a logical volume

Armin, output as suggested :

# fuser /dev/testvg/lvol1
/dev/testvg/lvol1:

# fuser /dev/testvg
/dev/testvg:

# fuser /dev/dsk/c2t4d0
/dev/dsk/c2t4d0:

#

ie. no output.

It looks more like a case for a reboot or some LVM patches.

Cheers,
Ian.
Great, another box to fill in
Armin Feller
Honored Contributor

Re: Cant remove a logical volume

Please use the raw lvol

# fuser /dev/testvg/rlvol1

to find the process. Also you should check for the newest VxFS patch, I know a problem without having this patch.

If fuser didn't find the process, you have to reboot ;-(((
Ian Foster
Advisor

Re: Cant remove a logical volume

Shiju,

The thread for the upgrade/mirroring question looks useful, thanks.

I have a question relating to this though :

When rebooting from the mirror disk (assuming the mirror has been split prior to the shutdown) is there an issue with /etc/fstab or will all the filesystems mount as normal ?

Cheers,
Ian.
Great, another box to fill in
Ian Foster
Advisor

Re: Cant remove a logical volume

Armin,

The fuser did not find anything on the raw device either unfortunately :

# fuser /dev/testvg/rlvol1
/dev/testvg/rlvol1:

#

Time to check patches and possibly reboot, I think.

Thanks for all your suggestions.

Ian.
Great, another box to fill in
Armin Feller
Honored Contributor

Re: Cant remove a logical volume

Hi Ian,

bad luck ;-( Yes, please check for patches and reboot. Wish good luck in the future.

Regards ...
Armin
Jakes Louw_1
Frequent Advisor

Re: Cant remove a logical volume

Just a shot in the dark here:

check that there isn't another LVOL created with the same major & minor number.
jemmy
New Member

Re: Cant remove a logical volume

Hi,

Try the following:

fuser -ku /dev/testvg/lvol1

This kills all process that has open files on this volume.

And then do your removal:
lvremove -f /dev/testvg/lvol1

Regards,
Jemmy Lai