Operating System - HP-UX
1755752 Members
5119 Online
108838 Solutions
New Discussion юеВ

How do I recover disk space after lvremove without lvreduce

 
SOLVED
Go to solution
ralph barber
Advisor

How do I recover disk space after lvremove without lvreduce

I very carelessly did an lvremove without doing an lvreduce on a logical volume and now I can't get the disk space that was allocated to the volume back. Is there a simple way of getting this back else I have to start all over again as I need that space
10 REPLIES 10
Bernhard Mueller
Honored Contributor

Re: How do I recover disk space after lvremove without lvreduce

Hi,

did you want to remove the logical volume? then you do not need to lvreduce, and you should have all disk space available, vgdisplay should tell you so.

Or did you *not* want to remove the logical volume but only reduce the size or mirroring of an lvol?

Regards,
Bernhard

Robert-Jan Goossens
Honored Contributor

Re: How do I recover disk space after lvremove without lvreduce

Ralph,

Could you give us the commands you have used ?

Kind regards,
Robert-Jan
ralph barber
Advisor

Re: How do I recover disk space after lvremove without lvreduce

the command I used was
lvremove -f /dev/vg01/u03
this logical volume was 12754 extents
However when I run vgdisplay on vg01 it shows only 2331 extents free, the same as before I removed the volume ?
Marco Santerre
Honored Contributor

Re: How do I recover disk space after lvremove without lvreduce

The reason it may not have freed up the extents is that maybe the file system was still being in used and/or mounted. The other thing too is that usually it will give you a confirmation message regarding whether you really want to remove the LV, so maybe the LV was not removed after all. In you VG, do you still see your LV in the list?
Cooperation is doing with a smile what you have to do anyhow.
Robert-Jan Goossens
Honored Contributor

Re: How do I recover disk space after lvremove without lvreduce

run bdf to check Marco's answer
Bernhard Mueller
Honored Contributor

Re: How do I recover disk space after lvremove without lvreduce

Hi folks,

if you use -f you are not asked for confirmation, however, if the lvol has a mounted filesystem or the raw volume is in use you lvreduce will give an appropriate error message an *not* remove the lvol.

So in fact, pls run
ll /dev/vg01 an post the result

then run lvdisplay /dev/vg01/u3 and post the result

Regards,
Bernhard
Massimo Bianchi
Honored Contributor

Re: How do I recover disk space after lvremove without lvreduce

Could you post a

vgdisplay -v vg01

If space is not released, then it must be allocated to some lvol... let's find to which cXtYdZ disks belonged that lvol, and then issue a

pvdisplay -v /dev/rdsk/cXtYdZ | more

The result should show wheter the lvol still allocates the PE or not...
Massimo
ralph barber
Advisor

Re: How do I recover disk space after lvremove without lvreduce

I had unmounted the filesystem before removing the volume and vgdisplay did not show removed volume, also not in /dev/vg01 when I do an ll. When I do a pvdisplay I get the following on a lot of the extents which I guess must be my missing diskspace
26739 current ??? 08326
26740 current ??? 08327
26741 current ??? 08328
26742 current ??? 08329
26743 current ??? 08330
Bernhard Mueller
Honored Contributor
Solution

Re: How do I recover disk space after lvremove without lvreduce