1834814 Members
2789 Online
110070 Solutions
New Discussion

Re: calculate free space

 
Ajin_1
Valued Contributor

calculate free space


Dear Sir

How to calculate the free space available , to increase/extend a filesystem in HP-UX

Please Help

Regards

Ajin.S
Thanks & Regards
Ajin.S
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.
7 REPLIES 7
Pete Randall
Outstanding Contributor

Re: calculate free space

Start with bdf, then take a look at lvdisplay and vgdisplay. The bdf command tells you the space used and remaining in the file system. The lvdisplay command tells you whether there is unused space in the logical volume. And the vgdisplay tells you if the volume group has any unused space in which to extend the LV.

That said, you also probably need to look at lvextend and vgextend and newfs or extendfs.


Pete

Pete
subodhbagade
Regular Advisor

Re: calculate free space

HI,

(1)# bdf ( to check free space of LV )

(2)For VG

#vgdisplay -v /dev/vg-name

free space in MB = PE size * free PE

(3)To extend LV ... if there no online JFS

umount /mount-point
#lvextend -L final-size MB /dev/vg/lv

#extendfs -F vxfs /dev/vg/rlvol

#mount /dev/vg/lv /mount-point

(4)If you have online JFS ...

# fsadm -b

No need to unmount the LV



Regards,
Subodh.
R.K. #
Honored Contributor

Re: calculate free space

Hi Ajin,

To calculate the "unused" space in the Vg, use vgdisplay as below:

# vgdisplay vg_name
PE Size (Mbytes) 4 <<<<<<
Total PE 8680
Alloc PE 1000
Free PE 7676 <<<<<<

So the free space available in this Vg is:

Free space = PE Size * Free PE
Free space = 4 * 7676 mb
Don't fix what ain't broke
Jupinder Bedi
Respected Contributor

Re: calculate free space

do vgdisplay vgname

see for free PE and PE size


and do free PE * PE size
All things excellent are as difficult as they are rare
Fabio Ettore
Honored Contributor

Re: calculate free space

Hi,

if you want to check how much space is free in a already mounted filesystem use bdf, see that under the column avail which is in Kb. To know how much space you still have into the volume group multiply PE Size (which is in Mb) for Free PE that you see by vgdisplay. Then extend first lvol by lvextend and then filesystem by extendfs (with filesystem unmounted) or by fsadm (with filesystem mounted, it depends on having OnlineJFS installed).

HTH.

Best regards,
Fabio
WISH? IMPROVEMENT!
Johnson Punniyalingam
Honored Contributor

Re: calculate free space

Step 1:- bdf /file_system -> from "bdf" output you will be knowing which "Volume Group" does current file system exits

Step 2:-vgdisplay -v /dev/vg_name -> from this output look for (Free PE * PE Size) = Free Space left

Step 3:-lvextend -L /dev/vg_name/lvol_name

Step 4:-fsadm -F vxfs -b M /File_System_Name

(using fsadm -> you extend file system ONLINE)

If "don't have ONLINE JFS" use extendfs
Need to umount / downtime required

umount /File_System
lvextend -L /dev/vgXX/lvolXX
extendfs -F vxfs /dev/vgXX/rlvolXX -> raw logical name
mount -a

Finally but important take look man pages for below commands for more information

man bdf
man vgdisplay
man lvextend
man fsadm
man extendfs
man mount
Problems are common to all, but attitude makes the difference
madhuchakkaravarthy
Trusted Contributor

Re: calculate free space

Hi,


I have assigned points to 6 of 28 responses to my questions.

If you satisfied with the answer and your problem got solved then please make a habit to assign points,
Those people who give there valuable time for your problem they should expect some apparition from you in terms of points.

To know how to assign points please go through the below link

http://forums13.itrc.hp.com/service/forums/helptips.do?admit=109447627+1256027208667+28353475#33

Thanks