Solved

Find large objects on IFS

Posted on 2013-01-24
2
2,527 Views
Last Modified: 2013-01-24
Is there a way to list all the large files on the IFS for disk clean up purposes?
0
Comment
Question by:roosterup
2 Comments
 
LVL 4

Accepted Solution

by:
rward earned 250 total points
ID: 38814452
There are a couple ways you could go about this.  

The first way is to use the Disk Space collection tool built into OS/400.  In a 5250 session type command: GO DISKTASKS  then take option 1 to collect all disk information.  Once the information has been collected you can use the 2nd option to print the information.  Select the type of report to print as Specific Object then select the object type as *STMF and set the smallest size in bytes you want to list on the report.  

Another way to list files greater than a certain size is to use a shell command.  In 5250 session enter command QSH then use the find command:

find / -type f -size +100000 -exec ls -lrt {} \;|sort -r +4

This will find all files from the root down that are larger than 100000 512bytes blocks and sort the list from largest size to smallest.  You can further use the redirect > to redirect the std output to a text file.

Rob
0
 
LVL 35

Assisted Solution

by:Gary Patterson
Gary Patterson earned 250 total points
ID: 38815484
IBM support article:

http://www-912.ibm.com/s_dir/slkbase.nsf/1ac66549a21402188625680b0002037e/c5f9378a8534995b86256ea000567c97?OpenDocument&Highlight=2,343071214

Good thread on the subject:

http://serverfault.com/questions/77405/how-to-efficiently-find-which-folders-are-filling-the-hard-disk-os-400

If you have PASE installed on your AS/400, you can use the AIX "du" command to find large IFS objects:

For each directory you want to scan (don't start in the root folder):

CALL QP2TERM
> cd /QOpenSys (or whatever folder you want to scan)
> du -a -k | sort -n -r | head -n 20

I'd usually repeat this for all the root-level IFS directories except for QOPT, QSYS.LIB, QFileSvr.400, and QNTC.
 
That will run the du command for the current folder, sort the output, and list the top 20 largest files or directories found.  Directory sizes are recursive, meaning it shows the sum of all the files in that directory and all subdirectories.

Sizes reflect actual disk consumption, and the "-k" option reports in kilobytes.

If you aren't familiar with PASE, it is an AIX execution environment that runs under OS/400 (i5/OS, iOS, i).  Here's info about PASE and qshell (BASH-like command shell for the AS/400):

http://publib.boulder.ibm.com/infocenter/iseries/v5r4/index.jsp?topic=%2Frzahg%2Frzahgshell.htm

And here is a link to the AIX "du" command docs:

http://pic.dhe.ibm.com/infocenter/aix/v6r1/index.jsp?topic=%2Fcom.ibm.aix.cmds%2Fdoc%2Faixcmds2%2Fdu.htm

- Gary Patterson
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
ODBC Issues with Microsoft Access 2010 6 394
Passing Array in RPGLE Free Format 5 1,165
IBM MQ moving messages from error queue 4 149
RAID 1 - Problem with Data 8 89
If you are looking at this article, you have most likely been hit by some version of ransomware and are trying to find out if there is anything you can do, or what way you should react - READ ON!
There's a lot of hype surrounding blockchain technology. Here's how it works and some of the novel ways it' s now being used - including for data protection.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question