Operating System - HP-UX
1833323 Members
2790 Online
110051 Solutions
New Discussion

Re: Query regarding lvreduce on HP-UX 11.23

 
sanwin
Frequent Advisor

Query regarding lvreduce on HP-UX 11.23

Hi All,
On a production system running HP-UX 11.23 and with no online JFS, can we reduce the size of the lv online.

Someone has increased the size of the currently mounted lv. But not able to extend filesystem as it is not online JFS.

So i want to reduce the added space on that LV.

I am little scared as it is production. I heard defragmentation needs to be done before lvreduce.

Please help me with your comments regarding how to do lvreduce without affecting the production.

Thanks!!

Regards,
Sanwin.
10 REPLIES 10
Shibin_2
Honored Contributor

Re: Query regarding lvreduce on HP-UX 11.23

As long as you haven't re-organised your file system ( i.e. fsadm or extendfs ), you can do lvreduce to make it back as original.
Regards
Shibin
sanwin
Frequent Advisor

Re: Query regarding lvreduce on HP-UX 11.23

Thanks Shibin!!
sanwin
Frequent Advisor

Re: Query regarding lvreduce on HP-UX 11.23

Hi,
When i run lvreduce i am getting this message.

What does this mean?

Whether it will remove the old data which was there before expanding the LV.

PLease help me.

When a logical volume is reduced useful data might get lost;
do you really want the command to proceed (y/n) :
rariasn
Honored Contributor

Re: Query regarding lvreduce on HP-UX 11.23

Hi Sanwin:

LVM does not store any information about which physical extents within a logical volume contain useful data; therefore, reducing the space allocated to a logical volume without doing a prior backup of the data could lead to the loss of useful data. The lvreduce command on a logical volume containing a file system of greater length than the size being reduced to will cause data corruption.

man lvreduce

rgs,
sanwin
Frequent Advisor

Re: Query regarding lvreduce on HP-UX 11.23

Thanks!! Actually the data is of size 10 Gb.
Current lv size is 20 Gb and i am trying to reduce to 10 GB.

My doubt was whether it will reduce the unused space or there will be issues with data?


Thanks!!
N,Vipin
Frequent Advisor

Re: Query regarding lvreduce on HP-UX 11.23

I would like to know what is the size in bdf output.
Doug O'Leary
Honored Contributor

Re: Query regarding lvreduce on HP-UX 11.23

Hey;

Lvreduce will reduce the lv from the end of the chain. Since the filesystem was never extended across the newly added extents, you should be fine.

You're in a position that's about as safe as it's going to get to run that command. The warning messages don't do anything for the comfort factor, though; I'll freely admit.

Doug

------
Senior UNIX Admin
O'Leary Computers Inc
linkedin: http://www.linkedin.com/dkoleary
Resume: http://www.olearycomputers.com/resume.html
sanwin
Frequent Advisor

Re: Query regarding lvreduce on HP-UX 11.23

Thanks Doug!! Currently it is mounted with 10 Gb.

I will try then.

Thanks!!

Regards,
Sanwin
N,Vipin
Frequent Advisor

Re: Query regarding lvreduce on HP-UX 11.23

100% agree with Mr Doug.
Emil Velez
Honored Contributor

Re: Query regarding lvreduce on HP-UX 11.23

make sure the file system is mounted and it should not kill any data. For example

1. LV was 10 GB
2. you extended the LV to 20 GB
3. You do not extend the filesystem
4. reduce the LV to 10.01 GB while it is mouned that way it will not let you reduce the LV smaller than the FS structure that is mounted.