1832211 Members
2870 Online
110040 Solutions
New Discussion

Resizing LVMS

 
Amit Dixit_2
Regular Advisor

Resizing LVMS

HI,
I am having single disk with VXFS file system

Filesystem kbytes used avail %used Mounted on
/dev/vg00/lvol3 516096 181104 332408 35% /
/dev/vg00/lvol1 311296 95408 214264 31% /stand
/dev/vg00/lvol8 4710400 91544 4582816 2% /var
/dev/vg00/lvol7 4194304 2029160 2148272 49% /usr
/dev/vg00/lvol4 2097152 30536 2050544 1% /tmp
/dev/vg00/lvol6 4194304 2901856 1282384 69% /opt
/dev/vg00/lvol9 5120000 1202041 3673098 25% /data1
/dev/vg00/lvol5 9011200 64488 8876872 1% /home

I want to increase the size of /opt and reduce the size of /home
Please tell me how should I proceed and the easiest way to do the same.

thanks,
amit
5 REPLIES 5
RAC_1
Honored Contributor

Re: Resizing LVMS

If you have online JFS installed on your machine, you can do that online.

swlist|grep -i JFS

If you doo not have Online JFS installed, you will have to go to single user mode to do this. This is required because, in run level 3, there will be lot of processes accessing the /home and /opt.

Once you are in single user mode, do as follows.

umount /home
umount /opt

lvextend -L "new_size_inMB" /dev/vg00/lvolx
extendfs -F vxfs /dev/vg00/lvolx
Mount and check the new sizes.

Reboot

Anil
There is no substitute to HARDWORK
Francesco Campalastri
Frequent Advisor

Re: Resizing LVMS

If you do no have On Line JFS you should:

1) backup /home and /opt

2) umount /home and /opt (you need to kill some process to umount /opt)

3) lvremove /dev/vg00/lvol5 (home)
4) lvcreate -L "newsmallersize" -n lvol5 vg00

5) newfs /dev/vg00/5lvol5

6) lvextend -L "newlargersize" /dev/vg00/lvol6

7) extendfs /dev/vg00/lvol6

8) mount -a


Good luck
Francesco
john kingsley
Honored Contributor

Re: Resizing LVMS

If you have OnLine JFS, it is very ease to do, and you can do it without unmounting filesystems.

To increase the file system:

lvextend -L lv-size-in-MB /dev/vg00/lvol6
fsadm -b $((MB*1024)) /opt

To reduce the file system:

fsadm -b $((MB*1024)) /home
lvextend -L lv-size-in-MB /dev/vg00/lvol5

Note that when you use fsadm to shring a filesystem, you will receive a warning if any of the blocks are located in outside the new range, but fsadm will move these blocks. So you won't loose data. But, you should still backup the filesystems just in case.
RAJESH GANGADHARAN
Regular Advisor

Re: Resizing LVMS

John,
I think you need to use "lvreduce" for reducing filesystem size, Also we can specify size in MB for fsadm
i.e. for resizing a filesystem to 500MB you can use

fsadm -F vxfs -b 500m

-Raj
Let the choices you make today be the choices you can live with tomorrow.
Todd McDaniel_1
Honored Contributor

Re: Resizing LVMS

I would do the reduce on /home first so you know exactly what amount of space you have left.

Also, I would take a look at your other filesystems incase you need to increase them as well..

Especially IF you will have to go to single user mode to do this..

So long as you backup /home you can merely resize it as the last poster mentioned with Fsadm... that is if you have OnlineJFS loaded and licensed...


One housekeeping thing... I would try to move /home and /data1 off the vg00. It will save you some headaches later if your App ever goes haywire and then it wont be at risk of harming vg00.

I even go so far as to have /tmp on a different LVOL
Unix, the other white meat.