1751872 Members
5273 Online
108782 Solutions
New Discussion юеВ

Re: reduce lvol3

 
SOLVED
Go to solution
silusan
Regular Advisor

reduce lvol3

can we reduce lvol3 size?

can we reduce lvol9 size?

 

There is a lot of space in the (virtual disk) PV used for VG00, but still I need to reduce it - as the specification document demands it.

 

 # bdf
Filesystem          kbytes    used   avail %used Mounted on
/dev/vg00/lvol3    6345456  230552 6013656    4% /
/dev/vg00/lvol1    1576544  529144 1035616   34% /stand
/dev/vg00/lvol8    8385438 2356592 5985520   28% /var
/dev/vg00/lvol9    13452912   20196 11777682    0% /var/adm/crash

 

thank you

6 REPLIES 6
Dennis Handly
Acclaimed Contributor

Re: reduce lvol3

> can we reduce lvol3 & lvol9 size?

 

It does seem like you have way too much space on them.  Especially for crashdumps.

arunthoray
Occasional Advisor

Re: reduce lvol3

 

You can reduce the size of  Lvol using lvreduce command,but before that you have to take the backup of the filesystem as reducing the size of LV will corrupt the data

Bill Hassell
Honored Contributor
Solution

Re: reduce lvol3

lvol3 (the / mountpoint) needs to be about 500-700 MB. So yes, it is way too large. BUT you cannot just use lvreduce as it will corrupt the directory, even if you reduce it to 700 MB. The directory MUST be resized first, THEN lvreduce the lvol to match. Otherwise the directory code will have no idea that the lvol has changed sized. This can only be accomplished with the optional product Online JFS. Check the man page for fsadm_vxfs. If there is an option -b for resizing onine, then the task can be done while the system is running:

 

fsadm -b 500m /

lvreduce -L 500 /dev/vg00/lvol3

 

But if you do not have the -b option, you will have to reinstall vg00 using your Ignite backup tape (or network image). The reason is that there is no method to reduce VxFS filesystems without Online JFS.



Bill Hassell, sysadmin
silusan
Regular Advisor

Re: reduce lvol3

 

guest:/ # bdf
Filesystem          kbytes    used   avail %used Mounted on
/dev/vg00/lvol3    6291456  231200 6013000    4% /
guest:/ #
guest:/ #  fsadm -b 2048M /
fsadm: /etc/default/fs is used for determining the file system type
UX:vxfs fsadm: INFO: V-3-23586: /dev/vg00/rlvol3 is currently 6291456 sectors - size will be reduced
guest:/ # bdf
Filesystem          kbytes    used   avail %used Mounted on
/dev/vg00/lvol3    2097152  231064 1851600   11% /
guest:/ # lvreduce -L 2048 /dev/vg00/lvol3
When a logical volume is reduced useful data might get lost;
do you really want the command to proceed (y/n) : y
Logical volume "/dev/vg00/lvol3" has been successfully reduced.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
guest:/ # bdf
Filesystem          kbytes    used   avail %used Mounted on
/dev/vg00/lvol3    2097152  231136 1851528   11% /
guest:/ #


>>Now want to extend the lvol3 back to the original size 6144MB<<

 

guest:/ # lvextend -L 6144 /dev/vg00/lvol3
Logical volume "/dev/vg00/lvol3" has been successfully extended.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
guest:/ #
guest:/ #
guest:/ # cat /etc/default/fs
LOCAL=vxfs
guest:/ #
guest:/ # extendfs /dev/vg00/rlvol3
UX:vxfs extendfs: ERROR: V-3-20144: /dev/vg00/rlvol3 is mounted, cannot extend.
guest:/ # bdf
Filesystem          kbytes    used   avail %used Mounted on
/dev/vg00/lvol3    2097152  231216 1851448   11% /
guest:/ #
guest:/ # extendfs /dev/vg00/rlvol3
UX:vxfs extendfs: ERROR: V-3-20144: /dev/vg00/rlvol3 is mounted, cannot extend.
guest:/ # bdf
Filesystem          kbytes    used   avail %used Mounted on
/dev/vg00/lvol3    2097152  231216 1851448   11% /
guest:/ #

 

 

How to increase lvol3 size now?

 

There is a reason for taking it back to 6gb of / now.

 

please suggest how to acheive this.

Bill Hassell
Honored Contributor

Re: reduce lvol3

extendfs can only be used when the lvol is unmounted. Prior to Online JFS (which you have installed), this was the only tool and cannot work on a mounted filesystem. Since you have Online JFS (fsadm -b is enabled), you extend it with fsadm *BUT* the lvol must be extended first. This creates the space needed for the filesystem to be increased in size. Note also that bdf accepts the name of a mountpoint in order to limit the amount of output:

 

# lvextend -L 6144 /dev/vg00/lvol3

# fsadm -b 6144M /


# bdf /
Filesystem          kbytes    used   avail %used Mounted on
/dev/vg00/lvol3    6291456  231200 6013000    4% /

 



Bill Hassell, sysadmin
silusan
Regular Advisor

Re: reduce lvol3

Thanks.

 

guest:/ # lvextend -L 6144 /dev/vg00/lvol3

lvextend: "LogicalExtentsNumber" is not bigger than current setting.
You have mail in /var/mail/root
guest:/ #
guest:/ #  fsadm -b 6144M /

fsadm: /etc/default/fs is used for determining the file system type
UX:vxfs fsadm: INFO: V-3-25942: /dev/vg00/rlvol3 size increased from 2097152 sectors to 6291456 sectors
guest:/ #
guest:/ # bdf
Filesystem          kbytes    used   avail %used Mounted on
/dev/vg00/lvol3    6291456  231584 6012616    4% /
guest:/ #