Operating System - HP-UX
1829010 Members
2493 Online
109986 Solutions
New Discussion

Calculate the disk space. Please help.

 
Chin Meng
Occasional Advisor

Calculate the disk space. Please help.

Dear all HP-UX experts.

Here I have encountered a problem that I wanted to calculate the disk space that I have remain but I don't know more the commands in checking the disk space.

We have eight pieces of hard disk 8GB and one piece of hard disk 4GB. I am novice in HP-UX 11 64 bits. My question is, how do I manage the disk space?? interm of disk sapce I would know the remaining disk space now.

Below is my disk space configuration:-

Filesystem kbytes used avail %used Mounted on
/dev/vg00/lvol3 86016 83322 2598 97% /
/dev/vg00/lvol1 67733 33753 27206 55% /stand
/dev/vg00/lvol8 614400 474175 131711 78% /var
/dev/vg00/lvol7 675840 386301 271502 59% /usr
/dev/vg00/lvol4 135168 8925 118390 7% /tmp
/dev/vg00/lvol6 770048 584100 174432 77% /opt
/dev/vg00/lvol5 258048 167485 84950 66% /home
/dev/vg01/lvol1 520192 369587 141205 72% /informix
/dev/vg07/lvol1 3145728 2308313 787447 75% /baan4
/dev/vg07/lvol2 4194304 1791326 2252880 44% /baandump

Thank to all expert.
6 REPLIES 6
Denver Osborn
Honored Contributor

Re: Calculate the disk space. Please help.

To see how much disk space is unused and could be allocated to a filesystem, use the vgdisplay command.

# vgdisplay /dev/vg02
PE Size (Mbytes) 4
Free PE 25

With the above example I would have 100MB of disk space in vg02 that is not used. I could extend a logical volume and filesystem by as much as 100MB if I needed.

Is this what you were looking for?

-denver
Denver Osborn
Honored Contributor

Re: Calculate the disk space. Please help.

As an additional note for your root filesystem being 97%. You won't be able to lvextend/extendfs it. If unable to free up space in root you could reinstall the OS or use a make_recovery tape.

You might want to look in your dev directory for anything that shouldnt belong. This find command will list any non-device files in /dev. It might be good to see if anyone may have had a type-o when backing up to tape device.

# find /dev -type f -exec ll {} \;
Chin Meng
Occasional Advisor

Re: Calculate the disk space. Please help.

Thanks Denver,

Since I have total of 7 /dev/vg00/ may further know in HP-UX command then the total sum of disk space that belong to /dev/vg00/ .

And another question is How do I check the physical volume of hard disk that remaining now. As I said I have eight pieces of 8Gb hard disk and one piece of 4Gb hard disk. My company had bought two HP9000 servers. One is K class and another is V class. Both sharing the disk space that used MC/Service Guard.

Where do I check the physical hard disk?
I really cropped up now.

Thank for you help.
Denver Osborn
Honored Contributor

Re: Calculate the disk space. Please help.

To get a view of what disks are on the system use ioscan.

# ioscan -fnCdisk

To see which of the drives from the ioscan are used in VGs compare it to whats in the lvmtab.

# strings /etc/lvmtab

Or you could use vgdisplay to view the PVs in the VG.

# vgdisplay -v /dev/vg00 |more

At the end of the verbose vgdisplay output will show you "--- Physical volumes ---"

Some other commands that might interest you would be pvdisplay and diskinfo.

# pvdisplay /dev/dsk/c0t6d0
# diskinfo /dev/rdsk/c0t6d0

There's a lot of information around that should be able to help you with finding what you need to get the task accomplished. The forums are a good place to start but don't overlook those man pages. The trouble is finding the commands you need.

Hope this helped!

-denver
Victor BERRIDGE
Honored Contributor

Re: Calculate the disk space. Please help.

Hi Chin,
I would use
bdf, (you know already)
vgdisplay -v it will tell you occupation per logical volume + which disks are in the group
du -ks to know the usage within a file system.
Im more concerned by your / at 97%...
What have you in / to occupy so much? in an ordinary config you would have about 30-35 Mb in /
Look for core files, look in /dev if you have no big files around (like /dev/tape...)

Good luck
Best regards
Victor
Rhonda Thorne
Frequent Advisor

Re: Calculate the disk space. Please help.

Here is a script I use that goes out and finds all of your vg's and finds free space in them.

Try it out and see if this helps. Caviat....if you have disks that have not been added to a vg yet, these free disks will not be included.

integer free_mb
typeset -R6 total free free_mb_txt
typeset -R2 size

for i in $(ls -d /dev/vg*)
do
vg=${i%/}
set -- $(/usr/sbin/vgdisplay $vg | egrep -i "free|total|size")
size=$4;total=$7;shift;free=$9
free_mb=$size*$free
free_mb_txt=$free_mb
echo "$vg: PE size: $size, Total PE: $total, Free PE: $free, Free MB: $f
ree_mb_txt"
done


Rhonda
Sharing my knowledge of UNIX flavors