Operating System - HP-UX
1833788 Members
2643 Online
110063 Solutions
New Discussion

Reducing logical volume...

 
SOLVED
Go to solution
DC.
Occasional Contributor

Reducing logical volume...

Dear HP-UX gurus,
Would really appreciate your advice the steps to reduce a size of logical volume:

Before some time, i was try to reduce logical volume, at that time it gone corrupted.
I have to reduce one logical volume again. can you please suggest what should i do from first. note that i haven't such a time for backup and restoration. and no extra space to copy that data.

hope to hear from you. looking forward for your awaiting reply.

Thanks
Piyush
7 REPLIES 7
Geoff Wild
Honored Contributor

Re: Reducing logical volume...

First thing you do - ensure you have a good backup.

Then, with Online JFS:

fsadm -b M /mountpoint
lvreduce -L /dev/vgXX/lvolX


Example - decrease /tmp from 2GB to 1GB

fsadm -b 1024M /tmp
lvreduce -L 1024 /dev/vg00/lvol4

Rgds...Geoff

Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Steven E. Protter
Exalted Contributor
Solution

Re: Reducing logical volume...

Shalom Piyush,

To do this at all, you need Online JFS, otherwise your only option is to back up the data, remove the logical volume, rebuild and restore.

There are good instructions on how to use fsadm to do what you wish in the first post.

Caveat. If you try and reduce too much, this can lead to failure and data corruption.

Always take a full backup prior to reduction.

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: Reducing logical volume...

Hi:

The key is to reduce the size of the _filesystem_ contained within the logical volume, first.

If you don't have OnlineJFS (and I hope you do), then you must backup the filesystem; 'lvreduce' (or 'lvremoved and 'lvcreate') the logical volume; 'newfs' the filesystem and reload the data from the backup.

If you have OnlineJFS, use 'fsadm' to reduce the size of the filesystem; THEN use 'lvreduce' to reduce the corresponding size of the container --- the logical volume.

See the manpages for more information.

Regards!

...JRF...
Hasan  Atasoy
Honored Contributor

Re: Reducing logical volume...

hi piyush ;

it is not possible without online jfs.


Hasanç
Tim Nelson
Honored Contributor

Re: Reducing logical volume...

If using online JFS you need to also run the defrag before executing any reductions. read man fsadm_vxfs ( dD and eE options )

As mentioned it is much safer to create a new smaller FS, move your data, then delete the old one. ( or send the data to tape, delete and recreate the smaller and restore ).

Bill Hassell
Honored Contributor

Re: Reducing logical volume...

You cannot reduce the size of a logical volume that has a filesystem without the optional product called Online JFS. IF you do not have this product installed, you will have to purchase the product , then you can follow the advice above using fsadm. Check for this product with:

swlist -l product OnlineJFS

There is no other way to reduce a filesystem without a backup and restore.


Bill Hassell, sysadmin
Bill Hassell
Honored Contributor

Re: Reducing logical volume...

You cannot reduce the size of a logical volume that has a filesystem without the optional product called Online JFS. IF you do not have this product installed, you will have to purchase the product , then you can follow the advice above using fsadm. Check for this product with:

swlist -l product OnlineJFS

There is no other way to reduce a filesystem except a backup, lvremove, lvcreate and newfs, then a restore.


Bill Hassell, sysadmin