Operating System - HP-UX
1748052 Members
4705 Online
108758 Solutions
New Discussion юеВ

Re: using "lvresize, lvextend and lvreduce"

 
SOLVED
Go to solution
senthil_kumar_1
Super Advisor

using "lvresize, lvextend and lvreduce"

Hi

I want more information about these commands

1) is "lvresize" is used to increase / decrease the Logical volume size?

2) lvexted is extending the size of logical volume.

3) lvreduce is reducing the size of logical volume.

4) is it possible to reduce the size. If yes, then how much size we can reduce in a single logical volume.

5) do we have to excute this command "# extendfs /dev/vg00/rlvol1" whenever we are using above commands.

7 REPLIES 7
Taifur
Respected Contributor

Re: using "lvresize, lvextend and lvreduce"


Hi Senthil,

You can check below link for details for lvextend, lvreduce as follows

http://docs.hp.com/en/B2355-90691/lvextend.1M.html


Rgds//
Taifur
Robert-Jan Goossens
Honored Contributor
Solution

Re: using "lvresize, lvextend and lvreduce"

Hi,

1) is "lvresize" is used to increase / decrease the Logical volume size?

The lvresize does not exist on the HPUX platform.

2) lvexted is extending the size of logical volume.

Correct, there are two situations;
-1- if you have online JFS installed and you have license for online JFS, you can extend a lvol/filesystem online
-2- If you don not have online JFS installed, you need to umount the filesystem before you can extend it.

3) lvreduce is reducing the size of logical volume.

Correct again, same principal as above, keep in mind that if you use lvreduce you first need to defragment your filesystem.

4) is it possible to reduce the size. If yes, then how much size we can reduce in a single logical volume.

You can reduce the filesystem to the size currently being used in the filesystem.

5) do we have to excute this command "# extendfs /dev/vg00/rlvol1" whenever we are using above commands.

yes and no, the new command to change the size for the filesystem on the logical volume is fsadm, have a look at the man pages.

Regards,
Robert-Jan
Sharma Sanjeev
Respected Contributor

Re: using "lvresize, lvextend and lvreduce"

Hi Senthil

1) is "lvresize" is used to increase / decrease the Logical volume size?

Ans : lvresize No Command in HP-UX

2) lvexted is extending the size of logical volume.

Ans : Yes, Lvextemd will extend the Logical Volume

3) lvreduce is reducing the size of logical volume.

Ans : Yes, Lvreduce will reduce Logical volume

4) is it possible to reduce the size. If yes, then how much size we can reduce in a single logical volume.

Ans : Yes, u can reduce the LV Size Depends on you how much u want to reduce

5) do we have to excute this command "# extendfs /dev/vg00/rlvol1" whenever we are using above commands.

Ans : extendfs if you are extending LV and not having ONLINE JFS installed, If ONLINE JFS is installed u can use fsadm

Regards
Sanjeev
Everything is Possible as " IMPOSSIBLE" word itself says I M POSSIBLE
щ╗ЮчЗГ
Valued Contributor

Re: using "lvresize, lvextend and lvreduce"

1)lvresize is being used in linux, not sure in hp-ux.

2)lvextend used to increase the lv size.
the syntax would be;

lvextend -l 500 /dev/vg01/lvol - Increase the number of the logical extents of a logical volume to 500
lvextend -L 500 /dev/vg01/lvol - Increase the logical volume size to 400 MB
lvextend -m 1 /dev/vg00/lvol /dev/dsk/cxtydz - Mirror a logical volume onto a particular physical volume

3)lvreduce used to decrease space allocation or the number of mirror copies of logical volumes.

the syntax is ,

lvreduce -l 100 /dev/vg01/lvol7 - Decrease the number of the logical extents of a logical volume to 100.
lvreduce -m 1 /dev/vg01/lvol11 - Reduce to one mirror (that is, an original and one copy) for each logical extent of an LV.

4)Please take a full backup o fthe filesystem before reducing.The minimum size of an LV is 0MB.

5)After the lvextend; extendfs can be used to increase the capacity of a file system by updating the file system structure to

include the extra space.

eg:-

To increase the capacity of a file system created on a logical volume,enter,

umount /dev/vg00/lvol1

lvextend -L larger_size /dev/vg00/lvol1

extendfs -F hfs /dev/vg00/rlvol1

mount /dev/vg00/lvol1 mount_directory
Man's mind, once stretched by a new idea, never regains its original dimensions
щ╗ЮчЗГ
Valued Contributor

Re: using "lvresize, lvextend and lvreduce"

Hi Senthil,
Also have a look on this thread;

http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=874571

This is about increasing a filesystem online!
Man's mind, once stretched by a new idea, never regains its original dimensions
Johnson Punniyalingam
Honored Contributor

Re: using "lvresize, lvextend and lvreduce"

1) is "lvresize" is used to increase / decrease the Logical volume size?

If I am not wrong "Its used in Linux" in HPUX "lvextend"

2) lvexted is extending the size of logical volume.

yes. steps to extending the logical volume

1. check "Free space" to extend the "Logical volume" by using "vgdisplay" on which the Logical volume reside

Free PE * PE Size = free space (MB)

2. lvextend -L 1000 /dev/vgxx/lvolxx
3. fsadm -F vxfs -b 1000M /

if you d'not have online -Jfs " you need umount the

# extendfs -F vxfs /dev/vgxx/rlvolxx
# mount -a


3) lvreduce is reducing the size of logical volume.

Yes,

you need to do "defragmetation" and than only "you can "lvreduce"


4) is it possible to reduce the size. If yes, then how much size we can reduce in a single logical volume.

size "depends" how much you want to resize"

http://docs.hp.com/en/6054/LVM_Limits_White_Paper_V4.pdf


5) do we have to excute this command "# extendfs /dev/vg00/rlvol1" whenever we are using above commands.

Check the Answer for Question (2)

Thans,
Johnson
Problems are common to all, but attitude makes the difference
Rahul Rai_1
Frequent Advisor

Re: using "lvresize, lvextend and lvreduce"

Hi Senthil,

1) is "lvresize" is used to increase / decrease the Logical volume size?

Ans:- As above answer.

2) lvexted is extending the size of logical volume.

Ans:- Yes lvextend will increase lv size,and you can extend the lv online in one situation if you have online JFS on ur server,

but befor that u have to check the free size

enter this command,
#vgdisplay with vgname
then calculate
#bc
#PE size* free PE //size will be in mb

lvextend -l 500 /dev/vg01/lvol

if u r using -l it will increase the logical extents, le is a pointer in kernel to PE.

lvextend -L 500 /dev/vg01/lvol

-L will increse the lv size and size will be in mb, u can calculate it from this link

http://egret.net/kb__mb.htm

and after that you have to increase ur fs
fsadm -F vxfs -b size(in kb) mount point

if you d'not have online JFS you need umount the filesystem
#unmount
# extendfs -F vxfs /dev/vgxx/rlvolxx
# mount -a

3) lvreduce is reducing the size of logical volume.

Ans.Yes

4) is it possible to reduce the size. If yes, then how much size we can reduce in a single logical volume.

Ans. According to ur fs size, u can reduce.

5) do we have to excute this command "# extendfs /dev/vg00/rlvol1" whenever we are using above commands.


Ans. If u did not have online JFS.

Regards,
Rahul Rai