Thursday, August 21, 2025

Additions to the SYSDISKSTAT

SYSDISKSTAT returns the information about disk and solid-state drives, SSD. It comes in two forms:

  • SYSDISKSTAT View
  • SYSDISKSTAT Table function

I am not going to say much more about using these two as I gave a lot of detail when they were first introduced.

In the latest release IBM i 7.6 and 7.5 TR6 two new columns have been added to both of the SYSDISKSTAT:

  1. BLOCK_SIZE:  Size of each page on the disk unit.
  2. UNMAP_CAPABLE:  Can the disk unit perform the unmap function to return the unused pages to the unallocated area? Allowed values are 'NO' and 'YES'.

I am a developer, not an system admininstrator, therefore, I have to admit I do not know what the ramifications of the details in this columns are. But, I know many system admins who use SYSDISKSTAT as it returns lot of interesting information about the storage, in a simple manner.

If I was to use the SYSDISKSTAT View to show these two new columns I would a statement like this:

01  SELECT RESOURCE_NAME,RESOURCE_STATUS,
02         BLOCK_SIZE,
03         UNMAP_CAPABLE
04    FROM QSYS2.SYSDISKSTAT
05   ORDER BY RESOURCE_NAME 
06   LIMIT 5

Line 2: The first new column.

Line 3: The second.

Line 4: Get the data from the View.

Line 5: Order the results by the resource name.

Line 6: And return the first five results. I only want the first five results as this is just an example.

The results are:

RESOURCE   BLOCK  UNMAP_
_NAME     _STATUS   _SIZE  CAPABLE
--------  --------  -----  -------
DMP001    PASSIVE     512  YES
DMP002    PASSIVE     512  YES
DMP003    ACTIVE      512  YES
DMP004    ACTIVE      512  YES
DMP005    PASSIVE     512  YES

All of these resources block size is 512 bytes, and they can unmap the unused pages.

I can do the same thing with the Table function:

01  SELECT RESOURCE_NAME,RESOURCE_STATUS,
02         BLOCK_SIZE,
03         UNMAP_CAPABLE
04    FROM TABLE(QSYS2.SYSDISKSTAT(RESET_STATISTICS => 'YES'))
05   ORDER BY RESOURCE_NAME 
06   LIMIT 5
07  OFFSET 5

Lines 1 – 3: The columns I want in the results are the same as the previous statement.

Line 4: I am using the SYSDISKSTAT Table function, and asking it to reset the statistics. I know that this does not have an effect on the results of my statement, I just wanted the opportunity to show it.

Line 5: As before I want the results to be ordered by resource name.

Line 6: Return five results.

Line 7: I am using the offset clause as I do not want the first five results; I want five rows starting from the six row of the results.

The results are:

RESOURCE  RESOURCE  BLOCK  UNMAP_
_NAME     _STATUS   _SIZE  CAPABLE
--------  --------  -----  -------
DMP006    PASSIVE     512  YES
DMP007    ACTIVE      512  YES
DMP008    PASSIVE     512  YES
DMP009    ACTIVE      512  YES
DMP010    ACTIVE      512  YES

Which are pretty much the same as the first set of results.

I am sure my system administrator friends will find these columns interesting; I am pretty certain I will never use them.

 

You can learn more about this from the IBM website:

 

This article was written for IBM i 7.6 and 7.5 TR6.

No comments:

Post a Comment

To prevent "comment spam" all comments are moderated.
Learn about this website's comments policy here.

Some people have reported that they cannot post a comment using certain computers and browsers. If this is you feel free to use the Contact Form to send me the comment and I will post it for you, please include the title of the post so I know which one to post the comment to.