1833031 Members
2166 Online
110049 Solutions
New Discussion

lvreduce on hpux 10.20

 
berganti
New Member

lvreduce on hpux 10.20

Hi,

I have a problem in hp-ux release 10.20 .on my HP K380 server
I made a mistake when I choose to lvextand my logical volume on my volume
group in fact I just needed to make a vgextand .
The file system allways have the same size.
So, now I need to make a lvreduce without erasing data on this file system
in this logical volume.
My question is :
is it possible to make a lvreduce on a logical volume after we make a
lvextand without loose any data in the file system,if we don't increase in
the same time
the size of this file system?
Please somebody can help me?


4 REPLIES 4
Bill Hassell
Honored Contributor

Re: lvreduce on hpux 10.20

As long as you reduce the logical volume back to it's original size, you'll have no problems. lvextend simply adds extents to the lvol but the filesystem knows nothing about this change. After all, an lvol may have a filesystem on it but it might also be raw or it might be swap space. Just to be sure, backup this lvol.


Bill Hassell, sysadmin
S.K. Chan
Honored Contributor

Re: lvreduce on hpux 10.20

So you're saying you accidently lvextended a logical volume with the FS still mounted ? If that is the case you're fine because you have not done anything to the FS yet (ie you have not extendfs it yet). However I still would advice you to backup the data in this LV before you run lvreduce.
After you're done just lvreduce it to it's original size (you MUST be sure what was the LV size before it was extended).

# lvreduce -L /dev/vg02/lvol3

For example .. if the original size of your LV (lvol3 in vg02) is 800MB, you would ..

# lvreduce -L 800 /dev/vg02/lvol3

When you run lvreduce it'll prompt for a yes/no confirmation, proceed with "yes". Check it afterwards ..

# vgdisplay -v vg02 | more

Assumption made :- the LV is not mirrored.
PIYUSH D. PATEL
Honored Contributor

Re: lvreduce on hpux 10.20

Hi,

As long as you have not run extendfs you dont have a problem.

You can do a lvreduce
#lvreduce -L 500 /dev/vg02/lvol2

500MB is the orignial size of fs.

Pls backup the data since sometimes there is a possibilty that a data loss can occur.

Piyush
Shahul
Esteemed Contributor

Re: lvreduce on hpux 10.20

Hi

OK.. By mistake U have increased the FS? Right? Now Just checkup where U are

#bdf |grep

Here FS is the file system which U are trying to reduce.

If the size is old size (means the original size), then U can very well decrease the lvol size. If Fs size is new size (means inceased size) then U will have to back up the data and proceed with lvreduce.

Best of luck
Shahul