diff --git a/cmdline/device.c b/cmdline/device.c index 76ff1baa..a19cd041 100644 --- a/cmdline/device.c +++ b/cmdline/device.c @@ -550,8 +550,8 @@ static void state_info_log(devinfo_t* devinfo) log_tag("info:%s:%s\n", devinfo->file, devinfo->name); if (devinfo->serial[0]) log_tag("attr:%s:%s:serial:%s\n", devinfo->file, devinfo->name, esc_tag(devinfo->serial, esc_buffer)); - if (devinfo->vendor[0]) - log_tag("attr:%s:%s:vendor:%s\n", devinfo->file, devinfo->name, esc_tag(devinfo->vendor, esc_buffer)); + if (devinfo->family[0]) + log_tag("attr:%s:%s:family:%s\n", devinfo->file, devinfo->name, esc_tag(devinfo->family, esc_buffer)); if (devinfo->model[0]) log_tag("attr:%s:%s:model:%s\n", devinfo->file, devinfo->name, esc_tag(devinfo->model, esc_buffer)); if (devinfo->info[INFO_SIZE] != SMART_UNASSIGNED) @@ -887,7 +887,7 @@ int devtest(tommy_list* high, tommy_list* low, int operation) } pathprint(entry->serial, sizeof(entry->serial), "FAKE_%s", devinfo->serial); - pathprint(entry->vendor, sizeof(entry->vendor), "FAKE_%s", devinfo->vendor); + pathprint(entry->family, sizeof(entry->family), "FAKE_%s", devinfo->family); pathprint(entry->model, sizeof(entry->model), "FAKE_%s", devinfo->model); pathprint(entry->file, sizeof(entry->file), "FAKE_%s", devinfo->file); pathcpy(entry->name, sizeof(entry->name), devinfo->name); diff --git a/cmdline/mingw.c b/cmdline/mingw.c index 4731fb79..baf54662 100644 --- a/cmdline/mingw.c +++ b/cmdline/mingw.c @@ -2921,7 +2921,7 @@ static void* thread_smart(void* arg) { devinfo_t* devinfo = arg; - if (devsmart(devinfo->device, devinfo->name, devinfo->smartctl, devinfo->smart, devinfo->info, devinfo->serial, devinfo->vendor, devinfo->model) != 0) { + if (devsmart(devinfo->device, devinfo->name, devinfo->smartctl, devinfo->smart, devinfo->info, devinfo->serial, devinfo->family, devinfo->model) != 0) { /* LCOV_EXCL_START */ return (void*)-1; /* LCOV_EXCL_STOP */ @@ -2937,7 +2937,7 @@ static void* thread_probe(void* arg) { devinfo_t* devinfo = arg; - if (devprobe(devinfo->device, devinfo->name, devinfo->smartctl, &devinfo->power, devinfo->info, devinfo->serial, devinfo->vendor, devinfo->model) != 0) { + if (devprobe(devinfo->device, devinfo->name, devinfo->smartctl, &devinfo->power, devinfo->info, devinfo->serial, devinfo->family, devinfo->model) != 0) { /* LCOV_EXCL_START */ return (void*)-1; /* LCOV_EXCL_STOP */ diff --git a/cmdline/portable.h b/cmdline/portable.h index 2be582eb..ed61c50d 100644 --- a/cmdline/portable.h +++ b/cmdline/portable.h @@ -441,10 +441,15 @@ int randomize(void* ptr, size_t size); /** * Standard SMART attributes. */ -#define SMART_START_STOP_COUNT 4 #define SMART_REALLOCATED_SECTOR_COUNT 5 +#define SMART_UNCORRECTABLE_ERROR_CNT 187 +#define SMART_COMMAND_TIMEOUT 188 +#define SMART_CURRENT_PENDING_SECTOR 197 +#define SMART_OFFLINE_UNCORRECTABLE 198 +#define SMART_START_STOP_COUNT 4 #define SMART_POWER_ON_HOURS 9 #define SMART_AIRFLOW_TEMPERATURE_CELSIUS 190 +#define SMART_LOAD_CYCLE_COUNT 193 #define SMART_TEMPERATURE_CELSIUS 194 #define SMART_FLAGS 256 /**< Flags returned by smartctl. */ @@ -516,7 +521,7 @@ struct devinfo_struct { uint64_t smart[SMART_COUNT]; /**< SMART attributes. */ uint64_t info[INFO_COUNT]; /**< Info attributes. */ char serial[SMART_MAX]; /**< Serial number. */ - char vendor[SMART_MAX]; /**< Vendor. */ + char family[SMART_MAX]; /**< Family. */ char model[SMART_MAX]; /**< Model. */ int power; /**< POWER mode. */ #if HAVE_THREAD diff --git a/cmdline/support.c b/cmdline/support.c index 99c4c115..417da372 100644 --- a/cmdline/support.c +++ b/cmdline/support.c @@ -1689,6 +1689,7 @@ 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/cmdline/unix.c b/cmdline/unix.c index 4261b6df..ab5ef254 100644 --- a/cmdline/unix.c +++ b/cmdline/unix.c @@ -1696,7 +1696,7 @@ static void* thread_smart(void* arg) #if HAVE_LINUX_DEVICE devinfo_t* devinfo = arg; - if (devsmart(devinfo->device, devinfo->name, devinfo->smartctl, devinfo->smart, devinfo->info, devinfo->serial, devinfo->vendor, devinfo->model) != 0) { + if (devsmart(devinfo->device, devinfo->name, devinfo->smartctl, devinfo->smart, devinfo->info, devinfo->serial, devinfo->family, devinfo->model) != 0) { /* LCOV_EXCL_START */ return (void*)-1; /* LCOV_EXCL_STOP */ @@ -1717,7 +1717,7 @@ static void* thread_probe(void* arg) #if HAVE_LINUX_DEVICE devinfo_t* devinfo = arg; - if (devprobe(devinfo->device, devinfo->name, devinfo->smartctl, &devinfo->power, devinfo->info, devinfo->serial, devinfo->vendor, devinfo->model) != 0) { + if (devprobe(devinfo->device, devinfo->name, devinfo->smartctl, &devinfo->power, devinfo->info, devinfo->serial, devinfo->family, devinfo->model) != 0) { /* LCOV_EXCL_START */ return (void*)-1; /* LCOV_EXCL_STOP */ @@ -1729,7 +1729,7 @@ static void* thread_probe(void* arg) * smartctl intentionally skips queries on devices in standby mode * to prevent accidentally spinning them up. */ - devattr(devinfo->device, devinfo->info, devinfo->serial, devinfo->vendor, devinfo->model); + devattr(devinfo->device, devinfo->info, devinfo->serial, devinfo->family, devinfo->model); return 0; #else diff --git a/doc/snapraid_log.1 b/doc/snapraid_log.1 index aa15ceab..ef8c5bf7 100644 --- a/doc/snapraid_log.1 +++ b/doc/snapraid_log.1 @@ -1472,13 +1472,13 @@ The disk\'s serial number (escaped). .PD .RE .TP -.B attr::[/]:vendor: -Logs the disk\'s vendor string. +.B attr::[/]:family: +Logs the disk\'s model family string. .RS 4 .PD 0 .HP 4 -.I -The disk\'s vendor identifier (escaped). +.I +The disk\'s vendor and model family identifier (escaped). .PD .RE .TP @@ -1530,12 +1530,16 @@ The total error count (uint64). .RE .TP .B attr::[/]:rotationrate: -Logs the disk\'s rotation rate. A value of 0 indicates an SSD. +Logs the disk\'s rotation rate. .RS 4 .PD 0 .HP 4 .I -The rotation rate (uint64, RPM). +The rotation rate. A value of 0 indicates a +solid\-state drive (SSD) or other non\-rotating medium. +A value of 1 indicates a rotational disk of unknown +precise speed. Values greater than 1 indicate the +rotational speed in RPM. .PD .RE .TP diff --git a/doc/snapraid_log.d b/doc/snapraid_log.d index 65541e08..8224cbeb 100644 --- a/doc/snapraid_log.d +++ b/doc/snapraid_log.d @@ -942,10 +942,10 @@ Command Smart Tags - The disk's serial number (escaped). - =attr::[/]:vendor: - Logs the disk's vendor string. + =attr::[/]:family: + Logs the disk's model family string. - - The disk's vendor identifier (escaped). + - The disk's vendor and model family identifier (escaped). =attr::[/]:model: Logs the disk's model string. @@ -973,9 +973,13 @@ Command Smart Tags - The total error count (uint64). =attr::[/]:rotationrate: - Logs the disk's rotation rate. A value of 0 indicates an SSD. + Logs the disk's rotation rate. - - The rotation rate (uint64, RPM). + - The rotation rate. A value of 0 indicates a + solid-state drive (SSD) or other non-rotating medium. + A value of 1 indicates a rotational disk of unknown + precise speed. Values greater than 1 indicate the + rotational speed in RPM. =attr::[/]:flags:: Logs the SMART status flags from the `smartctl` utility. diff --git a/doc/snapraid_log.txt b/doc/snapraid_log.txt index 316d7490..e8d45111 100644 --- a/doc/snapraid_log.txt +++ b/doc/snapraid_log.txt @@ -984,10 +984,10 @@ Tags logging specific disk identification and attribute values. - The disk's serial number (escaped). - attr::[/]:vendor: - Logs the disk's vendor string. + attr::[/]:family: + Logs the disk's model family string. - - The disk's vendor identifier (escaped). + - The disk's vendor and model family identifier (escaped). attr::[/]:model: Logs the disk's model string. @@ -1015,9 +1015,13 @@ Tags logging specific disk identification and attribute values. - The total error count (uint64). attr::[/]:rotationrate: - Logs the disk's rotation rate. A value of 0 indicates an SSD. + Logs the disk's rotation rate. - - The rotation rate (uint64, RPM). + - The rotation rate. A value of 0 indicates a + solid-state drive (SSD) or other non-rotating medium. + A value of 1 indicates a rotational disk of unknown + precise speed. Values greater than 1 indicate the + rotational speed in RPM. attr::[/]:flags:: Logs the SMART status flags from the `smartctl` utility.