Operating System - HP-UX
1832235 Members
2830 Online
110041 Solutions
New Discussion

How do i reduce the size of a logical volume?

 
SOLVED
Go to solution
Yogeeraj_1
Honored Contributor

How do i reduce the size of a logical volume?

Hello experts,

A rather silly question, but i prefer to ask before attempting something irreversible.

I have a mirrored logical volume to which i had overallocated space. I want to reduce its size by at least 1GB.

Filesystem kbytes used avail %used Mounted on
/dev/vg01/lv_d05 8388608 6593416 1739112 79% /d05

Anyone can you please give the detailed steps.

NB. The file system has application runtimes that are almost always in use.

thank you very much for your replies

kind regards
yogeeraj

No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
6 REPLIES 6
Vincent Farrugia
Honored Contributor
Solution

Re: How do i reduce the size of a logical volume?

Hello,

You cannot reduce the file system unless you have OnlineJFS and JFS ver. 3.3 . In order to do it the "normal" way, backup up the lvol, then perform:

lvreduce -L /dev/vg##/lvol#

then newfs -F vxfs /dev/vg##/rlvol#

then restore the data to the new reduced lvol.

HTH,
Vince
Tape Drives RULE!!!
Andrei Petrov
Advisor

Re: How do i reduce the size of a logical volume?

Hi

If you don't want to unmount/mount filesystem you can try
fsadm -F vxfs -b /d05
lvreduce -L /dev/vg01/rlv_d05

Andrei



harry d brown jr
Honored Contributor

Re: How do i reduce the size of a logical volume?

You might get lucky with lvreduce, but if there is anything residing in the area that will be reduced then it will fail.

The safest way is to back up the LV TWICE. delete it. recreate it with the appropriate size. then restore yor data.

live free or die
harry
Live Free or Die
Deshpande Prashant
Honored Contributor

Re: How do i reduce the size of a logical volume?

HI
Safest way will be backup the data, delete and recreate the LV with required size.
If you have Online JFS & JFS 3.3, defrage the file system first (#fsdam -F vxfs -DEde ) then try reducing LV.
In either case do not forget to backup before trying to reduce file system.

Thanks.
Prashant.
Take it as it comes.
Bill Hassell
Honored Contributor

Re: How do i reduce the size of a logical volume?

As mentioned, the preferred way to reduce a filesystem is to backup the data, delete and recreate. Since your application(s) use this volume, you must first shutdown and reboot interactively into single user mode. Then perform the backup.

If you backup while the application is still running, there is a high probability that datafiles will change during the backup and data dependencies will be corrupted when the filesystem is restored.

Reducing a filesystem size should always be assumed to be destructive, even when using the optional Online JFS code. By following this rule, you will always be prepared for a restore.


Bill Hassell, sysadmin
James Burn
Occasional Contributor

Re: How do i reduce the size of a logical volume?

If after all this, your logical volume size
has been successfully decreased, is that
given-up space now free (in the group)
to be added to other volumes?
All my groups show 'Free PE 0', but I have
too much free space in some volumes, and I
want to move it around.