Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Change in mdcmd output in latest version

Featured Replies

I noticed the following variables are not being reported by a status command to /proc/mdcmd:

 

diskNumReads:

diskNumWrites:

diskNumErrors:

 

They were still there in 4.4.2.  Was removing them intentional?

 

I also noticed that total size (diskSize) is reported, but free space is not.  

 

Tom, could we get a "diskFree" added to the /proc/mdcmd status output???  

 

Thanks in advance!

I noticed the following variables are not being reported by a status command to /proc/mdcmd:

 

diskNumReads:

diskNumWrites:

diskNumErrors:

 

They were still there in 4.4.2.  Was removing them intentional?

 

I also noticed that total size (diskSize) is reported, but free space is not.  

 

Tom, could we get a "diskFree" added to the /proc/mdcmd status output???  

 

Thanks in advance!

I think the diskNumErrors will still show errors if they occur, but the other statistics have not been reported from mdcmd for quite a while.  They are instead reported from the /sys/block/XXX/stat file.

 

The code in unmenu.awk does this:

function GetReadWriteStats(theDevIndex,  cmd) {

  cmd="cat /sys/block/" disk_device[theDevIndex] "/stat 2>/dev/null"

  cmd | getline

  disk_reads[theDevIndex] = $1

  disk_writes[theDevIndex] = $5

  close(cmd)

}

 

You are interested in the first and fifth fields in the "stat" file under /sys/block/XXX.

 

As far as free space.  the "md" device has no concept of a file-system.  It only knows the size of the partition it is affiliated with.  There is no way for it to show free space, to it all the bits are being used.  You can only get free space from the "df" command.

 

Joe L.

  • Author
I found the old post I made.  Tom stopped using the fields in the mdcmd output on release 4.4.2

 

That's what I get for not paying attention ;)

 

However, the number from /proc/diskstats and  /sys/block/mdX/stat do not agree with what is reported in emhttp..... not even close.

 

I found the old post I made.  Tom stopped using the fields in the mdcmd output on release 4.4.2

 

That's what I get for not paying attention ;)

 

However, the number from /proc/diskstats and  /sys/block/mdX/stat do not agree with what is reported in emhttp..... not even close.

 

That;s because empttp (and unMENU) is reporting the I/O of the /sys/block/sdX/stat, not the "md" device.  The numbers agree with what emhttp is showing.
  • Author
That;s because empttp (and unMENU) is reporting the I/O of the /sys/block/sdX/stat, not the "md" device.  The numbers agree with what emhttp is showing.

 

Only if you've never cleared the stats.  /sys/block/sdX/stat is only reset at boot.

 

It looks like unRAID is snapshotting the values when you "clear stats", and subtracting the snapshot from the live ones.

That;s because empttp (and unMENU) is reporting the I/O of the /sys/block/sdX/stat, not the "md" device.  The numbers agree with what emhttp is showing.

 

Only if you've never cleared the stats.  /sys/block/sdX/stat is only reset at boot.

 

It looks like unRAID is snapshotting the values when you "clear stats", and subtracting the snapshot from the live ones.

I don't think I've ever "cleared stats" and therefore, never noticed the behavior you just described. 

 

Very Interesting.  I'll bet you are right.

 

To confirm, re-start emhttp and see if it still does the math to subtract the prev. values.

killall emhttp

emhttp &

  • Author
To confirm, re-start emhttp and see if it still does the math to subtract the prev. values.

 

Yup.

 

I do clear stats often when working on various things, to see how much activity a disk sees (and which disks) when I run something.

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.