Operating System - HP-UX
1834089 Members
2398 Online
110063 Solutions
New Discussion

Re: How to update the VG after reducing size of some logical volumes

 
SOLVED
Go to solution
senthil_kumar_1
Super Advisor

How to update the VG after reducing size of some logical volumes

Hi All,

I have reduced the size of some logical volumes using online JFS. but it is not updated in "vgdisplay -v", in "vgdisplay -v" older LE size and LEs assigned to the LV.

How to update the reduced size and get the LEs and PEs back in "vgdisplay -v"
7 REPLIES 7
James R. Ferguson
Acclaimed Contributor

Re: How to update the VG after reducing size of some logical volumes

Hi Senthil:

You reduced the size of the _filesystem_ but not the container in which it lives. The container is the logical volume. To downsize a logical volume, use 'lvreduce'. See the manpages for details. Never use 'lvreduce' without first reducing the size of a filesystem within. To do otherwise would corrupt your filesystem. As always, a backup of the filesystem before you fiddle with the LVM and filesystem configuration is advisable.

Regards!

...JRF...
Steven E. Protter
Exalted Contributor

Re: How to update the VG after reducing size of some logical volumes

Shalom,

At this point you have only reduced the size of the logical volumes.

The next step would be to find a physical volume with no logical volumes on it. You may need to move stuff off of that physical volume.

Once that is done, you can vgreduce a physical volume out of the volume group.

If you are using a 1 disk volume group then there is nothing you can do to reduce the volume group space use, save migrate it to a smaller disk.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
senthil_kumar_1
Super Advisor

Re: How to update the VG after reducing size of some logical volumes

Now how to solve this issue.
Steven E. Protter
Exalted Contributor
Solution

Re: How to update the VG after reducing size of some logical volumes

Shalom,

Post vgdisplay -v output.

Then I will write you a plan.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
James R. Ferguson
Acclaimed Contributor

Re: How to update the VG after reducing size of some logical volumes

Hi (again):

> Now how to solve this issue

I'll be very direct. Did you read and did you think about what has been written? Have you examined the manpages for the various commands you use? Have you looked at the various administration guides for the release you are running?

...JRF...
Michael Steele_2
Honored Contributor

Re: How to update the VG after reducing size of some logical volumes

Hi

You do not want to reduce a logical volume that has already been written into without taking the consequence of loss of data. Data in a logical volume is not written in a contiguous or sequential order. Its randomly written. You could have data written out at the end of the lvol and then truncate it during a lvreduce operation.

The way to do it is to create a new logical volume of the correct size and then copy data into the new lvol.

The reason you do it this way is because a new file system is the only time that data will be written in a contiguous or sequential manner, from address zero up to its max, without big holes.

If you don't have room in the current volume group then use a temporary file system in another vg, and then lvreduce the old lvol and newfs it and copy from temp to old.

Your other alternative is to defrag the old lvold several times before reducing it. But this is not guaranteed like the above.
Support Fatherhood - Stop Family Law
Michael Steele_2
Honored Contributor

Re: How to update the VG after reducing size of some logical volumes

BTW - If I were you then I'd resize the filesystem back to what it was as more than likely you loast any data out at the end of the lvol since it is now unaccessiable to the O/S and therefore lost.

However, I've made this mistake before and the data should still be there, so regrow the filesystem back to what it was.

Once you've done this, then see the above.

You're not in a good place, in my opinion. I hope you took a backup.
Support Fatherhood - Stop Family Law