Tuesday, August 21, 2007

HP-UX, bdf, du and ...

If you ever encounter a file system full, say, at this particular partition:
[ROOT gitu2]Z24/X41 # uname -a
HP-UX gitu2 B.11.11 U 9000/800 170187401 unlimited-user license
[ROOT gitu2]Z24/X41 # bdf /usr/sap/Z24/X41
Filesystem kbytes used avail %used Mounted on
/dev/vg00/lvol30 4620288 4610752 9038 100% /usr/sap/Z24/X41
[ROOT gitu2]Z24/X41#

and you have been trimming, deleting files like crazy, say, you've delete a 1.7G file but when you issue bdf, the utilization still at 100%. But when you checked with du, it shows the current utilization on that particular partition/directory has been reduced. WTF?!

Don't worry dude/dudette. Basically, there are some processes running that currently writing on some files on that directories and until those processes are stopped finishing writting you will not see the free space in bdf.

To identify the processes, run this:
[ROOT gitu2]Z24/X41 # fuser -cu /usr/sap/Z24/X41
/usr/sap/Z24/X41: 7314co(z24adm) 15790co(z24adm) 24426co(z24adm) 10374co(z24adm) 8094mcto(z24adm) 10514co(z24adm) 24418co(z24adm) 24433co(z24adm) 24458co(z24adm) 24432co(z24adm) 24446co(z24adm) 22457co(z24adm) 24385co(z24adm) 12656co(z24adm) 24444co(z24adm) 24439co(z24adm) 24442co(z24adm) 24451co(z24adm) 24438co(z24adm) 24386co(z24adm) 26313co(z24adm) 4756co(z24adm) 24428co(z24adm) 24435co(z24adm) 17512co(z24adm) 24459co(z24adm) 20846co(z24adm) 24431co(z24adm) 24460co(z24adm) 9184co(z24adm) 3585co(z24adm) 24440co(z24adm) 24448co(z24adm) 24417co(z24adm) 24430co(z24adm) 24443co(z24adm) 24338c(z24adm) 24441co(z24adm) 12555co(z24adm) 24461co(z24adm) 24434co(z24adm) 24436co(z24adm) 24445co(z24adm) 24429co(z24adm) 4539c(root) 24437co(z24adm) 11852co(z24adm) 24449co(z24adm) 24450co(z24adm) 26830co(z24adm) 28242c(root)

[ROOT gitu2]Z24/X41 #

Ah-ha! It will listed all the eeeviiilll processes. What you need to do is kill all those processes and voila!, you'll get your free space back.

Don't simply kill the processes until you pretty sure it is safe to kill with the owner of the processes (backup team, or whatever). Use j00r brain d00dz.

No comments: