Admin Alert: How Big is My IFS?
November 14, 2007 Joe Hertvik
I recently had to quickly determine the size of my production box’s AS/400 Integrated File System (IFS) when its DASD usage zoomed past its ASP threshold value and was threatening to crash the system. Since I didn’t have a good technique handy, I evaluated several different IFS evaluation methods on the fly. Here’s what I learned and how to use these methods to locate where your big IFS folders live.
Free Tools in Different Packages
Due to my cheap nature and even more limited budget, I usually gravitate toward what IBM and the Internet can offer. For determining IFS folder size, I was pleasantly surprised to find four different tools that all seem to do the job in different ways.
Each of these techniques has its advantages and disadvantages, as well as their own difficulties in usage. Here’s a quick overview of how to use each method. You may want to keep this list handy in case you need to investigate IFS folder size in an emergency.
Downloading a Solution
For several i5/OS releases, IBM offers a downloadable set of IFS tools called IFSTOOL. Being an older set of utilities, many of these tools have been incorporated into recent editions of i5/OS. However, there is one callable program named Query IFS Library (QRYIFSLIB) that’s valuable for dumping lstat information for IFS files and directories into a native i5/OS file. Once this information is in a file on your System i box, you can collate all the files sizes for particular folders or for the entire IFS and determine how much space is being taken up by those objects.
QRYIFSLIB can be run with a number of different parameters and it can retrieve information from the IFS Root directory (/) or from any other IFS based directory. I found that I could retrieve all the stream file and directory information for the root (/) by calling QRYIFSLIB with the following parameters:
CALL PGM(QRYIFSLIB) PARM('/*' 's' 'X:*NONLOCAL')
The first parameter (‘/*’) designates that you want the program to start at the root (/) of the IFS. The second parameter (‘s’) tells the program to process information for all the sub-folders under the designated folder. But the key to running this program for the Root (/) of the IFS is the third parameter (‘X:*NONLOCAL’). This parameter tells QRYIFSLIB to just retrieve information for the stream file portion of the IFS and to ignore all the other IBM supplied directories, such as /QSYS.LIB, /QNTC, /QOPT, and /QDLS, so that it only retrieves information from the IFS root (/) folder. By default, the information is written to file QRYIFSLIB in the QGPL library, but the program provides a parameter that allows you to override that setting and to store the file in another library on your system.
The nice thing about QRYIFSLIB is that it runs very fast. It uses the Qshell interpreter to retrieve and write the information, and the total retrieval time for gathering information from my system’s entire root directory was less than a minute.
The IFSTOOL toolset can be downloaded as a save file from this IBM FTP site. Information on using the tools (including QRYIFSLIB) can be found in IBM Software Technical Document 19175649, Integrated File System Tools: DEL, DELTREE, CMDALL, CHGAUTALL, CHGOWNALL, QRYIFSLIB, DLTIFSF, RNMIFSF.
Using IBM’s Editor
Another nice quick way to find the size of any IFS directory is to use i5/OS’ stream file and database editor, the Edit File command (EDTF). EDTF allows you to display all the files and directories under the root (/) of the IFS by running the following command:
Once the directories are displayed, you can place an option “6=Path Size” in front of a specific directory and the command will calculate and display the size of that folder and the number of sub-directories and files that the folder contains. By starting at the Root (/) folder, you can quickly determine which IFS directories are the largest on your system and then take whatever actions are needed to cut down the directory size, if necessary.
The biggest downside of using EDTF to calculate IFS directory sizes is that there isn’t any option to dump the results into an i5/OS file for later evaluation. All the directory and file sizes retrieved by EDTF are only available on the EDTF screen. To download files to an i5/OS file, you’re better off using one of the other methods.
Using OpsNav To Find IFS Directory Sizes
You can use iSeries Navigator’s (OpsNav) point and click functionality to get cumulative sizes for IFS root (/) directories. To get the size of any IFS directory and its corresponding sub-directories, run OpsNav and open the File Systems→Integrated File System→Root node of the System i box that you are trying to retrieve IFS directory sizes for. Right-click on any directory that you want to see the size of, select Properties from the pop-up menu that appears, and OpsNav will calculate the size of all the files and sub-directories contained under the directory that you are examining.
In my experience, I’ve found that the OpsNav technique works well when calculating the size of sub-directories under the IFS root (/). However, it doesn’t work as well if you’re using it to calculate the size of the entire IFS root (/) directory. When you right-click on the File Systems→Integrated File System→Root entry, OpsNav will start to calculate the entire size of the IFS. However, this calculation could take a long time to finish depending on what other activity is going on with your system or how full your disk is at the time you are running the command. On the plus side, when calculating the IFS root (/) size this way, OpsNav automatically filters out the sizes of the other i5/OS file systems (QSYS.LIB, QDLS, QOpenSys, etc.) because those file systems are set up under separate entries under the OpsNav Integrated File System node.
Submitting a Command To Qshell
You can also submit a command to the Qshell command interpreter in order to find the size of an IFS directory and all its sub-directories and to dump that information into a source file member of your choosing. To do that, you would execute a command on the green-screen in the following format:
QSH CMD('ls -l /ifs_dir >
Where /ifs_dir refers to the IFS folder that you want to retrieve information for, and library_name, source_file_name, and member_name refer to the library, source file, and member name of the source file that you want to write the information out to. Once the command is entered, it retrieves information about the directory and the first-level sub-directories that it contains, directory authority settings, allocated size of each directory listed, and the dates that each directory was created.
If you want to run this command to retrieve information for the directory and all of its first- and second-level sub-directories, you can run the command this way:
QSH CMD('ls -l /ifs_dir/* >
The downside to using Qshell is that it’s easily the most unreliable of the four methods that I’m reviewing in this article. In testing, these statements would frequently provide incomplete information, such as not listing out all the sub-directories under my target directory. It would also sometimes incorrectly identify sub-directory names when running the command with the /ifs_dir/* option. Since I’ve seen this command written up in other articles, it may be that I’m missing current-level PTFs to run the command properly and that you may be able to get it to work on your system. However, since I wasn’t successful in using it to solve my problem, I recommend that you approach this command with caution.
One Path, Four Roads
So with just a little bit of effort, you can find and execute these tools to evaluate how large your IFS is and what folders are making it expand. It’s a handy list to keep around in case your disk space starts rapidly filling up and you have to quickly determine whether the culprit is one of the directories in your IFS.
Correction: Another i5/OS High Availability Vendor I Forgot
In the past month, I’ve written two articles on System i High Availability products where I’ve mentioned different solutions offered by Vision Solutions (MIMIX HA, iTera HA, and ORION HA), the DataMirror products offered by IBM, and Remote Software Facility (RFS) 8.1 from Bug Busters Software Engineering. But I forgot to mention another System i High Availability vendor: Maximum Availability and its *noMAX line of products. So when you’re evaluating these solutions for your System i needs, be sure to also check *noMax along with the other products.
About Our Testing Environment
Configurations described in this article were tested on an i5 550 box running i5/OS V5R3. Most of the commands shown here are also available in earlier versions of the operating system running on iSeries or AS/400 machines. If a command or function is present in earlier versions of the i5/OS or OS/400 operating systems, you may notice some variations in the pre-V5R3 copies of these commands. These differences may be due to command improvements that have occurred from release to release.