Wednesday, August 14, 2024

Who Stole my IBM i Disk Space ?

Solve Your IBM i Disk Use Issues with FREE Disk Utility
In some of my previous roles I often played an extra part as Disk Cop. This often meant scouring through thousands of libraries and directories to find large files and determining who owned them and why they were being kept online. If you understand the phenomena of the ever-growing disk usage you know why Cloud platforms have grown exponentially. It's because storage use never goes down. This post will introduce you to a FREE solution for handling your disk space woes. 

Most likely you might have these disk space questions:  

I need to check ALL the disk space on my IBM i?  

I can't seem to get a handle on our IFS files and I wonder what's taking up space?

The domain of checking free disk space used to belong to commercial utilities or the GO DISKTASKS menu, which was limited to locating only libraries. Let me introduce you to the Ncurses Disk Utility (ncdu). Ncdu is part of the open-source packages available for IBM i. To install ncdu from the PASE or SSH command line simply type: yum install ncdu  Or you can install ncdu from the Open-Source Package Management option in ACS.

After installation, simply change to the appropriate directory and type: ncdu or /QOpenSys/pkgs/bin/ncdu (if the open-source package binary directory is not in your file search path) from an SSH terminal command line. Ncdu must be run from an SSH terminal via putty or your favorite SSH terminal tool.

Listing Free Disk Space for a Single Library
After installation, go to an SSH terminal and log in to the command line and run the following command to check out the QGPL library and show the list of objects descending by size. Libraries exist as a directory inside of the /QSYS.LIB directory. 

ncdu /QSYS.LIB/QGPL.LIB


ncdu results for QGPL - largest objects in use at top in descending order
ncdu results for QGPL - largest objects in use at top in descending order 


After the object list is shown you can use the arrow keys to navigate the list of library objects IFS-style and determine which of them are the largest in-use objects. You can also type a question mark: ? to display options available. If you're brave enough you can use the d option to delete offending objects, but it might be safer to use this tool to identify large objects and delete them another way. It's up to you how you use the app. You have been warned to be careful when deleting objects!

Listing Free Disk Space for the entire IFS Root File System
You can also crawl the entire root / file system on your IBM i partitions using the following command:

ncdu /

It may take a few minutes to get an object list, but you now have a full picture of ALL the directories and libraries (everything under /QSYS.LIB) on your system. 


ncdu root / list results - largest objects in use at top in descending order
ncdu root / list results - largest objects in use at top in descending order

Once again you can navigate through the directories to locate offending objects and decide what to do with them. 

That's it. Start policing your IBM i disk space. 

ncdu is a great forensic analysis tool for determine large objects in use. Let me know if you find value in this tool. I surely have. 

This link on learning ncdu might also be helpful: 

This link points to some ncdu export processing examples

If your team needs mentoring or learning how to use ncdu or automatically monitoring disk utilization, or if your team needs help with process modernization discovery, training, mentoring and integration services, reach out and let's talk about your business automation pain points. Your team will be on track to streamlining and modernizing your
IBM i processes in no time. 



No comments: