From 75b6170b7996264b9994cb700743593cfa2c97d1 Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Mon, 22 Dec 2025 00:03:38 +0100 Subject: [PATCH] Rework size and uuid tags --- cmdline/elem.h | 6 +- cmdline/state.c | 60 +++++++++++++------ doc/snapraid_log.1 | 139 ++++++++++++++++++++++--------------------- doc/snapraid_log.d | 110 +++++++++++++++++----------------- doc/snapraid_log.txt | 110 +++++++++++++++++----------------- 5 files changed, 227 insertions(+), 198 deletions(-) diff --git a/cmdline/elem.h b/cmdline/elem.h index 7e0d6a4e..be54bd2f 100644 --- a/cmdline/elem.h +++ b/cmdline/elem.h @@ -331,7 +331,7 @@ struct snapraid_disk { char dir[PATH_MAX]; /**< Mount point of the disk. It always terminates with /. */ char smartctl[PATH_MAX]; /**< Custom command for smartctl. Empty means auto. */ int smartignore[SMART_IGNORE_MAX]; /**< Smart attributes to ignore for this device. */ - char uuid[UUID_MAX]; /**< UUID of the disk. */ + char uuid[UUID_MAX]; /**< UUID of the disk. They are probed during the config reading. */ uint64_t device; /**< Device identifier. */ block_off_t total_blocks; /**< Number of total blocks. */ @@ -422,7 +422,7 @@ struct snapraid_disk { */ struct snapraid_map { char name[PATH_MAX]; /**< Name of the disk. */ - char uuid[UUID_MAX]; /**< UUID of the disk. Empty if unknown. */ + char uuid[UUID_MAX]; /**< UUID of the disk. Empty if unknown. They are read from the content file. */ block_off_t total_blocks; /**< Number of total blocks. */ block_off_t free_blocks; /**< Number of free blocks at last 'sync'. */ unsigned position; /**< Position of the disk in the parity. */ @@ -453,7 +453,7 @@ struct snapraid_map { */ struct snapraid_split { char path[PATH_MAX]; /**< Path of the parity file. */ - char uuid[UUID_MAX]; /**< UUID of the disk. Empty if unknown. */ + char uuid[UUID_MAX]; /**< UUID of the disk. Empty if unknown. They are probed during the config reading, and later read from the content file. */ /** * Size of the parity split. diff --git a/cmdline/state.c b/cmdline/state.c index 179feb04..36e1e206 100644 --- a/cmdline/state.c +++ b/cmdline/state.c @@ -716,6 +716,7 @@ void state_config(struct snapraid_state* state, const char* path, const char* co skip_access = 0; state->parity[level].split_mac = split_mac; for (s = 0; s < split_mac; ++s) { + char uuid[UUID_MAX]; pathimport(state->parity[level].split_map[s].path, sizeof(state->parity[level].split_map[s].path), split_map[s]); if (!state->opt.skip_parity_access) { @@ -731,11 +732,17 @@ void state_config(struct snapraid_state* state, const char* path, const char* co if (stat(device, &st) == 0) { dev = st.st_dev; + + /* read the uuid, if unsupported use an empty one */ + if (devuuid(dev, split_map[s], uuid, sizeof(uuid)) != 0) { + *uuid = 0; + } } else { /* if the disk can be skipped */ if (state->opt.force_device) { /* use a fake device, and mark the disk to be skipped */ dev = 0; + *uuid = 0; skip_access = 1; log_fatal("DANGER! Skipping inaccessible parity disk '%s'...\n", tag); } else { @@ -753,9 +760,11 @@ void state_config(struct snapraid_state* state, const char* path, const char* co } else { /* use a fake device */ dev = 0; + *uuid = 0; } state->parity[level].split_map[s].device = dev; + pathcpy(state->parity[level].split_map[s].uuid, sizeof(state->parity[level].split_map[s].uuid), uuid); } /* store the global parity skip_access */ @@ -1369,13 +1378,16 @@ void state_config(struct snapraid_state* state, const char* path, const char* co log_tag("blocksize:%u\n", state->block_size); for (i = state->disklist; i != 0; i = i->next) { struct snapraid_disk* disk = i->data; - log_tag("data:%s:%s\n", disk->name, disk->dir); + log_tag("data:%s:%s:%s\n", disk->name, disk->dir, disk->uuid); } log_tag("mode:%s\n", lev_raid_name(state->raid_mode, state->level)); - for (l = 0; l < state->level; ++l) - for (s = 0; s < state->parity[l].split_mac; ++s) - log_tag("%s:%u:%s\n", lev_config_name(l), s, state->parity[l].split_map[s].path); + for (l = 0; l < state->level; ++l) { + log_tag("%s:%s:%s\n", lev_config_name(l), state->parity[l].split_map[0].path, state->parity[l].split_map[0].uuid); + for (s = 1; s < state->parity[l].split_mac; ++s) { + log_tag("%s/%u:%s:%s\n", lev_config_name(l), s, state->parity[l].split_map[s].path, state->parity[l].split_map[s].uuid); + } + } if (state->pool[0] != 0) log_tag("pool:%s\n", state->pool); if (state->share[0] != 0) @@ -1601,7 +1613,7 @@ static void state_map(struct snapraid_state* state) if (state->parity[l].split_map[s].uuid[0] != 0) { /* count the number of uuid change */ ++uuid_mismatch; - log_fatal("UUID change for parity '%s[%u]' from '%s' to '%s'\n", lev_config_name(l), s, state->parity[l].split_map[s].uuid, uuid); + log_fatal("UUID change for parity '%s/%u' from '%s' to '%s'\n", lev_config_name(l), s, state->parity[l].split_map[s].uuid, uuid); } /* update the uuid */ @@ -2703,6 +2715,11 @@ static void state_read_content(struct snapraid_state* state, const char* path, S os_abort(); /* LCOV_EXCL_STOP */ } + + log_tag("content_allocation:%s:%" PRIi64 ":%" PRIi64 "\n", + buffer, + v_total_blocks * (uint64_t)state->block_size, + v_free_blocks * (uint64_t)state->block_size); } else { v_total_blocks = 0; v_free_blocks = 0; @@ -2718,11 +2735,8 @@ static void state_read_content(struct snapraid_state* state, const char* path, S } /* log the info read from the content file */ - log_tag("content_disk:%s:%" PRIu64 ":%" PRIu64 ":%u:%s\n", + log_tag("content_data:%s:%s\n", buffer, - v_total_blocks * (uint64_t)state->block_size, - v_free_blocks * (uint64_t)state->block_size, - v_pos, uuid); /* find the disk */ @@ -2805,6 +2819,11 @@ static void state_read_content(struct snapraid_state* state, const char* path, S /* LCOV_EXCL_STOP */ } + log_tag("content_allocation:%s:%" PRIi64 ":%" PRIi64 "\n", + lev_config_name(v_level), + v_total_blocks * (uint64_t)state->block_size, + v_free_blocks * (uint64_t)state->block_size); + /* auto configure if configuration is missing */ if (state->no_conf) { if (v_level >= state->level) @@ -2822,11 +2841,8 @@ static void state_read_content(struct snapraid_state* state, const char* path, S state->parity[v_level].free_blocks = v_free_blocks; /* log the info read from the content file */ - log_tag("content_parity:%s:%" PRIu64 ":%" PRIu64 ":%u:%s:%s:%" PRIi64 "\n", + log_tag("content_parity:%s:%s:%s:%" PRIi64 "\n", lev_config_name(v_level), - v_total_blocks * (uint64_t)state->block_size, - v_free_blocks * (uint64_t)state->block_size, - 0, state->parity[v_level].split_map[0].uuid, state->parity[v_level].split_map[0].path, state->parity[v_level].split_map[0].size); @@ -2894,6 +2910,11 @@ static void state_read_content(struct snapraid_state* state, const char* path, S state->parity[v_level].free_blocks = v_free_blocks; } + log_tag("content_allocation:%s:%" PRIi64 ":%" PRIi64 "\n", + lev_config_name(v_level), + v_total_blocks * (uint64_t)state->block_size, + v_free_blocks * (uint64_t)state->block_size); + for (s = 0; s < v_split_mac; ++s) { char v_path[PATH_MAX]; char v_uuid[UUID_MAX]; @@ -2940,6 +2961,8 @@ static void state_read_content(struct snapraid_state* state, const char* path, S /* otherwise we can drop it */ log_fatal("WARNING! Dropping from '%s' unused split '%u'\n", lev_config_name(v_level), s); } else { + char parity_name[64]; + /* we copy the path only if without configuration file */ if (state->no_conf) pathcpy(state->parity[v_level].split_map[s].path, sizeof(state->parity[v_level].split_map[s].path), v_path); @@ -2949,11 +2972,12 @@ static void state_read_content(struct snapraid_state* state, const char* path, S state->parity[v_level].split_map[s].size = v_size; /* log the info read from the content file */ - log_tag("content_parity:%s:%" PRIu64 ":%" PRIu64 ":%u:%s:%s:%" PRIi64 "\n", - lev_config_name(v_level), - v_total_blocks * (uint64_t)state->block_size, - v_free_blocks * (uint64_t)state->block_size, - s, + if (s == 0) + pathcpy(parity_name, sizeof(parity_name), lev_config_name(v_level)); + else + pathprint(parity_name, sizeof(parity_name), "%s/%u", lev_config_name(v_level), s); + log_tag("content_parity:%s:%s:%s:%" PRIi64 "\n", + parity_name, state->parity[v_level].split_map[s].uuid, state->parity[v_level].split_map[s].path, state->parity[v_level].split_map[s].size); diff --git a/doc/snapraid_log.1 b/doc/snapraid_log.1 index ef8c5bf7..3cb67d8d 100644 --- a/doc/snapraid_log.1 +++ b/doc/snapraid_log.1 @@ -83,7 +83,7 @@ Operating without a configuration file. .B blocksize: The configured block size in bytes (uint). .TP -.B data:: +.B data::: The data disks as defined in the configuration file. .RS 4 .PD 0 @@ -93,6 +93,9 @@ The assigned name of the disk. .HP 4 .I The directory entry point of the disk. +.HP 4 +.I +The UUID of the filesystem containing the dir. .PD .RE .TP @@ -101,23 +104,23 @@ The RAID mode used. One of \`par1\`, \`par2\`, \`par3\`, \`par4\`, \`par5\`, \`par6\` or \`parz\`. The number indicates the maximum number of simultaneous disk failures the array can withstand. .TP -.B :: +.B [/]:: The parity files as defined in the configuration file. .RS 4 .PD 0 .HP 4 -.I -One of \`parity\`, \`2\-parity\`, ..., \`6\-parity\`. -This corresponds to the level of redundancy. -.HP 4 -.I -The split index (uint). If no -multiple split parity is configured, there is only the -index 0. A split parity configuration distributes parity -blocks across multiple files. +.I [/] +One of \`parity\`, \`2\-parity\`, +..., \`6\-parity\`. This corresponds to the level of redundancy. +In case of split parity, the parity name is followed +by \`/N\` to indicate the split index, where N starts +from 0. The \`/0\` is always omitted. .HP 4 .I The path (escaped). +.HP 4 +.I +The UUID of the filesystem containing the path. .PD .RE .TP @@ -146,40 +149,31 @@ The absolute path to a content file being used (escaped). Content files store the metadata (like file hashes and timestamps) for the array. .TP -.B content_parity::::::: +.B content_parity:[/]::: The parity files as stored in the content file. .RS 4 .PD 0 .HP 4 -.I -One of \`parity\`, \`2\-parity\`, ..., \`6\-parity\`. -.HP 4 -.I -The size of the data in the disk. -.HP 4 -.I -The free size in the disk at the time of the -latest \`sync\`. -.HP 4 -.I -The split index (uint). If no -multiple split parity is configured, there is only the -index 0. +.I [/] +One of \`parity\`, \`2\-parity\`, +..., \`6\-parity\`. This corresponds to the level of redundancy. +In case of split parity, the parity name is followed +by \`/N\` to indicate the split index, where N starts +from 0. The \`/0\` is always omitted. .HP 4 .I -The UUID of the disk containing the path. +The UUID of the disk containing the path as stored +in the content file. .HP 4 .I The path (escaped). .HP 4 -.I -The size of the parity file. Size is \-1 if not yet -fixed, meaning it can grow. This happens for the -latest split. +.I +The size of the parity file (uint64). .PD .RE .TP -.B content_disk::::: +.B content_data:: The data disk as stored in the content file. .RS 4 .PD 0 @@ -187,18 +181,25 @@ The data disk as stored in the content file. .I Name of the data disk. .HP 4 +.I +The UUID of the disk filesystem as stored in the +content file. +.PD +.RE +.TP +.B content_allocation::: +The size of disk and parity as stored in the content file. +.RS 4 +.PD 0 +.HP 4 +.I +Name of the data or parity disk. +.HP 4 .I -The size of the data in the disk. +The size of the data in the disk or parity (uint64). .HP 4 .I -The free size in the disk at the time of the -latest \`sync\`. -.HP 4 -.I -The disk position in the parity computation. -.HP 4 -.I -The UUID of the disk filesystem. +The free size in the disk or parity (uint64). .PD .RE .SH DIAGNOSTICS TAGS @@ -504,16 +505,16 @@ The calculated ambient temperature in degrees Celsius. .PD .RE .TP -.B thermal:current:[/]:: +.B thermal:current:[/]:: Logs the most recent temperature reading for a specific disk device. .RS 4 .PD 0 .HP 4 -.I [/] +.I [/] The configured name of the disk. In case of split parity, the parity name is followed -by \`/N\` to indicate the split number, where N starts +by \`/N\` to indicate the split index, where N starts from 0. The \`/0\` is always omitted. .HP 4 .I @@ -537,7 +538,7 @@ The highest temperature observed in degrees Celsius. .PD .RE .TP -.B thermal:heat:[/]::: +.B thermal:heat:[/]::: Logs the entire history of temperature data points collected so far for a specific disk, used for fitting the heating model. Only monotone increasing temperatures are included in the history. @@ -563,7 +564,7 @@ monitoring (uint, seconds). .PD .RE .TP -.B thermal:params:[/]::::::: +.B thermal:params:[/]::::::: Logs the estimated parameters for the exponential heating model (fit using least squares) and associated quality metrics for a specific disk. @@ -1442,11 +1443,11 @@ in case the logical disk uses more physical disks. In such a case, you\'ll see multiple tags for the same \`\` but with different \`\`. In case of split parity, the parity name is followed by \`/N\` to indicate -the split number, where N starts from 0. The \`/0\` is always omitted. +the split index, where N starts from 0. The \`/0\` is always omitted. .SS Attributes Tags logging specific disk identification and attribute values. .TP -.B smart::[/] +.B smart::[/] Logs the start of the SMART report for a device. .RS 4 .PD 0 @@ -1454,15 +1455,15 @@ Logs the start of the SMART report for a device. .I The file path of the device (e.g., /dev/sdb). .HP 4 -.I [/] +.I [/] The configured name of the disk. In case of split parity, the parity name is followed -by \`/N\` to indicate the split number, where N starts +by \`/N\` to indicate the split index, where N starts from 0. The \`/0\` is always omitted. .PD .RE .TP -.B attr::[/]:serial: +.B attr::[/]:serial: Logs the disk\'s serial number. .RS 4 .PD 0 @@ -1472,7 +1473,7 @@ The disk\'s serial number (escaped). .PD .RE .TP -.B attr::[/]:family: +.B attr::[/]:family: Logs the disk\'s model family string. .RS 4 .PD 0 @@ -1482,7 +1483,7 @@ The disk\'s vendor and model family identifier (escaped). .PD .RE .TP -.B attr::[/]:model: +.B attr::[/]:model: Logs the disk\'s model string. .RS 4 .PD 0 @@ -1492,7 +1493,7 @@ The disk\'s model identifier (escaped). .PD .RE .TP -.B attr::[/]:afr:: +.B attr::[/]:afr:: Logs the estimated Annual Failure Rate (AFR) and the probability of one failure in the next year based on SMART attributes. The AFR is calculated using the maximum rate @@ -1509,7 +1510,7 @@ next year (double). .PD .RE .TP -.B attr::[/]:size: +.B attr::[/]:size: Logs the size of the disk. .RS 4 .PD 0 @@ -1519,7 +1520,7 @@ The disk size in bytes (uint64). .PD .RE .TP -.B attr::[/]:error: +.B attr::[/]:error: Logs the total error count. .RS 4 .PD 0 @@ -1529,7 +1530,7 @@ The total error count (uint64). .PD .RE .TP -.B attr::[/]:rotationrate: +.B attr::[/]:rotationrate: Logs the disk\'s rotation rate. .RS 4 .PD 0 @@ -1543,7 +1544,7 @@ rotational speed in RPM. .PD .RE .TP -.B attr::[/]:flags:: +.B attr::[/]:flags:: Logs the SMART status flags from the \`smartctl\` utility. Per the smartctl manpage, these flags are bit\-mapped to indicate specific issues like \[dq]Command line did not parse\[dq], @@ -1560,7 +1561,7 @@ The raw flags value (uint64, hexadecimal). .PD .RE .TP -.B attr::[/]::: +.B attr::[/]::: Logs the raw value of any assigned SMART attribute. .RS 4 .PD 0 @@ -1576,19 +1577,19 @@ The raw attribute value (uint64, hexadecimal). .PD .RE .TP -.B attr::[/]:power:active +.B attr::[/]:power:active Logs that the device was confirmed to be in an active power state after a status probe. .TP -.B attr::[/]:power:standby +.B attr::[/]:power:standby Logs that the device was confirmed to be in a standby/spun\-down state. .TP -.B attr::[/]:power:up +.B attr::[/]:power:up Logs a successful spin\-up operation via direct O_DIRECT read. .TP -.B attr::[/]:power:down +.B attr::[/]:power:down Logs a successful spin\-down operation initiated via the smartctl command. .SS Summary @@ -1615,7 +1616,7 @@ the next year (double). These tags log the lifecycle of hardware interactions and external command execution with the \`smartctl\` command. .TP -.B device::[/]:shell +.B device::[/]:shell Logs a failure in the command shell execution environment. .RS 4 .PD 0 @@ -1623,15 +1624,15 @@ Logs a failure in the command shell execution environment. .I The system path to the device node. .HP 4 -.I [/] +.I [/] The configured name of the disk. In case of split parity, the parity name is followed -by \`/N\` to indicate the split number, where N starts +by \`/N\` to indicate the split index, where N starts from 0. The \`/0\` is always omitted. .PD .RE .TP -.B device::[/]:error: +.B device::[/]:error: Logs a low\-level system error during direct file operations. This is triggered when open(), read(), or close() calls fail during a spin\-up attempt. @@ -1644,12 +1645,12 @@ the OS. .PD .RE .TP -.B device::[/]:error:abort +.B device::[/]:error:abort Logs that an external process (smartctl) failed to complete normally, such as being terminated by a signal rather than exiting. .TP -.B device::[/]:exit: +.B device::[/]:exit: Logs that the external command (smartctl) returned a non\-zero exit code that was not explicitly recognized as a valid state. .RS 4 diff --git a/doc/snapraid_log.d b/doc/snapraid_log.d index 8224cbeb..497d7e31 100644 --- a/doc/snapraid_log.d +++ b/doc/snapraid_log.d @@ -65,27 +65,28 @@ Configuration Tags =blocksize: The configured block size in bytes (uint). - =data:: + =data::: The data disks as defined in the configuration file. - The assigned name of the disk. - The directory entry point of the disk. + - The UUID of the filesystem containing the dir. =mode: The RAID mode used. One of `par1`, `par2`, `par3`, `par4`, `par5`, `par6` or `parz`. The number indicates the maximum number of simultaneous disk failures the array can withstand. - =:: + =[/]:: The parity files as defined in the configuration file. - - One of `parity`, `2-parity`, ..., `6-parity`. - This corresponds to the level of redundancy. - - The split index (uint). If no - multiple split parity is configured, there is only the - index 0. A split parity configuration distributes parity - blocks across multiple files. + [/] - One of `parity`, `2-parity`, + ..., `6-parity`. This corresponds to the level of redundancy. + In case of split parity, the parity name is followed + by `/N` to indicate the split index, where N starts + from 0. The `/0` is always omitted. - The path (escaped). + - The UUID of the filesystem containing the path. =pool: The configured dir to the pool mount point (escaped). @@ -112,31 +113,32 @@ Configuration Tags Content files store the metadata (like file hashes and timestamps) for the array. - =content_parity::::::: + =content_parity:[/]::: The parity files as stored in the content file. - - One of `parity`, `2-parity`, ..., `6-parity`. - - The size of the data in the disk. - - The free size in the disk at the time of the - latest `sync`. - - The split index (uint). If no - multiple split parity is configured, there is only the - index 0. - - The UUID of the disk containing the path. + [/] - One of `parity`, `2-parity`, + ..., `6-parity`. This corresponds to the level of redundancy. + In case of split parity, the parity name is followed + by `/N` to indicate the split index, where N starts + from 0. The `/0` is always omitted. + - The UUID of the disk containing the path as stored + in the content file. - The path (escaped). - - The size of the parity file. Size is -1 if not yet - fixed, meaning it can grow. This happens for the - latest split. + - The size of the parity file (uint64). - =content_disk::::: + =content_data:: The data disk as stored in the content file. - Name of the data disk. - - The size of the data in the disk. - - The free size in the disk at the time of the - latest `sync`. - - The disk position in the parity computation. - - The UUID of the disk filesystem. + - The UUID of the disk filesystem as stored in the + content file. + + =content_allocation::: + The size of disk and parity as stored in the content file. + + - Name of the data or parity disk. + - The size of the data in the disk or parity (uint64). + - The free size in the disk or parity (uint64). Diagnostics Tags =version: @@ -340,13 +342,13 @@ Thermal Tags - The calculated ambient temperature in degrees Celsius. - =thermal:current:[/]:: + =thermal:current:[/]:: Logs the most recent temperature reading for a specific disk device. - [/] - The configured name of the disk. + [/] - The configured name of the disk. In case of split parity, the parity name is followed - by `/N` to indicate the split number, where N starts + by `/N` to indicate the split index, where N starts from 0. The `/0` is always omitted. - The unique device ID (uint64). - The current temperature read from the disk in degrees @@ -359,7 +361,7 @@ Thermal Tags - The highest temperature observed in degrees Celsius. - =thermal:heat:[/]::: + =thermal:heat:[/]::: Logs the entire history of temperature data points collected so far for a specific disk, used for fitting the heating model. Only monotone increasing temperatures are included in the history. @@ -372,7 +374,7 @@ Thermal Tags - Time offset from the start of the thermal monitoring (uint, seconds). - =thermal:params:[/]::::::: + =thermal:params:[/]::::::: Logs the estimated parameters for the exponential heating model (fit using least squares) and associated quality metrics for a specific disk. @@ -923,36 +925,36 @@ Command Smart Tags you'll see multiple tags for the same `` but with different ``. In case of split parity, the parity name is followed by `/N` to indicate - the split number, where N starts from 0. The `/0` is always omitted. + the split index, where N starts from 0. The `/0` is always omitted. Attributes Tags logging specific disk identification and attribute values. - =smart::[/] + =smart::[/] Logs the start of the SMART report for a device. - The file path of the device (e.g., /dev/sdb). - [/] - The configured name of the disk. + [/] - The configured name of the disk. In case of split parity, the parity name is followed - by `/N` to indicate the split number, where N starts + by `/N` to indicate the split index, where N starts from 0. The `/0` is always omitted. - =attr::[/]:serial: + =attr::[/]:serial: Logs the disk's serial number. - The disk's serial number (escaped). - =attr::[/]:family: + =attr::[/]:family: Logs the disk's model family string. - The disk's vendor and model family identifier (escaped). - =attr::[/]:model: + =attr::[/]:model: Logs the disk's model string. - The disk's model identifier (escaped). - =attr::[/]:afr:: + =attr::[/]:afr:: Logs the estimated Annual Failure Rate (AFR) and the probability of one failure in the next year based on SMART attributes. The AFR is calculated using the maximum rate @@ -962,17 +964,17 @@ Command Smart Tags - The probability of one or more failures in the next year (double). - =attr::[/]:size: + =attr::[/]:size: Logs the size of the disk. - The disk size in bytes (uint64). - =attr::[/]:error: + =attr::[/]:error: Logs the total error count. - The total error count (uint64). - =attr::[/]:rotationrate: + =attr::[/]:rotationrate: Logs the disk's rotation rate. - The rotation rate. A value of 0 indicates a @@ -981,7 +983,7 @@ Command Smart Tags precise speed. Values greater than 1 indicate the rotational speed in RPM. - =attr::[/]:flags:: + =attr::[/]:flags:: Logs the SMART status flags from the `smartctl` utility. Per the smartctl manpage, these flags are bit-mapped to indicate specific issues like "Command line did not parse", @@ -991,26 +993,26 @@ Command Smart Tags - The raw flags value (uint64, decimal). - The raw flags value (uint64, hexadecimal). - =attr::[/]::: + =attr::[/]::: Logs the raw value of any assigned SMART attribute. - The SMART attribute ID (uint). - The raw attribute value (uint64, decimal). - The raw attribute value (uint64, hexadecimal). - =attr::[/]:power:active + =attr::[/]:power:active Logs that the device was confirmed to be in an active power state after a status probe. - =attr::[/]:power:standby + =attr::[/]:power:standby Logs that the device was confirmed to be in a standby/spun-down state. - =attr::[/]:power:up + =attr::[/]:power:up Logs a successful spin-up operation via direct O_DIRECT read. - =attr::[/]:power:down + =attr::[/]:power:down Logs a successful spin-down operation initiated via the smartctl command. @@ -1030,16 +1032,16 @@ Device Status Tags These tags log the lifecycle of hardware interactions and external command execution with the `smartctl` command. - =device::[/]:shell + =device::[/]:shell Logs a failure in the command shell execution environment. - The system path to the device node. - [/] - The configured name of the disk. + [/] - The configured name of the disk. In case of split parity, the parity name is followed - by `/N` to indicate the split number, where N starts + by `/N` to indicate the split index, where N starts from 0. The `/0` is always omitted. - =device::[/]:error: + =device::[/]:error: Logs a low-level system error during direct file operations. This is triggered when open(), read(), or close() calls fail during a spin-up attempt. @@ -1047,12 +1049,12 @@ Device Status Tags - The standard integer error number provided by the OS. - =device::[/]:error:abort + =device::[/]:error:abort Logs that an external process (smartctl) failed to complete normally, such as being terminated by a signal rather than exiting. - =device::[/]:exit: + =device::[/]:exit: Logs that the external command (smartctl) returned a non-zero exit code that was not explicitly recognized as a valid state. diff --git a/doc/snapraid_log.txt b/doc/snapraid_log.txt index e8d45111..3191e568 100644 --- a/doc/snapraid_log.txt +++ b/doc/snapraid_log.txt @@ -71,27 +71,28 @@ scanning the disk and reading the list of files. blocksize: The configured block size in bytes (uint). - data:: + data::: The data disks as defined in the configuration file. - The assigned name of the disk. - The directory entry point of the disk. + - The UUID of the filesystem containing the dir. mode: The RAID mode used. One of `par1`, `par2`, `par3`, `par4`, `par5`, `par6` or `parz`. The number indicates the maximum number of simultaneous disk failures the array can withstand. - :: + [/]:: The parity files as defined in the configuration file. - - One of `parity`, `2-parity`, ..., `6-parity`. - This corresponds to the level of redundancy. - - The split index (uint). If no - multiple split parity is configured, there is only the - index 0. A split parity configuration distributes parity - blocks across multiple files. + [/] - One of `parity`, `2-parity`, + ..., `6-parity`. This corresponds to the level of redundancy. + In case of split parity, the parity name is followed + by `/N` to indicate the split index, where N starts + from 0. The `/0` is always omitted. - The path (escaped). + - The UUID of the filesystem containing the path. pool: The configured dir to the pool mount point (escaped). @@ -118,31 +119,32 @@ scanning the disk and reading the list of files. Content files store the metadata (like file hashes and timestamps) for the array. - content_parity::::::: + content_parity:[/]::: The parity files as stored in the content file. - - One of `parity`, `2-parity`, ..., `6-parity`. - - The size of the data in the disk. - - The free size in the disk at the time of the - latest `sync`. - - The split index (uint). If no - multiple split parity is configured, there is only the - index 0. - - The UUID of the disk containing the path. + [/] - One of `parity`, `2-parity`, + ..., `6-parity`. This corresponds to the level of redundancy. + In case of split parity, the parity name is followed + by `/N` to indicate the split index, where N starts + from 0. The `/0` is always omitted. + - The UUID of the disk containing the path as stored + in the content file. - The path (escaped). - - The size of the parity file. Size is -1 if not yet - fixed, meaning it can grow. This happens for the - latest split. + - The size of the parity file (uint64). - content_disk::::: + content_data:: The data disk as stored in the content file. - Name of the data disk. - - The size of the data in the disk. - - The free size in the disk at the time of the - latest `sync`. - - The disk position in the parity computation. - - The UUID of the disk filesystem. + - The UUID of the disk filesystem as stored in the + content file. + + content_allocation::: + The size of disk and parity as stored in the content file. + + - Name of the data or parity disk. + - The size of the data in the disk or parity (uint64). + - The free size in the disk or parity (uint64). 3 DIAGNOSTICS TAGS @@ -358,13 +360,13 @@ disk access. - The calculated ambient temperature in degrees Celsius. - thermal:current:[/]:: + thermal:current:[/]:: Logs the most recent temperature reading for a specific disk device. - [/] - The configured name of the disk. + [/] - The configured name of the disk. In case of split parity, the parity name is followed - by `/N` to indicate the split number, where N starts + by `/N` to indicate the split index, where N starts from 0. The `/0` is always omitted. - The unique device ID (uint64). - The current temperature read from the disk in degrees @@ -377,7 +379,7 @@ disk access. - The highest temperature observed in degrees Celsius. - thermal:heat:[/]::: + thermal:heat:[/]::: Logs the entire history of temperature data points collected so far for a specific disk, used for fitting the heating model. Only monotone increasing temperatures are included in the history. @@ -390,7 +392,7 @@ disk access. - Time offset from the start of the thermal monitoring (uint, seconds). - thermal:params:[/]::::::: + thermal:params:[/]::::::: Logs the estimated parameters for the exponential heating model (fit using least squares) and associated quality metrics for a specific disk. @@ -965,36 +967,36 @@ in case the logical disk uses more physical disks. In such a case, you'll see multiple tags for the same `` but with different ``. In case of split parity, the parity name is followed by `/N` to indicate -the split number, where N starts from 0. The `/0` is always omitted. +the split index, where N starts from 0. The `/0` is always omitted. ---- 14.0.1 Attributes ---- Tags logging specific disk identification and attribute values. - smart::[/] + smart::[/] Logs the start of the SMART report for a device. - The file path of the device (e.g., /dev/sdb). - [/] - The configured name of the disk. + [/] - The configured name of the disk. In case of split parity, the parity name is followed - by `/N` to indicate the split number, where N starts + by `/N` to indicate the split index, where N starts from 0. The `/0` is always omitted. - attr::[/]:serial: + attr::[/]:serial: Logs the disk's serial number. - The disk's serial number (escaped). - attr::[/]:family: + attr::[/]:family: Logs the disk's model family string. - The disk's vendor and model family identifier (escaped). - attr::[/]:model: + attr::[/]:model: Logs the disk's model string. - The disk's model identifier (escaped). - attr::[/]:afr:: + attr::[/]:afr:: Logs the estimated Annual Failure Rate (AFR) and the probability of one failure in the next year based on SMART attributes. The AFR is calculated using the maximum rate @@ -1004,17 +1006,17 @@ Tags logging specific disk identification and attribute values. - The probability of one or more failures in the next year (double). - attr::[/]:size: + attr::[/]:size: Logs the size of the disk. - The disk size in bytes (uint64). - attr::[/]:error: + attr::[/]:error: Logs the total error count. - The total error count (uint64). - attr::[/]:rotationrate: + attr::[/]:rotationrate: Logs the disk's rotation rate. - The rotation rate. A value of 0 indicates a @@ -1023,7 +1025,7 @@ Tags logging specific disk identification and attribute values. precise speed. Values greater than 1 indicate the rotational speed in RPM. - attr::[/]:flags:: + attr::[/]:flags:: Logs the SMART status flags from the `smartctl` utility. Per the smartctl manpage, these flags are bit-mapped to indicate specific issues like "Command line did not parse", @@ -1033,26 +1035,26 @@ Tags logging specific disk identification and attribute values. - The raw flags value (uint64, decimal). - The raw flags value (uint64, hexadecimal). - attr::[/]::: + attr::[/]::: Logs the raw value of any assigned SMART attribute. - The SMART attribute ID (uint). - The raw attribute value (uint64, decimal). - The raw attribute value (uint64, hexadecimal). - attr::[/]:power:active + attr::[/]:power:active Logs that the device was confirmed to be in an active power state after a status probe. - attr::[/]:power:standby + attr::[/]:power:standby Logs that the device was confirmed to be in a standby/spun-down state. - attr::[/]:power:up + attr::[/]:power:up Logs a successful spin-up operation via direct O_DIRECT read. - attr::[/]:power:down + attr::[/]:power:down Logs a successful spin-down operation initiated via the smartctl command. @@ -1075,16 +1077,16 @@ Tags logging the overall failure probabilities for the array. These tags log the lifecycle of hardware interactions and external command execution with the `smartctl` command. - device::[/]:shell + device::[/]:shell Logs a failure in the command shell execution environment. - The system path to the device node. - [/] - The configured name of the disk. + [/] - The configured name of the disk. In case of split parity, the parity name is followed - by `/N` to indicate the split number, where N starts + by `/N` to indicate the split index, where N starts from 0. The `/0` is always omitted. - device::[/]:error: + device::[/]:error: Logs a low-level system error during direct file operations. This is triggered when open(), read(), or close() calls fail during a spin-up attempt. @@ -1092,12 +1094,12 @@ command execution with the `smartctl` command. - The standard integer error number provided by the OS. - device::[/]:error:abort + device::[/]:error:abort Logs that an external process (smartctl) failed to complete normally, such as being terminated by a signal rather than exiting. - device::[/]:exit: + device::[/]:exit: Logs that the external command (smartctl) returned a non-zero exit code that was not explicitly recognized as a valid state.