Disk is full: find out who is using it

Disk is full, and you need to know who is using it, fast. The usual instinct is to hunt through libraries for big objects, but a faster first cut is to see which user profiles use the most storage on the system.

SELECT AUTHORIZATION_NAME,
      STORAGE_USED,
      MAXIMUM_STORAGE_ALLOWED
 FROM QSYS2.USER_STORAGE
 ORDER BY STORAGE_USED DESC
 FETCH FIRST 20 ROWS ONLY;

That gives you your twenty biggest storage consumers by profile, and it very often points straight at the problem. A single profile holding an enormous amount of storage is usually a story: an application user that has accumulated years of work files, a developer profile stuffed with copies of production data, a service account that has quietly become a landfill.

Two things make this a great first move when storage is tight. It is fast, because it summarizes by profile instead of walking every object on the system. And it reframes the question productively, because “which user owns the disk” is often a more useful question than “which object is biggest.” The biggest object might be a legitimate production file you cannot touch. The profile sitting on two hundred gigabytes of old work files is a conversation you can actually have.

There is a security angle too, which is worth a glance while you are here. A user profile holding far more storage than its role would suggest is worth understanding. Sometimes (Ok, most times) the answer is that data is living somewhere it shouldn’t.

Next time storage climbs, start here. Find the profiles that own the most, understand why, and you will usually find your reclaimable space faster than by hunting object by object.

Originally posted on LinkedIn. Join the conversation there.

Get new posts by email

Practical IBM i tips on SQL services, security and backup, sent when I publish. No spam, unsubscribe anytime.

Leave a Reply