- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- calculating total and free disk space on a system
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-22-2009 08:24 AM
тАО07-22-2009 08:24 AM
Is there any script for calculating the total and free disk space left on a HP Unix system
Regards
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-22-2009 08:32 AM
тАО07-22-2009 08:32 AM
Re: calculating total and free disk space on a system
Define "free".
If you mean "free" spaces within mounted filesystems, use 'bdf'. If you mean free physical disk extents within LVM volume groups, start with 'vgdisplay'. If you mean "unused" physical disks, tell us how you know they are truly unused if they could be raw volumes.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-22-2009 08:47 AM
тАО07-22-2009 08:47 AM
Re: calculating total and free disk space on a system
I want to calculate the free space in the VGs.
When we give vgdisplay command we get alloc Pe and Free PE.
I want to calculate the sum of all free space left and total allocated space left in VG.
I am looking for a script to do so
Regards
Amit Manna
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-22-2009 09:03 AM
тАО07-22-2009 09:03 AM
Re: calculating total and free disk space on a system
What output you want exactly. Free disk space in a VG, you can find with vgdisplay command. In a disk, you can find with pvdisplay command. bdf tells you the free space in the FS.
Or, please elaborate your question on what else you need.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-22-2009 09:17 AM
тАО07-22-2009 09:17 AM
Re: calculating total and free disk space on a system
vgdisplay will tell this information only i.e.
Total PE - Total disk space alloted to that VG.
Alloc PE - Disk space allocated to LVs in that VG.
Free PE - Unused Disk space in that VG.
But you need to see the PE size of that VG, which helps you calculate the space in MB. To calculate the space, use the formula:-
Space(MB) = PE Size * No. of PEs
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-22-2009 09:24 AM
тАО07-22-2009 09:24 AM
Re: calculating total and free disk space on a system
do
vgdisplay $a|grep "PE Size"|awk '{print $4}'|read b
vgdisplay $a|grep "Total PE"|awk '{print $3}'|read c
vgdisplay $a|grep "Free PE"|awk '{print $3}'|read d
echo "$a $(b*c) $(b*d)"
done
first column will be vg name second column will be total size of vg and third column will be free space in VG
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-22-2009 09:31 AM
тАО07-22-2009 09:31 AM
Re: calculating total and free disk space on a system
For Calculating Total Disk with & Free Disk Space with the VG.
Please follow the below step.
Run the command vgdiaply
#root # vgdisplay
--- Volume groups ---
VG Name /dev/vg00
VG Write Access read/write
VG Status available
Max LV 255
Cur LV 17
Open LV 17
Max PV 16
Cur PV 4
Act PV 4
Max PE per PV 4384
VGDA 8
PE Size (Mbytes) 4
Total PE 17394
Alloc PE 6019
Free PE 11375
Total PVG 2
Total Spare PVs 0
Total Spare PVs in use 0
Cur PV - 4 - Means 4 Disk are using with the VG00
Free PE - 11375 - Means Free space Avilable on the VG.
For Calcuting the Total Free Space in the VG
is.
PE Size * Free PE = Total Free Space
Example - 4*11375 = 45500 is the Free Space in the VG
Thanks
Vinod Kumar Yadav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-22-2009 09:40 AM
тАО07-22-2009 09:40 AM
Re: calculating total and free disk space on a system
vgdisplay|grep "VG Name"|awk '{print $3}|'|while read a
do
vgdisplay $a|grep "PE Size"|awk '{print $4}'|read b
vgdisplay $a|grep "Total PE"|awk '{print $3}'|read c
vgdisplay $a|grep "Free PE"|awk '{print $3}'|read d
echo "$a $((b*c)) $((b*d))"
done
first column will be vg name second column will be total size of vg and third column will be free space in VG
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-23-2009 03:47 AM
тАО07-23-2009 03:47 AM
Re: calculating total and free disk space on a system
Regards
Amit Manna
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-23-2009 06:36 AM
тАО07-23-2009 06:36 AM