From 649b3f1f0b08b9bd75b5f82b892b5b1d79108bee Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Mon, 29 Sep 2025 16:20:39 +0200 Subject: [PATCH] Remove the SMART attribute 193 from the failure probability computation --- HISTORY | 3 ++ cmdline/device.c | 75 +-------------------------------------------- cmdline/portable.h | 1 - cmdline/support.c | 1 - snapraid.1 | 15 +++------ snapraid.d | 9 +++--- snapraid.txt | 9 +++--- test/test-par6.conf | 4 +-- 8 files changed, 18 insertions(+), 99 deletions(-) diff --git a/HISTORY b/HISTORY index b0e9c433..7937c974 100644 --- a/HISTORY +++ b/HISTORY @@ -3,6 +3,9 @@ SnapRAID HISTORY 13.0 2025/XX ============ + * Remove the SMART attribute 193 "Load Cycle Count" from the failure + probability computation, as its effectiveness in predicting failures + is too dependent on the hard disk vendor. * Add a new -A, --stats option for an extensive view of the process. * Add new thermal protection configuration options: - temp_limit TEMPERATURE_CELSIUS diff --git a/cmdline/device.c b/cmdline/device.c index 1794f739..828a2e6d 100644 --- a/cmdline/device.c +++ b/cmdline/device.c @@ -241,70 +241,6 @@ static double SMART_188_R[SMART_MEASURES] = { 1.3731, }; -/* - * Divider for SMART attribute 193 - */ -static unsigned SMART_193_STEP = 649; - -/* - * Failure rate for 30 days, for a disk - * with SMART attribute 193 at a given value. - */ -static double SMART_193_R[SMART_MEASURES] = { - 0.0000, 0.0016, 0.0032, 0.0036, 0.0039, - 0.0042, 0.0046, 0.0049, 0.0052, 0.0054, - 0.0057, 0.0060, 0.0062, 0.0065, 0.0068, - 0.0071, 0.0074, 0.0077, 0.0080, 0.0083, - 0.0086, 0.0091, 0.0094, 0.0098, 0.0101, - 0.0104, 0.0108, 0.0111, 0.0119, 0.0122, - 0.0127, 0.0130, 0.0134, 0.0137, 0.0141, - 0.0144, 0.0146, 0.0152, 0.0155, 0.0159, - 0.0163, 0.0165, 0.0168, 0.0172, 0.0176, - 0.0179, 0.0184, 0.0188, 0.0190, 0.0194, - 0.0197, 0.0201, 0.0204, 0.0207, 0.0209, - 0.0213, 0.0215, 0.0219, 0.0221, 0.0225, - 0.0229, 0.0234, 0.0241, 0.0246, 0.0253, - 0.0263, 0.0278, 0.0286, 0.0293, 0.0298, - 0.0302, 0.0306, 0.0311, 0.0315, 0.0319, - 0.0322, 0.0329, 0.0334, 0.0338, 0.0343, - 0.0348, 0.0352, 0.0358, 0.0362, 0.0367, - 0.0371, 0.0374, 0.0378, 0.0383, 0.0388, - 0.0393, 0.0397, 0.0401, 0.0404, 0.0410, - 0.0416, 0.0422, 0.0428, 0.0436, 0.0443, - 0.0449, 0.0454, 0.0457, 0.0462, 0.0468, - 0.0473, 0.0479, 0.0483, 0.0488, 0.0491, - 0.0493, 0.0497, 0.0500, 0.0504, 0.0507, - 0.0510, 0.0514, 0.0519, 0.0523, 0.0528, - 0.0533, 0.0538, 0.0542, 0.0547, 0.0551, - 0.0556, 0.0560, 0.0565, 0.0572, 0.0577, - 0.0584, 0.0590, 0.0594, 0.0599, 0.0603, - 0.0607, 0.0611, 0.0616, 0.0621, 0.0626, - 0.0632, 0.0639, 0.0647, 0.0655, 0.0661, - 0.0669, 0.0676, 0.0683, 0.0691, 0.0699, - 0.0708, 0.0713, 0.0719, 0.0724, 0.0730, - 0.0736, 0.0745, 0.0751, 0.0759, 0.0769, - 0.0779, 0.0787, 0.0796, 0.0804, 0.0815, - 0.0825, 0.0833, 0.0840, 0.0847, 0.0854, - 0.0859, 0.0865, 0.0873, 0.0881, 0.0890, - 0.0900, 0.0912, 0.0919, 0.0929, 0.0942, - 0.0956, 0.0965, 0.0976, 0.0986, 0.0995, - 0.1006, 0.1019, 0.1031, 0.1038, 0.1045, - 0.1051, 0.1058, 0.1066, 0.1072, 0.1077, - 0.1084, 0.1091, 0.1099, 0.1104, 0.1111, - 0.1118, 0.1127, 0.1135, 0.1142, 0.1149, - 0.1157, 0.1163, 0.1168, 0.1173, 0.1179, - 0.1184, 0.1189, 0.1195, 0.1203, 0.1208, - 0.1213, 0.1223, 0.1231, 0.1240, 0.1246, - 0.1252, 0.1260, 0.1269, 0.1276, 0.1287, - 0.1303, 0.1311, 0.1319, 0.1328, 0.1335, - 0.1341, 0.1348, 0.1362, 0.1373, 0.1380, - 0.1387, 0.1392, 0.1398, 0.1403, 0.1408, - 0.1412, 0.1418, 0.1422, 0.1428, 0.1434, - 0.1439, 0.1445, 0.1451, 0.1457, 0.1464, - 0.1469, 0.1475, 0.1480, 0.1486, 0.1491, - 0.1498, -}; - /* * Divider for SMART attribute 197 */ @@ -501,12 +437,6 @@ static double smart_afr(uint64_t* smart, const char* model) afr = r; } - if (smart[193] != SMART_UNASSIGNED) { - double r = smart_afr_value(SMART_193_R, SMART_193_STEP, smart[193] & mask32); - if (afr < r) - afr = r; - } - if (smart[197] != SMART_UNASSIGNED) { double r = smart_afr_value(SMART_197_R, SMART_197_STEP, smart[197] & mask32); if (afr < r) @@ -922,10 +852,7 @@ static int devtest(tommy_list* low, int operation) case 0 : entry->smart[j] = 0; break; case 1 : entry->smart[j] = SMART_UNASSIGNED; break; default : - if (j == 193) - entry->smart[j] = c - 2; - else - entry->smart[j] = 0; + entry->smart[j] = 0; break; } } diff --git a/cmdline/portable.h b/cmdline/portable.h index 793f6ab7..a7688e70 100644 --- a/cmdline/portable.h +++ b/cmdline/portable.h @@ -445,7 +445,6 @@ int randomize(void* ptr, size_t size); #define SMART_REALLOCATED_SECTOR_COUNT 5 #define SMART_POWER_ON_HOURS 9 #define SMART_AIRFLOW_TEMPERATURE_CELSIUS 190 -#define SMART_LOAD_CYCLE_COUNT 193 #define SMART_TEMPERATURE_CELSIUS 194 /** diff --git a/cmdline/support.c b/cmdline/support.c index f97e9ad7..f3f197ed 100644 --- a/cmdline/support.c +++ b/cmdline/support.c @@ -1563,7 +1563,6 @@ int smartctl_attribute(FILE* f, const char* file, const char* name, uint64_t* sm } else if (sscanf(s, "Current Drive Temperature: %" SCNu64, &smart[SMART_TEMPERATURE_CELSIUS]) == 1) { } else if (sscanf(s, "Drive Trip Temperature: %" SCNu64, &smart[SMART_AIRFLOW_TEMPERATURE_CELSIUS]) == 1) { } else if (sscanf(s, "Accumulated start-stop cycles: %" SCNu64, &smart[SMART_START_STOP_COUNT]) == 1) { - } else if (sscanf(s, "Accumulated load-unload cycles: %" SCNu64, &smart[SMART_LOAD_CYCLE_COUNT]) == 1) { } else if (sscanf(s, " number of hours powered up = %" SCNu64, &smart[SMART_POWER_ON_HOURS]) == 1) { /* ATA */ } else if (sscanf(s, "Serial Number: %63s", serial) == 1) { diff --git a/snapraid.1 b/snapraid.1 index fcde4ab9..273cf546 100644 --- a/snapraid.1 +++ b/snapraid.1 @@ -1572,10 +1572,11 @@ DISK is the same disk name specified in the \[dq]disk\[dq] option. PARITY is one of the parity name as \[dq]parity,(1,2,3,4,5,6,z)\-parity\[dq]. The special value * can be used to ignore the attribute on all disks. .PP -For example, to ignore the \[dq]Load_Cycle_Count\[dq] attribute on all disks: +For example, to ignore the \[dq]Current Pending Sector Count\[dq] attribute on +all disks: .PP .RS 4 -smartignore * 193 +smartignore * 197 .PD 0 .PD .RE @@ -1583,7 +1584,7 @@ smartignore * 193 To ignore it only on the first parity disk: .PP .RS 4 -smartignore parity 193 +smartignore parity 197 .PD 0 .PD .RE @@ -1637,10 +1638,6 @@ smartctl parity \-d areca,1/1 /dev/sg0 .PD smartctl 2\-parity \-d areca,2/1 /dev/sg0 .PD 0 -.PP -.PD -smartignore * 193 -.PD 0 .PD .RE .PP @@ -1697,10 +1694,6 @@ smartctl parity \-d areca,1/1 /dev/arcmsr0 .PD smartctl 2\-parity \-d areca,2/1 /dev/arcmsr0 .PD 0 -.PP -.PD -smartignore * 193 -.PD 0 .PD .RE .SH PATTERN diff --git a/snapraid.d b/snapraid.d index 25b545c5..dab6154a 100644 --- a/snapraid.d +++ b/snapraid.d @@ -1274,13 +1274,14 @@ Configuration PARITY is one of the parity name as "parity,(1,2,3,4,5,6,z)-parity". The special value * can be used to ignore the attribute on all disks. - For example, to ignore the "Load_Cycle_Count" attribute on all disks: + For example, to ignore the "Current Pending Sector Count" attribute on + all disks: - :smartignore * 193 + :smartignore * 197 To ignore it only on the first parity disk: - :smartignore parity 193 + :smartignore parity 197 Examples An example of a typical configuration for Unix is: @@ -1297,7 +1298,6 @@ Configuration :smartctl d2 -d usbjmicron %s :smartctl parity -d areca,1/1 /dev/sg0 :smartctl 2-parity -d areca,2/1 /dev/sg0 - :smartignore * 193 An example of a typical configuration for Windows is: @@ -1314,7 +1314,6 @@ Configuration :smartctl d2 -d usbjmicron %s :smartctl parity -d areca,1/1 /dev/arcmsr0 :smartctl 2-parity -d areca,2/1 /dev/arcmsr0 - :smartignore * 193 Pattern Patterns are used to select a subset of files to exclude or include in diff --git a/snapraid.txt b/snapraid.txt index 96fcf7cb..e9435de9 100644 --- a/snapraid.txt +++ b/snapraid.txt @@ -1368,13 +1368,14 @@ DISK is the same disk name specified in the "disk" option. PARITY is one of the parity name as "parity,(1,2,3,4,5,6,z)-parity". The special value * can be used to ignore the attribute on all disks. -For example, to ignore the "Load_Cycle_Count" attribute on all disks: +For example, to ignore the "Current Pending Sector Count" attribute on +all disks: - smartignore * 193 + smartignore * 197 To ignore it only on the first parity disk: - smartignore parity 193 + smartignore parity 197 7.17 Examples ------------- @@ -1393,7 +1394,6 @@ An example of a typical configuration for Unix is: smartctl d2 -d usbjmicron %s smartctl parity -d areca,1/1 /dev/sg0 smartctl 2-parity -d areca,2/1 /dev/sg0 - smartignore * 193 An example of a typical configuration for Windows is: @@ -1410,7 +1410,6 @@ An example of a typical configuration for Windows is: smartctl d2 -d usbjmicron %s smartctl parity -d areca,1/1 /dev/arcmsr0 smartctl 2-parity -d areca,2/1 /dev/arcmsr0 - smartignore * 193 8 PATTERN diff --git a/test/test-par6.conf b/test/test-par6.conf index 3e2ca0ee..028aaf08 100644 --- a/test/test-par6.conf +++ b/test/test-par6.conf @@ -22,5 +22,5 @@ include *.hidden exclude *.unrecoverable smartctl disk1 %s smartctl parity /dev/sda -smartignore * 193 -smartignore parity 193 +smartignore * 197 +smartignore parity 197