Interpreting mdcmd data


Recommended Posts

I'm about halfway done with a new graphical interface to unRAID, but I need more details on some output from mdcmd.

 

sbEvents=46  ; what are these?

 

sbState=0  ; what are the other possible values and what do they mean?

 

mdState=STARTED  ; what are the other possible values and what do they mean?

 

diskState=7  ; what are the other possible values and what do they mean?

 

 

Also, I can't seem to find any info about the cache disk in the mdcmd data.... am I missing something?

 

Link to comment

I'm about halfway done with a new graphical interface to unRAID, but I need more details on some output from mdcmd.

Use the source Luke, use the source.  (from /usr/src/linux/drivers/md/md.c)

sbEvents=46  ; what are these?

Every time the superblock is written to, the event count is incremented.

sbState=0  ; what are the other possible values and what do they mean?

/* Array "operational" state bits

*/

#define MD_SB_CLEAN            0 /* array is clean */

 

#define sb_clean(sb)            ((sb)->state &  (1 << MD_SB_CLEAN))

#define mark_sb_clean(sb)      ((sb)->state |=  (1 << MD_SB_CLEAN))

#define mark_sb_unclean(sb)    ((sb)->state &= ~(1 << MD_SB_CLEAN))

mdState=STARTED  ; what are the other possible values and what do they mean?

/* Array states */

 

static char STARTED[] =                  "STARTED";

static char STOPPED[] =                  "STOPPED";

static char NEW_ARRAY[] =                "NEW_ARRAY";

static char PROTECTED_EXPANSION[] =      "PROTECTED_EXPANSION";

static char UNPROTECTED_EXPANSION[] =    "UNPROTECTED_EXPANSION";

static char RECON_DISK[] =              "RECON_DISK";

static char DISABLE_DISK[] =            "DISABLE_DISK";

static char UPGRADE_DISK[] =            "UPGRADE_DISK";

static char SWAP_DSBL[] =                "SWAP_DSBL";

static char RECORD_DISKS[] =            "RECORD_DISKS";

static char INVALID_EXPANSION[] =        "ERROR:INVALID_EXPANSION";

static char PARITY_NOT_BIGGEST[] =      "ERROR:PARITY_NOT_BIGGEST";

static char TOO_MANY_MISSING_DISKS[] =  "ERROR:TOO_MANY_MISSING_DISKS";

static char NEW_DISK_TOO_SMALL[] =      "ERROR:NEW_DISK_TOO_SMALL";

static char NO_RAID_DISKS[] =            "ERROR:NO_RAID_DISKS";

static char NO_DATA_DISKS[] =            "ERROR:NO_DATA_DISKS";

diskState=7  ; what are the other possible values and what do they mean?

/* Device "Operational state bits"

* Important: bits 8-15 are reserved for unraid use.

*/

#define MD_DISK_VALID                  0 /* disk is valid */

#define MD_DISK_ENABLED                1 /* disk is enabled */

#define MD_DISK_ACTIVE                  2 /* disk is active */

 

/* These macros expect the argument to be a pointer-to a structure with

* a 'state' member.

*/

#define disk_active(d)                  ((d)->state &  (1 << MD_DISK_ACTIVE))

#define mark_disk_active(d)            ((d)->state |=  (1 << MD_DISK_ACTIVE))

#define mark_disk_inactive(d)          ((d)->state &= ~(1 << MD_DISK_ACTIVE))

 

#define disk_enabled(d)                ((d)->state &  (1 << MD_DISK_ENABLED))

#define mark_disk_enabled(d)            ((d)->state |=  (1 << MD_DISK_ENABLED))

#define mark_disk_disabled(d)          ((d)->state &= ~(1 << MD_DISK_ENABLED))

 

#define disk_valid(d)                  ((d)->state &  (1 << MD_DISK_VALID))

#define mark_disk_valid(d)              ((d)->state |=  (1 << MD_DISK_VALID))

#define mark_disk_invalid(d)            ((d)->state &= ~(1 << MD_DISK_VALID))

Also, I can't seem to find any info about the cache disk in the mdcmd data.... am I missing something?

Nope, you are not missing anything... That is because it is not part of the "md" array.  The cache drive has nothing to do with the parity protected array and is just a normal reiserfs file-system.  The real magic of how the cache drive is unioned with the files and directories in the "md" disk file-systems to create user-shares is all in the proprietary shfs user-file-system module written by lime-technology.

 

Joe L.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.