From 52f7c2184f57f8e46ea0d5b12d7c49db522dcbe9 Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Mon, 15 Jun 2026 14:41:03 +0200 Subject: [PATCH] Add support for custom smartctl info options using a [info: ...] tag --- HISTORY | 5 + cmdline/app.h | 5 +- cmdline/device.c | 5 +- cmdline/elem.c | 2 + cmdline/elem.h | 9 +- cmdline/mingwapp.c | 44 +++++---- cmdline/os.h | 4 +- cmdline/selftest.c | 92 ++++++++++++++++++ cmdline/state.c | 93 ++++++++++++++++-- cmdline/state.h | 5 + cmdline/unix.c | 24 +---- cmdline/unixapp.c | 172 ++++++++++++++++++---------------- doc/snapraid-de.1 | 9 +- doc/snapraid-de.d | 6 +- doc/snapraid-de.txt | 6 +- doc/snapraid-es.1 | 12 ++- doc/snapraid-es.d | 9 +- doc/snapraid-es.txt | 9 +- doc/snapraid-fr.1 | 12 ++- doc/snapraid-fr.d | 9 +- doc/snapraid-fr.txt | 9 +- doc/snapraid-it.1 | 12 ++- doc/snapraid-it.d | 9 +- doc/snapraid-it.txt | 9 +- doc/snapraid-ja.1 | 11 ++- doc/snapraid-ja.d | 8 +- doc/snapraid-ja.txt | 8 +- doc/snapraid-ko.1 | 11 ++- doc/snapraid-ko.d | 8 +- doc/snapraid-ko.txt | 8 +- doc/snapraid-pl.1 | 11 ++- doc/snapraid-pl.d | 8 +- doc/snapraid-pl.txt | 8 +- doc/snapraid-pt.1 | 11 ++- doc/snapraid-pt.d | 8 +- doc/snapraid-pt.txt | 8 +- doc/snapraid-ro.1 | 11 ++- doc/snapraid-ro.d | 8 +- doc/snapraid-ro.txt | 8 +- doc/snapraid-ru.1 | 11 ++- doc/snapraid-ru.d | 8 +- doc/snapraid-ru.txt | 8 +- doc/snapraid-sv.1 | 11 ++- doc/snapraid-sv.d | 8 +- doc/snapraid-sv.txt | 8 +- doc/snapraid-uk.1 | 11 ++- doc/snapraid-uk.d | 8 +- doc/snapraid-uk.txt | 8 +- doc/snapraid-zh.1 | 10 +- doc/snapraid-zh.d | 7 +- doc/snapraid-zh.txt | 7 +- doc/snapraid.1 | 11 ++- doc/snapraid.d | 8 +- doc/snapraid.txt | 8 +- snapraid.conf.example | 7 +- snapraid.conf.example.windows | 7 +- 56 files changed, 631 insertions(+), 221 deletions(-) diff --git a/HISTORY b/HISTORY index bf5054b7..0fada611 100644 --- a/HISTORY +++ b/HISTORY @@ -41,6 +41,11 @@ SnapRAID HISTORY non-FHS systems. * Removed the 512 TiB limitation on hard disk size (when using the default 128 KiB blocks). + * Added support for a custom info options tag `[info: ...]` in the + `smartctl` configuration option. This allows replacing the default + `-a` command line argument used to retrieve SMART attributes with a + customized set of arguments, enabling better support for RAID + controllers and USB enclosures. 14.10 2026/08 ============= diff --git a/cmdline/app.h b/cmdline/app.h index 7757ebf1..20675671 100644 --- a/cmdline/app.h +++ b/cmdline/app.h @@ -289,7 +289,7 @@ extern int exit_sync_needed; /** * SMART max attribute length. */ -#define SMART_MAX 64 +#define SMART_MAX 128 /** * Value for unassigned SMART attribute. @@ -330,7 +330,8 @@ struct devinfo_struct { uint64_t device; /**< Device ID. */ char name[PATH_MAX]; /**< Name of the disk combined with the split index if any */ char mount[PATH_MAX]; /**< Mount point or other contained directory. */ - char smartctl[PATH_MAX]; /**< Options for smartctl. */ + char smartctl[SMART_MAX]; /**< Custom option for smartctl. Empty means auto. */ + char smartctl_info[SMART_MAX]; /* Info options for smartctl. Empty means -a. */ int smartignore[SMART_IGNORE_MAX]; /**< Attribues to ignore */ char file[PATH_MAX]; /**< File device. */ #ifdef _WIN32 diff --git a/cmdline/device.c b/cmdline/device.c index 47c2bfac..6473881d 100644 --- a/cmdline/device.c +++ b/cmdline/device.c @@ -1051,6 +1051,7 @@ int state_device(struct snapraid_state* state, int operation, tommy_list* filter device_name_set(entry, disk->name, 0); pathcpy(entry->mount, sizeof(entry->mount), disk->dir); pathcpy(entry->smartctl, sizeof(entry->smartctl), disk->smartctl); + pathcpy(entry->smartctl_info, sizeof(entry->smartctl_info), disk->smartctl_info); memcpy(entry->smartignore, disk->smartignore, sizeof(entry->smartignore)); tommy_list_insert_tail(&high, &entry->node, entry); @@ -1078,6 +1079,7 @@ int state_device(struct snapraid_state* state, int operation, tommy_list* filter device_name_set(entry, lev_config_name(j), s); pathcpy(entry->mount, sizeof(entry->mount), state->parity[j].split_map[s].path); pathcpy(entry->smartctl, sizeof(entry->smartctl), state->parity[j].smartctl); + pathcpy(entry->smartctl_info, sizeof(entry->smartctl_info), state->parity[j].smartctl_info); memcpy(entry->smartignore, state->parity[j].smartignore, sizeof(entry->smartignore)); pathcut(entry->mount); /* remove the parity file */ @@ -1109,7 +1111,8 @@ int state_device(struct snapraid_state* state, int operation, tommy_list* filter device_name_set(entry, extra->name, 0); pathcpy(entry->mount, sizeof(entry->mount), extra->dir); pathcpy(entry->smartctl, sizeof(entry->smartctl), extra->smartctl); - memcpy(entry->smartignore, extra->smartignore, sizeof(extra->smartignore)); + pathcpy(entry->smartctl_info, sizeof(entry->smartctl_info), extra->smartctl_info); + memcpy(entry->smartignore, extra->smartignore, sizeof(entry->smartignore)); tommy_list_insert_tail(&high, &entry->node, entry); } diff --git a/cmdline/elem.c b/cmdline/elem.c index 9f0de3b3..410e78ef 100644 --- a/cmdline/elem.c +++ b/cmdline/elem.c @@ -843,6 +843,7 @@ struct snapraid_disk* disk_alloc(const char* name, const char* dir, uint64_t dev #endif disk->smartctl[0] = 0; + disk->smartctl_info[0] = 0; for (i = 0; i < SMART_IGNORE_MAX; ++i) disk->smartignore[i] = 0; disk->fstype[0] = 0; @@ -915,6 +916,7 @@ struct snapraid_extra* extra_alloc(const char* name, const char* dir, uint64_t d pathslash(extra->dir, sizeof(extra->dir)); extra->smartctl[0] = 0; + extra->smartctl_info[0] = 0; for (i = 0; i < SMART_IGNORE_MAX; ++i) extra->smartignore[i] = 0; extra->fstype[0] = 0; diff --git a/cmdline/elem.h b/cmdline/elem.h index a82c7f31..9bec6c80 100644 --- a/cmdline/elem.h +++ b/cmdline/elem.h @@ -343,7 +343,8 @@ struct snapraid_extent { struct snapraid_extra { char name[PATH_MAX]; /**< Name of the 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. */ + char smartctl[SMART_MAX]; /**< Custom option for smartctl. Empty means auto. */ + char smartctl_info[SMART_MAX]; /* Info options for smartctl. Empty means -a. */ int smartignore[SMART_IGNORE_MAX]; /**< Smart attributes to ignore for this device. */ char uuid[UUID_MAX]; /**< UUID of the disk. They are probed during the config reading. */ char fstype[FSINFO_MAX]; /**< Filesystem type */ @@ -381,7 +382,8 @@ struct snapraid_disk { */ struct fssnapshot_struct fss; - char smartctl[PATH_MAX]; /**< Custom command for smartctl. Empty means auto. */ + char smartctl[SMART_MAX]; /**< Custom option for smartctl. Empty means auto. */ + char smartctl_info[SMART_MAX]; /* Info options for smartctl. Empty means -a. */ int smartignore[SMART_IGNORE_MAX]; /**< Smart attributes to ignore for this device. */ char uuid[UUID_MAX]; /**< UUID of the disk. They are probed during the config reading. */ char fstype[FSINFO_MAX]; /**< Filesystem type */ @@ -534,7 +536,8 @@ struct snapraid_split { struct snapraid_parity { struct snapraid_split split_map[SPLIT_MAX]; /**< Parity splits. */ unsigned split_mac; /**< Number of parity splits. */ - char smartctl[PATH_MAX]; /**< Custom command for smartctl. Empty means auto. */ + char smartctl[SMART_MAX]; /**< Custom option for smartctl. Empty means auto. */ + char smartctl_info[SMART_MAX]; /* Info options for smartctl. Empty means -a. */ int smartignore[SMART_IGNORE_MAX]; /**< Smart attributes to ignore for this device. */ block_off_t total_blocks; /**< Number of total blocks. */ block_off_t free_blocks; /**< Number of free blocks at the last sync. */ diff --git a/cmdline/mingwapp.c b/cmdline/mingwapp.c index 320fd4e0..395606a3 100644 --- a/cmdline/mingwapp.c +++ b/cmdline/mingwapp.c @@ -241,10 +241,10 @@ static int devstat(uint64_t device, const char* name, const char* wfile, uint64_ /** * Get SMART attributes. */ -static int devsmart(uint64_t device, const char* name, const char* smartctl, struct smart_attr* smart, uint64_t* info, char* serial, char* family, char* model, char* inter) +static int devsmart(uint64_t device, const char* name, const char* smartctl, const char* smartctl_info, struct smart_attr* smart, uint64_t* info, char* serial, char* family, char* model, char* inter) { char conv_buf[CONV_MAX]; - WCHAR cmd[PATH_MAX + 128]; + WCHAR cmd[PATH_MAX + SMART_MAX]; char file[128]; FILE* f; int ret; @@ -252,13 +252,15 @@ static int devsmart(uint64_t device, const char* name, const char* smartctl, str snprintf(file, sizeof(file), "/dev/pd%" PRIu64, device); + const char* info_opts = smartctl_info[0] ? smartctl_info : "-a"; + /* if there is a custom smartctl command */ if (smartctl[0]) { - char option[128]; + char option[SMART_MAX]; snprintf(option, sizeof(option), smartctl, file); - snwprintf(cmd, sizeof(cmd), L"\"%lssmartctl.exe\" -a %s", windows_exedir(), option); + snwprintf(cmd, sizeof(cmd), L"\"%lssmartctl.exe\" %s %s", windows_exedir(), info_opts, option); } else { - snwprintf(cmd, sizeof(cmd), L"\"%lssmartctl.exe\" -a %s", windows_exedir(), file); + snwprintf(cmd, sizeof(cmd), L"\"%lssmartctl.exe\" %s %s", windows_exedir(), info_opts, file); } count = 0; @@ -314,7 +316,7 @@ retry: && info[INFO_ROTATION_RATE] == SMART_UNASSIGNED ) { /* retry using the "sat" type */ - snwprintf(cmd, sizeof(cmd), L"\"%lssmartctl.exe\" -a -d sat %s", windows_exedir(), file); + snwprintf(cmd, sizeof(cmd), L"\"%lssmartctl.exe\" %s -d sat %s", windows_exedir(), info_opts, file); ++count; goto retry; @@ -563,10 +565,10 @@ static int devpower(uint64_t device, const char* name, const char* wfile) /** * Get POWER state */ -static int devprobe(uint64_t device, const char* name, const char* smartctl, int* power, struct smart_attr* smart, uint64_t* info, char* serial, char* family, char* model, char* interf) +static int devprobe(uint64_t device, const char* name, const char* smartctl, const char* smartctl_info, int* power, struct smart_attr* smart, uint64_t* info, char* serial, char* family, char* model, char* interf) { char conv_buf[CONV_MAX]; - WCHAR cmd[PATH_MAX + 128]; + WCHAR cmd[PATH_MAX + SMART_MAX]; char file[128]; FILE* f; int ret; @@ -574,13 +576,15 @@ static int devprobe(uint64_t device, const char* name, const char* smartctl, int snprintf(file, sizeof(file), "/dev/pd%" PRIu64, device); + const char* info_opts = smartctl_info[0] ? smartctl_info : "-a"; + /* if there is a custom smartctl command */ if (smartctl[0]) { - char option[128]; + char option[SMART_MAX]; snprintf(option, sizeof(option), smartctl, file); - snwprintf(cmd, sizeof(cmd), L"\"%lssmartctl.exe\" -n standby,3 -a %s", windows_exedir(), option); + snwprintf(cmd, sizeof(cmd), L"\"%lssmartctl.exe\" -n standby,3 %s %s", windows_exedir(), info_opts, option); } else { - snwprintf(cmd, sizeof(cmd), L"\"%lssmartctl.exe\" -n standby,3 -a %s", windows_exedir(), file); + snwprintf(cmd, sizeof(cmd), L"\"%lssmartctl.exe\" -n standby,3 %s %s", windows_exedir(), info_opts, file); } count = 0; @@ -629,7 +633,7 @@ retry: */ if (ret == 2) { /* retry using the "sat" type */ - snwprintf(cmd, sizeof(cmd), L"\"%lssmartctl.exe\" -n standby,3 -a -d sat %s", windows_exedir(), file); + snwprintf(cmd, sizeof(cmd), L"\"%lssmartctl.exe\" -n standby,3 %s -d sat %s", windows_exedir(), info_opts, file); ++count; goto retry; @@ -657,7 +661,7 @@ retry: static int devdown(uint64_t device, const char* name, const char* smartctl) { char conv_buf[CONV_MAX]; - WCHAR cmd[PATH_MAX + 128]; + WCHAR cmd[PATH_MAX + SMART_MAX]; char file[128]; FILE* f; int ret; @@ -667,7 +671,7 @@ static int devdown(uint64_t device, const char* name, const char* smartctl) /* if there is a custom smartctl command */ if (smartctl[0]) { - char option[128]; + char option[SMART_MAX]; snprintf(option, sizeof(option), smartctl, file); snwprintf(cmd, sizeof(cmd), L"\"%lssmartctl.exe\" -s standby,now %s", windows_exedir(), option); } else { @@ -743,11 +747,11 @@ retry: /** * Spin down a specific device if it's up */ -static int devdownifup(uint64_t device, const char* name, const char* smartctl, int* power) +static int devdownifup(uint64_t device, const char* name, const char* smartctl, const char* smartctl_info, int* power) { *power = POWER_UNKNOWN; - if (devprobe(device, name, smartctl, power, 0, 0, 0, 0, 0, 0) != 0) + if (devprobe(device, name, smartctl, smartctl_info, power, 0, 0, 0, 0, 0, 0) != 0) return -1; if (*power == POWER_ACTIVE) @@ -847,7 +851,7 @@ static void* thread_spinup(void* arg) msg_status("Spunup device '%s' for disk '%s' in %" PRIu64 " ms.\n", devinfo->file, devinfo->name, os_tick_ms() - start); /* after the spin up, get SMART info */ - if (devsmart(devinfo->device, devinfo->name, devinfo->smartctl, devinfo->smart, devinfo->info, devinfo->serial, devinfo->family, devinfo->model, devinfo->interf) != 0) { + if (devsmart(devinfo->device, devinfo->name, devinfo->smartctl, devinfo->smartctl_info, devinfo->smart, devinfo->info, devinfo->serial, devinfo->family, devinfo->model, devinfo->interf) != 0) { /* LCOV_EXCL_START */ return (void*)-1; /* LCOV_EXCL_STOP */ @@ -900,7 +904,7 @@ static void* thread_spindownifup(void* arg) start = os_tick_ms(); - if (devdownifup(devinfo->device, devinfo->name, devinfo->smartctl, &power) != 0) { + if (devdownifup(devinfo->device, devinfo->name, devinfo->smartctl, devinfo->smartctl_info, &power) != 0) { /* LCOV_EXCL_START */ return (void*)-1; /* LCOV_EXCL_STOP */ @@ -919,7 +923,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->family, devinfo->model, devinfo->interf) != 0) { + if (devsmart(devinfo->device, devinfo->name, devinfo->smartctl, devinfo->smartctl_info, devinfo->smart, devinfo->info, devinfo->serial, devinfo->family, devinfo->model, devinfo->interf) != 0) { /* LCOV_EXCL_START */ return (void*)-1; /* LCOV_EXCL_STOP */ @@ -943,7 +947,7 @@ static void* thread_probe(void* arg) { devinfo_t* devinfo = arg; - if (devprobe(devinfo->device, devinfo->name, devinfo->smartctl, &devinfo->power, devinfo->smart, devinfo->info, devinfo->serial, devinfo->family, devinfo->model, devinfo->interf) != 0) { + if (devprobe(devinfo->device, devinfo->name, devinfo->smartctl, devinfo->smartctl_info, &devinfo->power, devinfo->smart, devinfo->info, devinfo->serial, devinfo->family, devinfo->model, devinfo->interf) != 0) { /* LCOV_EXCL_START */ return (void*)-1; /* LCOV_EXCL_STOP */ diff --git a/cmdline/os.h b/cmdline/os.h index b5f1be37..eacae08e 100644 --- a/cmdline/os.h +++ b/cmdline/os.h @@ -87,12 +87,10 @@ typedef struct OS_FILE { * * @param argv A NULL-terminated array of strings representing the argument vector. * argv[0] must contain the absolute path to the verified executable. - * @param extra_args A mutable string containing additional arguments separated by - * spaces, or NULL if no extra arguments are needed. * @return A pointer to an initialized OS_FILE structure on success, or NULL on failure. * On failure, errno is set appropriately. */ -OS_FILE* os_popen(const char** argv, char* extra_args); +OS_FILE* os_popen(const char** argv); /** * Reads a line from an OS execution stream. diff --git a/cmdline/selftest.c b/cmdline/selftest.c index fe95f5de..8cc31076 100644 --- a/cmdline/selftest.c +++ b/cmdline/selftest.c @@ -841,6 +841,97 @@ static void test_wnmatch(void) } } +static void test_parse_smartctl(void) +{ + char smartctl[SMART_MAX]; + char smartctl_info[SMART_MAX]; + + /* empty default case */ + if (parse_smartctl("smartctl d1 %s", smartctl, sizeof(smartctl), smartctl_info, sizeof(smartctl_info)) != 0) { + /* LCOV_EXCL_START */ + log_fatal(EINTERNAL, "Failed parse_smartctl empty test 1\n"); + exit(EXIT_FAILURE); + /* LCOV_EXCL_STOP */ + } + if (strcmp(smartctl, "smartctl d1 %s") != 0 || smartctl_info[0] != 0) { + /* LCOV_EXCL_START */ + log_fatal(EINTERNAL, "Failed parse_smartctl empty test 2\n"); + exit(EXIT_FAILURE); + /* LCOV_EXCL_STOP */ + } + + if (parse_smartctl("smartctl d1 /dev/sda", smartctl, sizeof(smartctl), smartctl_info, sizeof(smartctl_info)) != 0) { + /* LCOV_EXCL_START */ + log_fatal(EINTERNAL, "Failed parse_smartctl empty test 3\n"); + exit(EXIT_FAILURE); + /* LCOV_EXCL_STOP */ + } + if (strcmp(smartctl, "smartctl d1 /dev/sda") != 0 || smartctl_info[0] != 0) { + /* LCOV_EXCL_START */ + log_fatal(EINTERNAL, "Failed parse_smartctl empty test 4\n"); + exit(EXIT_FAILURE); + /* LCOV_EXCL_STOP */ + } + + /* basic default case */ + if (parse_smartctl("smartctl d1 -d sat %s", smartctl, sizeof(smartctl), smartctl_info, sizeof(smartctl_info)) != 0) { + /* LCOV_EXCL_START */ + log_fatal(EINTERNAL, "Failed parse_smartctl basic test 1\n"); + exit(EXIT_FAILURE); + /* LCOV_EXCL_STOP */ + } + if (strcmp(smartctl, "smartctl d1 -d sat %s") != 0 || smartctl_info[0] != 0) { + /* LCOV_EXCL_START */ + log_fatal(EINTERNAL, "Failed parse_smartctl basic test 2\n"); + exit(EXIT_FAILURE); + /* LCOV_EXCL_STOP */ + } + + /* case with [info: xxx] tag */ + if (parse_smartctl("smartctl d1 [info: -H -i -A] -d sat %s", smartctl, sizeof(smartctl), smartctl_info, sizeof(smartctl_info)) != 0) { + /* LCOV_EXCL_START */ + log_fatal(EINTERNAL, "Failed parse_smartctl info test 1\n"); + exit(EXIT_FAILURE); + /* LCOV_EXCL_STOP */ + } + if (strcmp(smartctl, "smartctl d1 -d sat %s") != 0 || strcmp(smartctl_info, "-H -i -A") != 0) { + /* LCOV_EXCL_START */ + log_fatal(EINTERNAL, "Failed parse_smartctl info test 2\n"); + exit(EXIT_FAILURE); + /* LCOV_EXCL_STOP */ + } + + /* case with spaces in tag */ + if (parse_smartctl("smartctl d2 [info: -H -I ] -d sat", smartctl, sizeof(smartctl), smartctl_info, sizeof(smartctl_info)) != 0) { + /* LCOV_EXCL_START */ + log_fatal(EINTERNAL, "Failed parse_smartctl space test 1\n"); + exit(EXIT_FAILURE); + /* LCOV_EXCL_STOP */ + } + if (strcmp(smartctl, "smartctl d2 -d sat") != 0 || strcmp(smartctl_info, "-H -I") != 0) { + /* LCOV_EXCL_START */ + log_fatal(EINTERNAL, "Failed parse_smartctl space test 2\n"); + exit(EXIT_FAILURE); + /* LCOV_EXCL_STOP */ + } + + /* invalid case: multiple info tags */ + if (parse_smartctl("smartctl [info: -H] [info: -i] %s", smartctl, sizeof(smartctl), smartctl_info, sizeof(smartctl_info)) == 0) { + /* LCOV_EXCL_START */ + log_fatal(EINTERNAL, "Failed parse_smartctl multiple tags test\n"); + exit(EXIT_FAILURE); + /* LCOV_EXCL_STOP */ + } + + /* invalid case: missing closing bracket */ + if (parse_smartctl("smartctl [info: -H %s", smartctl, sizeof(smartctl), smartctl_info, sizeof(smartctl_info)) == 0) { + /* LCOV_EXCL_START */ + log_fatal(EINTERNAL, "Failed parse_smartctl missing bracket test\n"); + exit(EXIT_FAILURE); + /* LCOV_EXCL_STOP */ + } +} + void selftest(void) { log_tag("selftest:\n"); @@ -866,6 +957,7 @@ void selftest(void) test_crc32c(); test_tommy(); test_wnmatch(); + test_parse_smartctl(); if (raid_selftest() != 0) { /* LCOV_EXCL_START */ log_fatal(EINTERNAL, "Failed SELF test\n"); diff --git a/cmdline/state.c b/cmdline/state.c index b3545430..ad291db6 100644 --- a/cmdline/state.c +++ b/cmdline/state.c @@ -145,6 +145,7 @@ void state_init(struct snapraid_state* state) state->parity[l].split_map[s].device = 0; } state->parity[l].smartctl[0] = 0; + state->parity[l].smartctl_info[0] = 0; for (i = 0; i < SMART_IGNORE_MAX; ++i) state->parity[l].smartignore[i] = 0; state->parity[l].total_blocks = 0; @@ -517,15 +518,75 @@ static void state_config_check(struct snapraid_state* state, const char* path, t } /** - * Validate the smartctl command. + * Parse the smartctl command. * - * It must contains only one %s string, and not other % chars. + * It extracts the optional [info: xxx] tag, validates, and returns + * the cleaned smartctl command and smartctl_info options. */ -static int validate_smartctl(const char* custom) +int parse_smartctl(const char* custom, char* smartctl, size_t smartctl_size, char* smartctl_info, size_t smartctl_info_size) { - const char* s = custom; + const char* s; + const char* info_start = 0; + size_t info_len = 0; + size_t smartctl_len = 0; int arg = 0; + /* initialize output buffers */ + smartctl[0] = 0; + smartctl_info[0] = 0; + + /* look for "[info:" */ + s = custom; + while (*s) { + if (strncmp(s, "[info:", 6) == 0) { + if (info_start) { + /* multiple info tags not allowed */ + return -1; + } + + info_start = s; + s += 6; + + /* skip spaces inside bracket */ + while (isspace((unsigned char)*s)) + ++s; + + /* find matching ']' */ + const char* val_start = s; + while (*s && *s != ']') + ++s; + if (*s != ']') { + /* missing closing bracket */ + return -1; + } + + /* trim trailing spaces inside bracket */ + const char* val_end = s; + while (val_end > val_start && isspace((unsigned char)val_end[-1])) + --val_end; + info_len = val_end - val_start; + if (info_len >= smartctl_info_size) { + /* info string too long */ + return -1; + } + + memcpy(smartctl_info, val_start, info_len); + smartctl_info[info_len] = 0; + ++s; /* skip ']' */ + } else { + if (smartctl_len + 1 >= smartctl_size) { + return -1; + } + smartctl[smartctl_len++] = *s++; + } + } + smartctl[smartctl_len] = 0; + + /* trim extra spaces from the smartctl options */ + strtrim(smartctl); + + /* validate the cleaned smartctl command */ + s = smartctl; while (*s) { if (s[0] == '%' && s[1] == 's') { if (arg) { @@ -534,12 +595,23 @@ static int validate_smartctl(const char* custom) /* LCOV_EXCL_STOP */ } arg = 1; + ++s; } else if (s[0] == '%') { /* LCOV_EXCL_START */ return -1; /* LCOV_EXCL_STOP */ } + ++s; + } + /* validate the smartctl_info command */ + s = smartctl_info; + while (*s) { + if (s[0] == '%') { + /* LCOV_EXCL_START */ + return -1; + /* LCOV_EXCL_STOP */ + } ++s; } @@ -1094,6 +1166,8 @@ void state_config(struct snapraid_state* state, const char* path, const char* co tommy_list_insert_tail(&state->extralist, &extra->node, extra); } else if (strcmp(tag, "smartctl") == 0) { char custom[PATH_MAX]; + char parsed_smartctl[SMART_MAX]; + char parsed_smartctl_info[SMART_MAX]; ret = sgettok(f, buffer, sizeof(buffer)); if (ret < 0) { @@ -1127,7 +1201,7 @@ void state_config(struct snapraid_state* state, const char* path, const char* co /* LCOV_EXCL_STOP */ } - if (validate_smartctl(custom) != 0) { + if (parse_smartctl(custom, parsed_smartctl, sizeof(parsed_smartctl), parsed_smartctl_info, sizeof(parsed_smartctl_info)) != 0) { /* LCOV_EXCL_START */ log_fatal(EUSER, "Invalid 'smartctl' option in '%s' at line %u\n", path, line); exit(EXIT_FAILURE); @@ -1143,7 +1217,8 @@ void state_config(struct snapraid_state* state, const char* path, const char* co /* LCOV_EXCL_STOP */ } - pathcpy(state->parity[level].smartctl, sizeof(state->parity[level].smartctl), custom); + pathcpy(state->parity[level].smartctl, sizeof(state->parity[level].smartctl), parsed_smartctl); + pathcpy(state->parity[level].smartctl_info, sizeof(state->parity[level].smartctl_info), parsed_smartctl_info); } else { /* search the disk */ struct snapraid_disk* found_disk = 0; @@ -1170,7 +1245,8 @@ void state_config(struct snapraid_state* state, const char* path, const char* co /* LCOV_EXCL_STOP */ } - pathcpy(found_disk->smartctl, sizeof(found_disk->smartctl), custom); + pathcpy(found_disk->smartctl, sizeof(found_disk->smartctl), parsed_smartctl); + pathcpy(found_disk->smartctl_info, sizeof(found_disk->smartctl_info), parsed_smartctl_info); } else if (found_extra) { if (found_extra->smartctl[0] != 0) { /* LCOV_EXCL_START */ @@ -1179,7 +1255,8 @@ void state_config(struct snapraid_state* state, const char* path, const char* co /* LCOV_EXCL_STOP */ } - pathcpy(found_extra->smartctl, sizeof(found_extra->smartctl), custom); + pathcpy(found_extra->smartctl, sizeof(found_extra->smartctl), parsed_smartctl); + pathcpy(found_extra->smartctl_info, sizeof(found_extra->smartctl_info), parsed_smartctl_info); } else { /* LCOV_EXCL_START */ log_fatal(EUSER, "Unknown 'smartctl' name '%s' at line %u\n", buffer, line); diff --git a/cmdline/state.h b/cmdline/state.h index a654d68a..e5b5ea08 100644 --- a/cmdline/state.h +++ b/cmdline/state.h @@ -460,5 +460,10 @@ void state_snapshot_cleanup(struct snapraid_state* state); */ void generate_configuration(const char* content); +/** + * Parse smartctl command. + */ +int parse_smartctl(const char* custom, char* smartctl, size_t smartctl_size, char* smartctl_info, size_t smartctl_info_size); + #endif diff --git a/cmdline/unix.c b/cmdline/unix.c index f0bbbb2e..d9d45cfd 100644 --- a/cmdline/unix.c +++ b/cmdline/unix.c @@ -598,30 +598,10 @@ int os_spawn_and_wait(const char** argv) return -1; } -#define ARGV_MAX 64 - -OS_FILE* os_popen(const char** argv, char* extra_args) +OS_FILE* os_popen(const char** argv) { - const char* combined_argv[ARGV_MAX]; - - unsigned argc = 0; - while (argv[argc] && argc < ARGV_MAX) { - combined_argv[argc] = argv[argc]; - ++argc; - } - - if (extra_args) - argc += argsplit(combined_argv + argc, ARGV_MAX - argc, extra_args); - - if (argc >= ARGV_MAX) { - errno = E2BIG; - return NULL; - } - - combined_argv[argc] = 0; - int stdout_fd = -1; - pid_t pid = os_spawn_stdout(combined_argv, &stdout_fd); + pid_t pid = os_spawn_stdout(argv, &stdout_fd); if (pid < 0) { return 0; } diff --git a/cmdline/unixapp.c b/cmdline/unixapp.c index a6375845..deb43c0b 100644 --- a/cmdline/unixapp.c +++ b/cmdline/unixapp.c @@ -839,7 +839,7 @@ static int extract_zfs(const char* dir, char* dataset, size_t dataset_size, char 0 }; - OS_FILE* fp = os_popen(argv, 0); + OS_FILE* fp = os_popen(argv); if (!fp) { /* LCOV_EXCL_START */ return -1; @@ -922,7 +922,7 @@ static int devdereference_zfs(uint64_t device, const char* dir, tommy_list* devl 0 }; - OS_FILE* fp = os_popen(argv, 0); + OS_FILE* fp = os_popen(argv); if (!fp) { /* LCOV_EXCL_START */ return -1; @@ -2769,6 +2769,7 @@ static int devtree(devinfo_t* parent, dev_t device, tommy_list* list) devinfo->device = device; pathcpy(devinfo->name, sizeof(devinfo->name), parent->name); pathcpy(devinfo->smartctl, sizeof(devinfo->smartctl), parent->smartctl); + pathcpy(devinfo->smartctl_info, sizeof(devinfo->smartctl_info), parent->smartctl_info); memcpy(devinfo->smartignore, parent->smartignore, sizeof(devinfo->smartignore)); pathcpy(devinfo->file, sizeof(devinfo->file), path); devinfo->parent = parent; @@ -2857,17 +2858,22 @@ static int devstat(dev_t device, uint64_t* count) } #endif +/** + * Max number of arguments supported. + */ +#define ARGS_MAX 64 + /** * Get SMART attributes. */ #if HAVE_LINUX_DEVICE -static int devsmart(dev_t device, const char* name, const char* smartctl, struct smart_attr* smart, uint64_t* info, char* serial, char* family, char* model, char* interface) +static int devsmart(dev_t device, const char* name, const char* smartctl, const char* smartctl_info, struct smart_attr* smart, uint64_t* info, char* serial, char* family, char* model, char* interface) { - char extra_args[PATH_MAX]; char file[PATH_MAX]; OS_FILE* f; int ret; const char* x; + const char* info_opts = smartctl_info[0] ? smartctl_info : "-a"; x = find_smartctl(); if (!x) { @@ -2884,32 +2890,33 @@ static int devsmart(dev_t device, const char* name, const char* smartctl, struct /* LCOV_EXCL_STOP */ } - /* if there is a custom smartctl command */ - const char* args = "-a"; + const char* argv[ARGS_MAX]; + unsigned argc = 0; + argv[argc++] = x; + + char info_buf[SMART_MAX]; + pathcpy(info_buf, sizeof(info_buf), info_opts); + argc += argsplit(argv + argc, ARGS_MAX - argc - 1, info_buf); + + char extra_args[PATH_MAX]; if (smartctl[0]) { pathprint(extra_args, sizeof(extra_args), smartctl, file); - const char* argv[] = { - x, - "-a", - 0 - }; - log_tag("smartctl:%s:%s:run: %s %s %s\n", file, name, x, args, extra_args); - f = os_popen(argv, extra_args); + argc += argsplit(argv + argc, ARGS_MAX - argc - 1, extra_args); + log_tag("smartctl:%s:%s:run: %s [info: %s] %s\n", file, name, x, info_opts, extra_args); } else { - pathprint(extra_args, sizeof(extra_args), "%s", file); - const char* argv[] = { - x, - "-a", - file, - 0 - }; - log_tag("smartctl:%s:%s:run: %s %s %s\n", file, name, x, args, extra_args); - f = os_popen(argv, 0); + argv[argc++] = file; + log_tag("smartctl:%s:%s:run: %s [info: %s] %s\n", file, name, x, info_opts, file); } + argv[argc++] = 0; + + f = os_popen(argv); if (!f) { /* LCOV_EXCL_START */ log_tag("device:%s:%s:spawn\n", file, name); - log_fatal(EEXTERNAL, "Failed to run '%s %s %s'.\n", x, args, extra_args); + if (smartctl[0]) + log_fatal(EEXTERNAL, "Failed to run '%s %s %s'.\n", x, info_opts, extra_args); + else + log_fatal(EEXTERNAL, "Failed to run '%s %s %s'.\n", x, info_opts, file); return -1; /* LCOV_EXCL_STOP */ } @@ -2929,7 +2936,10 @@ static int devsmart(dev_t device, const char* name, const char* smartctl, struct if (!WIFEXITED(ret)) { /* LCOV_EXCL_START */ log_tag("device:%s:%s:abort\n", file, name); - log_fatal(EEXTERNAL, "Failed to run '%s %s %s' (not exited).\n", x, args, extra_args); + if (smartctl[0]) + log_fatal(EEXTERNAL, "Failed to run '%s %s %s' (not exited).\n", x, info_opts, extra_args); + else + log_fatal(EEXTERNAL, "Failed to run '%s %s %s' (not exited).\n", x, info_opts, file); return -1; /* LCOV_EXCL_STOP */ } @@ -3014,13 +3024,13 @@ static void devattr(dev_t device, uint64_t* info, char* serial, char* family, ch * Get POWER state. */ #if HAVE_LINUX_DEVICE -static int devprobe(dev_t device, const char* name, const char* smartctl, int* power, struct smart_attr* smart, uint64_t* info, char* serial, char* family, char* model, char* interface) +static int devprobe(dev_t device, const char* name, const char* smartctl, const char* smartctl_info, int* power, struct smart_attr* smart, uint64_t* info, char* serial, char* family, char* model, char* interface) { - char extra_args[PATH_MAX]; char file[PATH_MAX]; OS_FILE* f; int ret; const char* x; + const char* info_opts = smartctl_info[0] ? smartctl_info : "-a"; x = find_smartctl(); if (!x) { @@ -3037,36 +3047,35 @@ static int devprobe(dev_t device, const char* name, const char* smartctl, int* p /* LCOV_EXCL_STOP */ } - /* if there is a custom smartctl command */ - const char* args = "-n standby,3 -a"; + const char* argv[ARGS_MAX]; + unsigned argc = 0; + argv[argc++] = x; + argv[argc++] = "-n"; + argv[argc++] = "standby,3"; + + char info_buf[SMART_MAX]; + pathcpy(info_buf, sizeof(info_buf), info_opts); + argc += argsplit(argv + argc, ARGS_MAX - argc - 1, info_buf); + + char extra_args[PATH_MAX]; if (smartctl[0]) { pathprint(extra_args, sizeof(extra_args), smartctl, file); - const char* argv[] = { - x, - "-n", - "standby,3", - "-a", - 0 - }; - log_tag("smartctl:%s:%s:run: %s %s %s\n", file, name, x, args, extra_args); - f = os_popen(argv, extra_args); + argc += argsplit(argv + argc, ARGS_MAX - argc - 1, extra_args); + log_tag("smartctl:%s:%s:run: %s -n standby,3 [info: %s] %s\n", file, name, x, info_opts, extra_args); } else { - pathprint(extra_args, sizeof(extra_args), "%s", file); - const char* argv[] = { - x, - "-n", - "standby,3", - "-a", - file, - 0 - }; - log_tag("smartctl:%s:%s:run: %s %s %s\n", file, name, x, args, extra_args); - f = os_popen(argv, 0); + argv[argc++] = file; + log_tag("smartctl:%s:%s:run: %s -n standby,3 [info: %s] %s\n", file, name, x, info_opts, file); } + argv[argc++] = 0; + + f = os_popen(argv); if (!f) { /* LCOV_EXCL_START */ log_tag("device:%s:%s:spawn\n", file, name); - log_fatal(EEXTERNAL, "Failed to run '%s %s %s'.\n", x, args, extra_args); + if (smartctl[0]) + log_fatal(EEXTERNAL, "Failed to run '%s -n standby,3 %s %s'.\n", x, info_opts, extra_args); + else + log_fatal(EEXTERNAL, "Failed to run '%s -n standby,3 %s %s'.\n", x, info_opts, file); return -1; /* LCOV_EXCL_STOP */ } @@ -3086,7 +3095,10 @@ static int devprobe(dev_t device, const char* name, const char* smartctl, int* p if (!WIFEXITED(ret)) { /* LCOV_EXCL_START */ log_tag("device:%s:%s:abort\n", file, name); - log_fatal(EEXTERNAL, "Failed to run '%s %s %s' (not exited).\n", x, args, extra_args); + if (smartctl[0]) + log_fatal(EEXTERNAL, "Failed to run '%s -n standby,3 %s %s' (not exited).\n", x, info_opts, extra_args); + else + log_fatal(EEXTERNAL, "Failed to run '%s -n standby,3 %s %s' (not exited).\n", x, info_opts, file); return -1; /* LCOV_EXCL_STOP */ } @@ -3134,34 +3146,30 @@ static int devdown(dev_t device, const char* name, const char* smartctl) /* LCOV_EXCL_STOP */ } - /* if there is a custom smartctl command */ - const char* args = "-s standby,now"; + const char* argv[ARGS_MAX]; + unsigned argc = 0; + argv[argc++] = x; + argv[argc++] = "-s"; + argv[argc++] = "standby,now"; + if (smartctl[0]) { pathprint(extra_args, sizeof(extra_args), smartctl, file); - const char* argv[] = { - x, - "-s", - "standby,now", - 0 - }; - log_tag("smartctl:%s:%s:run: %s %s %s\n", file, name, x, args, extra_args); - f = os_popen(argv, extra_args); + argc += argsplit(argv + argc, ARGS_MAX - argc - 1, extra_args); + log_tag("smartctl:%s:%s:run: %s -s standby,now %s\n", file, name, x, extra_args); } else { - pathprint(extra_args, sizeof(extra_args), "%s", file); - const char* argv[] = { - x, - "-s", - "standby,now", - file, - 0 - }; - log_tag("smartctl:%s:%s:run: %s %s %s\n", file, name, x, args, extra_args); - f = os_popen(argv, 0); + argv[argc++] = file; + log_tag("smartctl:%s:%s:run: %s -s standby,now %s\n", file, name, x, file); } + argv[argc++] = 0; + + f = os_popen(argv); if (!f) { /* LCOV_EXCL_START */ log_tag("device:%s:%s:spawn\n", file, name); - log_fatal(EEXTERNAL, "Failed to run '%s %s %s'.\n", x, args, extra_args); + if (smartctl[0]) + log_fatal(EEXTERNAL, "Failed to run '%s -s standby,now %s'.\n", x, extra_args); + else + log_fatal(EEXTERNAL, "Failed to run '%s -s standby,now %s'.\n", x, file); return -1; /* LCOV_EXCL_STOP */ } @@ -3181,7 +3189,10 @@ static int devdown(dev_t device, const char* name, const char* smartctl) if (!WIFEXITED(ret)) { /* LCOV_EXCL_START */ log_tag("device:%s:%s:abort\n", file, name); - log_fatal(EEXTERNAL, "Failed to run '%s %s %s' (not exited).\n", x, args, extra_args); + if (smartctl[0]) + log_fatal(EEXTERNAL, "Failed to run '%s -s standby,now %s' (not exited).\n", x, extra_args); + else + log_fatal(EEXTERNAL, "Failed to run '%s -s standby,now %s' (not exited).\n", x, file); return -1; /* LCOV_EXCL_STOP */ } @@ -3189,7 +3200,10 @@ static int devdown(dev_t device, const char* name, const char* smartctl) if (WEXITSTATUS(ret) != 0) { /* LCOV_EXCL_START */ log_tag("device:%s:%s:exit:%d\n", file, name, WEXITSTATUS(ret)); - log_fatal(EEXTERNAL, "Failed to run '%s %s %s' with return code %xh.\n", x, args, extra_args, WEXITSTATUS(ret)); + if (smartctl[0]) + log_fatal(EEXTERNAL, "Failed to run '%s -s standby,now %s' with return code %xh.\n", x, extra_args, WEXITSTATUS(ret)); + else + log_fatal(EEXTERNAL, "Failed to run '%s -s standby,now %s' with return code %xh.\n", x, file, WEXITSTATUS(ret)); return -1; /* LCOV_EXCL_STOP */ } @@ -3204,11 +3218,11 @@ static int devdown(dev_t device, const char* name, const char* smartctl) * Spin down a specific device if it's up. */ #if HAVE_LINUX_DEVICE -static int devdownifup(dev_t device, const char* name, const char* smartctl, int* power) +static int devdownifup(dev_t device, const char* name, const char* smartctl, const char* smartctl_info, int* power) { *power = POWER_UNKNOWN; - if (devprobe(device, name, smartctl, power, 0, 0, 0, 0, 0, 0) != 0) + if (devprobe(device, name, smartctl, smartctl_info, power, 0, 0, 0, 0, 0, 0) != 0) return -1; if (*power == POWER_ACTIVE) @@ -3372,7 +3386,7 @@ static void* thread_spinup(void* arg) msg_status("Spunup device '%s' for disk '%s' in %" PRIu64 " ms.\n", devinfo->file, devinfo->name, os_tick_ms() - start); /* after the spin up, get SMART info */ - if (devsmart(devinfo->device, devinfo->name, devinfo->smartctl, devinfo->smart, devinfo->info, devinfo->serial, devinfo->family, devinfo->model, devinfo->interf) != 0) { + if (devsmart(devinfo->device, devinfo->name, devinfo->smartctl, devinfo->smartctl_info, devinfo->smart, devinfo->info, devinfo->serial, devinfo->family, devinfo->model, devinfo->interf) != 0) { /* LCOV_EXCL_START */ return (void*)-1; /* LCOV_EXCL_STOP */ @@ -3435,7 +3449,7 @@ static void* thread_spindownifup(void* arg) start = os_tick_ms(); - if (devdownifup(devinfo->device, devinfo->name, devinfo->smartctl, &power) != 0) { + if (devdownifup(devinfo->device, devinfo->name, devinfo->smartctl, devinfo->smartctl_info, &power) != 0) { /* LCOV_EXCL_START */ return (void*)-1; /* LCOV_EXCL_STOP */ @@ -3459,7 +3473,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->family, devinfo->model, devinfo->interf) != 0) { + if (devsmart(devinfo->device, devinfo->name, devinfo->smartctl, devinfo->smartctl_info, devinfo->smart, devinfo->info, devinfo->serial, devinfo->family, devinfo->model, devinfo->interf) != 0) { /* LCOV_EXCL_START */ return (void*)-1; /* LCOV_EXCL_STOP */ @@ -3488,7 +3502,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->smart, devinfo->info, devinfo->serial, devinfo->family, devinfo->model, devinfo->interf) != 0) { + if (devprobe(devinfo->device, devinfo->name, devinfo->smartctl, devinfo->smartctl_info, &devinfo->power, devinfo->smart, devinfo->info, devinfo->serial, devinfo->family, devinfo->model, devinfo->interf) != 0) { /* LCOV_EXCL_START */ return (void*)-1; /* LCOV_EXCL_STOP */ diff --git a/doc/snapraid-de.1 b/doc/snapraid-de.1 index fb2b2613..559d6200 100644 --- a/doc/snapraid-de.1 +++ b/doc/snapraid-de.1 @@ -1762,6 +1762,9 @@ In den angegebenen OPTIONS wird die Zeichenfolge \`%s\` durch den Gerätenamen ersetzt. Bei RAID\-Controllern ist das Gerät wahrscheinlich fest, und Sie müssen \`%s\` möglicherweise nicht verwenden. .PP +Sie können auch eine benutzerdefinierte Info\-Optionszeichenfolge mit dem +Tag \`[info: ...]\` angeben, um die Standardoption \`\-a\` zu ersetzen. +.PP Weitere mögliche Optionen finden Sie in der smartmontools\-Dokumentation: .PP .RS 4 @@ -1777,6 +1780,10 @@ https://www.smartmontools.org/wiki/Supported_USB\-Devices Zum Beispiel: .PP .RS 4 +smartctl d1 [info: \-H \-i \-c \-A] \-d sat %s +.PD 0 +.PP +.PD smartctl parity \-d sat %s .PD 0 .PD @@ -1845,7 +1852,7 @@ exclude /tmp/ .PD 0 .PP .PD -smartctl d1 \-d sat %s +smartctl d1 [info: \-H \-i \-c \-A] \-d sat %s .PD 0 .PP .PD diff --git a/doc/snapraid-de.d b/doc/snapraid-de.d index 4fac8c96..0409cf96 100644 --- a/doc/snapraid-de.d +++ b/doc/snapraid-de.d @@ -1465,6 +1465,9 @@ Configuration Gerätenamen ersetzt. Bei RAID-Controllern ist das Gerät wahrscheinlich fest, und Sie müssen `%s` möglicherweise nicht verwenden. + Sie können auch eine benutzerdefinierte Info-Optionszeichenfolge mit dem + Tag `[info: ...]` angeben, um die Standardoption `-a` zu ersetzen. + Weitere mögliche Optionen finden Sie in der smartmontools-Dokumentation: :https://www.smartmontools.org/wiki/Supported_RAID-Controllers @@ -1472,6 +1475,7 @@ Configuration Zum Beispiel: + :smartctl d1 [info: -H -i -c -A] -d sat %s :smartctl parity -d sat %s smartignore DISK/PARITY ATTR [ATTR...] @@ -1506,7 +1510,7 @@ Configuration :data d3 /mnt/disk3/ :exclude /lost+found/ :exclude /tmp/ - :smartctl d1 -d sat %s + :smartctl d1 [info: -H -i -c -A] -d sat %s :smartctl d2 -d usbjmicron %s :smartctl parity -d areca,1/1 /dev/sg0 :smartctl 2-parity -d areca,2/1 /dev/sg0 diff --git a/doc/snapraid-de.txt b/doc/snapraid-de.txt index fcb1e557..a9a3da9a 100644 --- a/doc/snapraid-de.txt +++ b/doc/snapraid-de.txt @@ -1563,6 +1563,9 @@ In den angegebenen OPTIONS wird die Zeichenfolge `%s` durch den Gerätenamen ersetzt. Bei RAID-Controllern ist das Gerät wahrscheinlich fest, und Sie müssen `%s` möglicherweise nicht verwenden. +Sie können auch eine benutzerdefinierte Info-Optionszeichenfolge mit dem +Tag `[info: ...]` angeben, um die Standardoption `-a` zu ersetzen. + Weitere mögliche Optionen finden Sie in der smartmontools-Dokumentation: https://www.smartmontools.org/wiki/Supported_RAID-Controllers @@ -1570,6 +1573,7 @@ Weitere mögliche Optionen finden Sie in der smartmontools-Dokumentation: Zum Beispiel: + smartctl d1 [info: -H -i -c -A] -d sat %s smartctl parity -d sat %s 7.18 smartignore DISK/PARITY ATTR [ATTR...] @@ -1608,7 +1612,7 @@ Ein Beispiel für eine typische Konfiguration für Unix ist: data d3 /mnt/disk3/ exclude /lost+found/ exclude /tmp/ - smartctl d1 -d sat %s + smartctl d1 [info: -H -i -c -A] -d sat %s smartctl d2 -d usbjmicron %s smartctl parity -d areca,1/1 /dev/sg0 smartctl 2-parity -d areca,2/1 /dev/sg0 diff --git a/doc/snapraid-es.1 b/doc/snapraid-es.1 index e7f4347d..1823c55f 100644 --- a/doc/snapraid-es.1 +++ b/doc/snapraid-es.1 @@ -1714,6 +1714,10 @@ En las OPCIONES especificadas, la cadena \`%s\` se reemplaza por el nombre del dispositivo. Para los controladores RAID, el dispositivo es probable que sea fijo y es posible que no necesite usar \`%s\`. .PP +También puede especificar una cadena de opciones de información +personalizada mediante la etiqueta \`[info: ...]\` para sustituir +la opción \`\-a\` predeterminada. +.PP Consulte la documentación de smartmontools para conocer las posibles opciones: .PP @@ -1730,6 +1734,10 @@ https://www.smartmontools.org/wiki/Supported_USB\-Devices Por ejemplo: .PP .RS 4 +smartctl d1 [info: \-H \-i \-c \-A] \-d sat %s +.PD 0 +.PP +.PD smartctl parity \-d sat %s .PD 0 .PD @@ -1797,7 +1805,7 @@ exclude /tmp/ .PD 0 .PP .PD -smartctl d1 \-d sat %s +smartctl d1 [info: \-H \-i \-c \-A] \-d sat %s .PD 0 .PP .PD @@ -1853,7 +1861,7 @@ exclude \\System Volume Information .PD 0 .PP .PD -smartctl d1 \-d sat %s +smartctl d1 [info: \-H \-i \-c \-A] \-d sat %s .PD 0 .PP .PD diff --git a/doc/snapraid-es.d b/doc/snapraid-es.d index b791952e..3dd555fa 100644 --- a/doc/snapraid-es.d +++ b/doc/snapraid-es.d @@ -1428,6 +1428,10 @@ Configuration el nombre del dispositivo. Para los controladores RAID, el dispositivo es probable que sea fijo y es posible que no necesite usar `%s`. + También puede especificar una cadena de opciones de información + personalizada mediante la etiqueta `[info: ...]` para sustituir + la opción `-a` predeterminada. + Consulte la documentación de smartmontools para conocer las posibles opciones: @@ -1436,6 +1440,7 @@ Configuration Por ejemplo: + :smartctl d1 [info: -H -i -c -A] -d sat %s :smartctl parity -d sat %s smartignore DISK/PARITY ATTR [ATTR...] @@ -1469,7 +1474,7 @@ Configuration :data d3 /mnt/disk3/ :exclude /lost+found/ :exclude /tmp/ - :smartctl d1 -d sat %s + :smartctl d1 [info: -H -i -c -A] -d sat %s :smartctl d2 -d usbjmicron %s :smartctl parity -d areca,1/1 /dev/sg0 :smartctl 2-parity -d areca,2/1 /dev/sg0 @@ -1485,7 +1490,7 @@ Configuration :exclude Thumbs.db :exclude \$RECYCLE.BIN :exclude \System Volume Information - :smartctl d1 -d sat %s + :smartctl d1 [info: -H -i -c -A] -d sat %s :smartctl d2 -d usbjmicron %s :smartctl parity -d areca,1/1 /dev/arcmsr0 :smartctl 2-parity -d areca,2/1 /dev/arcmsr0 diff --git a/doc/snapraid-es.txt b/doc/snapraid-es.txt index f6fa555b..f1d0facf 100644 --- a/doc/snapraid-es.txt +++ b/doc/snapraid-es.txt @@ -1526,6 +1526,10 @@ En las OPCIONES especificadas, la cadena `%s` se reemplaza por el nombre del dispositivo. Para los controladores RAID, el dispositivo es probable que sea fijo y es posible que no necesite usar `%s`. +También puede especificar una cadena de opciones de información +personalizada mediante la etiqueta `[info: ...]` para sustituir +la opción `-a` predeterminada. + Consulte la documentación de smartmontools para conocer las posibles opciones: @@ -1534,6 +1538,7 @@ opciones: Por ejemplo: + smartctl d1 [info: -H -i -c -A] -d sat %s smartctl parity -d sat %s 7.18 smartignore DISK/PARITY ATTR [ATTR...] @@ -1571,7 +1576,7 @@ Un ejemplo de una configuración típica para Unix es: data d3 /mnt/disk3/ exclude /lost+found/ exclude /tmp/ - smartctl d1 -d sat %s + smartctl d1 [info: -H -i -c -A] -d sat %s smartctl d2 -d usbjmicron %s smartctl parity -d areca,1/1 /dev/sg0 smartctl 2-parity -d areca,2/1 /dev/sg0 @@ -1587,7 +1592,7 @@ Un ejemplo de una configuración típica para Windows es: exclude Thumbs.db exclude \$RECYCLE.BIN exclude \System Volume Information - smartctl d1 -d sat %s + smartctl d1 [info: -H -i -c -A] -d sat %s smartctl d2 -d usbjmicron %s smartctl parity -d areca,1/1 /dev/arcmsr0 smartctl 2-parity -d areca,2/1 /dev/arcmsr0 diff --git a/doc/snapraid-fr.1 b/doc/snapraid-fr.1 index 23ee4d4f..8b995ade 100644 --- a/doc/snapraid-fr.1 +++ b/doc/snapraid-fr.1 @@ -1747,6 +1747,10 @@ Dans les OPTIONS spécifiées, la chaîne \`%s\` est remplacée par le nom du périphérique. Pour les contrôleurs RAID, le périphérique est probablement fixe, et vous n\'aurez peut\-être pas besoin d\'utiliser \`%s\`. .PP +Vous pouvez également spécifier une chaîne d\'options d\'information +personnalisée à l\'aide de la balise \`[info: ...]\` pour remplacer +l\'option \`\-a\` par défaut. +.PP Consultez la documentation smartmontools pour les options possibles : .PP .RS 4 @@ -1762,6 +1766,10 @@ https://www.smartmontools.org/wiki/Supported_USB\-Devices Par exemple : .PP .RS 4 +smartctl d1 [info: \-H \-i \-c \-A] \-d sat %s +.PD 0 +.PP +.PD smartctl parity \-d sat %s .PD 0 .PD @@ -1829,7 +1837,7 @@ exclude /tmp/ .PD 0 .PP .PD -smartctl d1 \-d sat %s +smartctl d1 [info: \-H \-i \-c \-A] \-d sat %s .PD 0 .PP .PD @@ -1885,7 +1893,7 @@ exclude \\System Volume Information .PD 0 .PP .PD -smartctl d1 \-d sat %s +smartctl d1 [info: \-H \-i \-c \-A] \-d sat %s .PD 0 .PP .PD diff --git a/doc/snapraid-fr.d b/doc/snapraid-fr.d index d7165e8e..16494b05 100644 --- a/doc/snapraid-fr.d +++ b/doc/snapraid-fr.d @@ -1464,6 +1464,10 @@ Configuration nom du périphérique. Pour les contrôleurs RAID, le périphérique est probablement fixe, et vous n'aurez peut-être pas besoin d'utiliser `%s`. + Vous pouvez également spécifier une chaîne d'options d'information + personnalisée à l'aide de la balise `[info: ...]` pour remplacer + l'option `-a` par défaut. + Consultez la documentation smartmontools pour les options possibles : :https://www.smartmontools.org/wiki/Supported_RAID-Controllers @@ -1471,6 +1475,7 @@ Configuration Par exemple : + :smartctl d1 [info: -H -i -c -A] -d sat %s :smartctl parity -d sat %s smartignore DISQUE/PARITÉ ATTR [ATTR...] @@ -1504,7 +1509,7 @@ Configuration :data d3 /mnt/disk3/ :exclude /lost+found/ :exclude /tmp/ - :smartctl d1 -d sat %s + :smartctl d1 [info: -H -i -c -A] -d sat %s :smartctl d2 -d usbjmicron %s :smartctl parity -d areca,1/1 /dev/sg0 :smartctl 2-parity -d areca,2/1 /dev/sg0 @@ -1520,7 +1525,7 @@ Configuration :exclude Thumbs.db :exclude \$RECYCLE.BIN :exclude \System Volume Information - :smartctl d1 -d sat %s + :smartctl d1 [info: -H -i -c -A] -d sat %s :smartctl d2 -d usbjmicron %s :smartctl parity -d areca,1/1 /dev/arcmsr0 :smartctl 2-parity -d areca,2/1 /dev/arcmsr0 diff --git a/doc/snapraid-fr.txt b/doc/snapraid-fr.txt index d8b4a67d..3d00c143 100644 --- a/doc/snapraid-fr.txt +++ b/doc/snapraid-fr.txt @@ -1562,6 +1562,10 @@ Dans les OPTIONS spécifiées, la chaîne `%s` est remplacée par le nom du périphérique. Pour les contrôleurs RAID, le périphérique est probablement fixe, et vous n'aurez peut-être pas besoin d'utiliser `%s`. +Vous pouvez également spécifier une chaîne d'options d'information +personnalisée à l'aide de la balise `[info: ...]` pour remplacer +l'option `-a` par défaut. + Consultez la documentation smartmontools pour les options possibles : https://www.smartmontools.org/wiki/Supported_RAID-Controllers @@ -1569,6 +1573,7 @@ Consultez la documentation smartmontools pour les options possibles : Par exemple : + smartctl d1 [info: -H -i -c -A] -d sat %s smartctl parity -d sat %s 7.18 smartignore DISQUE/PARITÉ ATTR [ATTR...] @@ -1606,7 +1611,7 @@ Un exemple de configuration typique pour Unix est : data d3 /mnt/disk3/ exclude /lost+found/ exclude /tmp/ - smartctl d1 -d sat %s + smartctl d1 [info: -H -i -c -A] -d sat %s smartctl d2 -d usbjmicron %s smartctl parity -d areca,1/1 /dev/sg0 smartctl 2-parity -d areca,2/1 /dev/sg0 @@ -1622,7 +1627,7 @@ Un exemple de configuration typique pour Windows est : exclude Thumbs.db exclude \$RECYCLE.BIN exclude \System Volume Information - smartctl d1 -d sat %s + smartctl d1 [info: -H -i -c -A] -d sat %s smartctl d2 -d usbjmicron %s smartctl parity -d areca,1/1 /dev/arcmsr0 smartctl 2-parity -d areca,2/1 /dev/arcmsr0 diff --git a/doc/snapraid-it.1 b/doc/snapraid-it.1 index 88e8262c..9df0a997 100644 --- a/doc/snapraid-it.1 +++ b/doc/snapraid-it.1 @@ -1737,6 +1737,10 @@ Nelle OPTIONS specificate, la stringa \`%s\` viene sostituita dal nome del dispositivo. Per i controller RAID, il dispositivo è probabilmente fisso e potrebbe non essere necessario utilizzare \`%s\`. .PP +È inoltre possibile specificare una stringa di opzioni di informazioni +personalizzate tramite il tag \`[info: ...]\` per sostituire l\'opzione +\`\-a\` predefinita. +.PP Fare riferimento alla documentazione di smartmontools per le possibili opzioni: .PP @@ -1753,6 +1757,10 @@ https://www.smartmontools.org/wiki/Supported_USB\-Devices Ad esempio: .PP .RS 4 +smartctl d1 [info: \-H \-i \-c \-A] \-d sat %s +.PD 0 +.PP +.PD smartctl parity \-d sat %s .PD 0 .PD @@ -1820,7 +1828,7 @@ exclude /tmp/ .PD 0 .PP .PD -smartctl d1 \-d sat %s +smartctl d1 [info: \-H \-i \-c \-A] \-d sat %s .PD 0 .PP .PD @@ -1876,7 +1884,7 @@ exclude \\System Volume Information .PD 0 .PP .PD -smartctl d1 \-d sat %s +smartctl d1 [info: \-H \-i \-c \-A] \-d sat %s .PD 0 .PP .PD diff --git a/doc/snapraid-it.d b/doc/snapraid-it.d index 553f69c3..e408e8a1 100644 --- a/doc/snapraid-it.d +++ b/doc/snapraid-it.d @@ -1440,6 +1440,10 @@ Configurazione nome del dispositivo. Per i controller RAID, il dispositivo è probabilmente fisso e potrebbe non essere necessario utilizzare `%s`. + È inoltre possibile specificare una stringa di opzioni di informazioni + personalizzate tramite il tag `[info: ...]` per sostituire l'opzione + `-a` predefinita. + Fare riferimento alla documentazione di smartmontools per le possibili opzioni: @@ -1448,6 +1452,7 @@ Configurazione Ad esempio: + :smartctl d1 [info: -H -i -c -A] -d sat %s :smartctl parity -d sat %s smartignore DISK/PARITY ATTR [ATTR...] @@ -1481,7 +1486,7 @@ Configurazione :data d3 /mnt/disk3/ :exclude /lost+found/ :exclude /tmp/ - :smartctl d1 -d sat %s + :smartctl d1 [info: -H -i -c -A] -d sat %s :smartctl d2 -d usbjmicron %s :smartctl parity -d areca,1/1 /dev/sg0 :smartctl 2-parity -d areca,2/1 /dev/sg0 @@ -1497,7 +1502,7 @@ Configurazione :exclude Thumbs.db :exclude \$RECYCLE.BIN :exclude \System Volume Information - :smartctl d1 -d sat %s + :smartctl d1 [info: -H -i -c -A] -d sat %s :smartctl d2 -d usbjmicron %s :smartctl parity -d areca,1/1 /dev/arcmsr0 :smartctl 2-parity -d areca,2/1 /dev/arcmsr0 diff --git a/doc/snapraid-it.txt b/doc/snapraid-it.txt index efd76cab..4562e434 100644 --- a/doc/snapraid-it.txt +++ b/doc/snapraid-it.txt @@ -1538,6 +1538,10 @@ Nelle OPTIONS specificate, la stringa `%s` viene sostituita dal nome del dispositivo. Per i controller RAID, il dispositivo è probabilmente fisso e potrebbe non essere necessario utilizzare `%s`. +È inoltre possibile specificare una stringa di opzioni di informazioni +personalizzate tramite il tag `[info: ...]` per sostituire l'opzione +`-a` predefinita. + Fare riferimento alla documentazione di smartmontools per le possibili opzioni: @@ -1546,6 +1550,7 @@ opzioni: Ad esempio: + smartctl d1 [info: -H -i -c -A] -d sat %s smartctl parity -d sat %s 7.18 smartignore DISK/PARITY ATTR [ATTR...] @@ -1583,7 +1588,7 @@ Un esempio di configurazione tipica per Unix è: data d3 /mnt/disk3/ exclude /lost+found/ exclude /tmp/ - smartctl d1 -d sat %s + smartctl d1 [info: -H -i -c -A] -d sat %s smartctl d2 -d usbjmicron %s smartctl parity -d areca,1/1 /dev/sg0 smartctl 2-parity -d areca,2/1 /dev/sg0 @@ -1599,7 +1604,7 @@ Un esempio di configurazione tipica per Windows è: exclude Thumbs.db exclude \$RECYCLE.BIN exclude \System Volume Information - smartctl d1 -d sat %s + smartctl d1 [info: -H -i -c -A] -d sat %s smartctl d2 -d usbjmicron %s smartctl parity -d areca,1/1 /dev/arcmsr0 smartctl 2-parity -d areca,2/1 /dev/arcmsr0 diff --git a/doc/snapraid-ja.1 b/doc/snapraid-ja.1 index 9bfc81dd..f04ec02b 100644 --- a/doc/snapraid-ja.1 +++ b/doc/snapraid-ja.1 @@ -1546,6 +1546,9 @@ PARITY はパリティ名のいずれかです:\`parity\`、\`2\-parity\`、\` RAIDコントローラーの場合、デバイスは固定されている可能性が高いため、 \`%s\` を使用する必要はないかもしれません。 .PP +デフォルトの \`\-a\` オプションを置き換えるために、\`[info: ...]\` タグを使用して +カスタム情報オプション文字列を指定することもできます。 +.PP 使用可能なオプションについては、smartmontoolsのドキュメントを参照してください。 .PP .RS 4 @@ -1561,6 +1564,10 @@ https://www.smartmontools.org/wiki/Supported_USB\-Devices 例: .PP .RS 4 +smartctl d1 [info: \-H \-i \-c \-A] \-d sat %s +.PD 0 +.PP +.PD smartctl parity \-d sat %s .PD 0 .PD @@ -1626,7 +1633,7 @@ exclude /tmp/ .PD 0 .PP .PD -smartctl d1 \-d sat %s +smartctl d1 [info: \-H \-i \-c \-A] \-d sat %s .PD 0 .PP .PD @@ -1682,7 +1689,7 @@ exclude \\System Volume Information .PD 0 .PP .PD -smartctl d1 \-d sat %s +smartctl d1 [info: \-H \-i \-c \-A] \-d sat %s .PD 0 .PP .PD diff --git a/doc/snapraid-ja.d b/doc/snapraid-ja.d index 87ae0674..32f42531 100644 --- a/doc/snapraid-ja.d +++ b/doc/snapraid-ja.d @@ -1260,6 +1260,9 @@ Configuration RAIDコントローラーの場合、デバイスは固定されている可能性が高いため、 `%s` を使用する必要はないかもしれません。 + デフォルトの `-a` オプションを置き換えるために、`[info: ...]` タグを使用して + カスタム情報オプション文字列を指定することもできます。 + 使用可能なオプションについては、smartmontoolsのドキュメントを参照してください。 :https://www.smartmontools.org/wiki/Supported_RAID-Controllers @@ -1267,6 +1270,7 @@ Configuration 例: + :smartctl d1 [info: -H -i -c -A] -d sat %s :smartctl parity -d sat %s smartignore DISK/PARITY ATTR [ATTR...] @@ -1298,7 +1302,7 @@ Configuration :data d3 /mnt/disk3/ :exclude /lost+found/ :exclude /tmp/ - :smartctl d1 -d sat %s + :smartctl d1 [info: -H -i -c -A] -d sat %s :smartctl d2 -d usbjmicron %s :smartctl parity -d areca,1/1 /dev/sg0 :smartctl 2-parity -d areca,2/1 /dev/sg0 @@ -1314,7 +1318,7 @@ Configuration :exclude Thumbs.db :exclude \$RECYCLE.BIN :exclude \System Volume Information - :smartctl d1 -d sat %s + :smartctl d1 [info: -H -i -c -A] -d sat %s :smartctl d2 -d usbjmicron %s :smartctl parity -d areca,1/1 /dev/arcmsr0 :smartctl 2-parity -d areca,2/1 /dev/arcmsr0 diff --git a/doc/snapraid-ja.txt b/doc/snapraid-ja.txt index 8bf6eeb9..9751c7b1 100644 --- a/doc/snapraid-ja.txt +++ b/doc/snapraid-ja.txt @@ -1358,6 +1358,9 @@ PARITY はパリティ名のいずれかです:`parity`、`2-parity`、`3-pari RAIDコントローラーの場合、デバイスは固定されている可能性が高いため、 `%s` を使用する必要はないかもしれません。 +デフォルトの `-a` オプションを置き換えるために、`[info: ...]` タグを使用して +カスタム情報オプション文字列を指定することもできます。 + 使用可能なオプションについては、smartmontoolsのドキュメントを参照してください。 https://www.smartmontools.org/wiki/Supported_RAID-Controllers @@ -1365,6 +1368,7 @@ RAIDコントローラーの場合、デバイスは固定されている可能 例: + smartctl d1 [info: -H -i -c -A] -d sat %s smartctl parity -d sat %s 7.18 smartignore DISK/PARITY ATTR [ATTR...] @@ -1400,7 +1404,7 @@ Unixの一般的な構成の例は次のとおりです。 data d3 /mnt/disk3/ exclude /lost+found/ exclude /tmp/ - smartctl d1 -d sat %s + smartctl d1 [info: -H -i -c -A] -d sat %s smartctl d2 -d usbjmicron %s smartctl parity -d areca,1/1 /dev/sg0 smartctl 2-parity -d areca,2/1 /dev/sg0 @@ -1416,7 +1420,7 @@ Windowsの一般的な構成の例は次のとおりです。 exclude Thumbs.db exclude \$RECYCLE.BIN exclude \System Volume Information - smartctl d1 -d sat %s + smartctl d1 [info: -H -i -c -A] -d sat %s smartctl d2 -d usbjmicron %s smartctl parity -d areca,1/1 /dev/arcmsr0 smartctl 2-parity -d areca,2/1 /dev/arcmsr0 diff --git a/doc/snapraid-ko.1 b/doc/snapraid-ko.1 index ba02c4f8..3d1bd0a0 100644 --- a/doc/snapraid-ko.1 +++ b/doc/snapraid-ko.1 @@ -1591,6 +1591,9 @@ PARITY는 \`parity\`, \`2\-parity\`, \`3\-parity\`, \`4\-parity\`, \`5\-parity\` RAID 컨트롤러의 경우 장치가 고정되어 있을 가능성이 높으므로 \`%s\`를 사용할 필요가 없을 수 있습니다. .PP +기본 \`\-a\` 옵션을 대체하기 위해 \`[info: ...]\` 태그를 사용하여 +사용자 정의 정보 옵션 문자열을 지정할 수도 있습니다. +.PP 가능한 옵션은 smartmontools 설명서를 참조하십시오: .PP .RS 4 @@ -1606,6 +1609,10 @@ https://www.smartmontools.org/wiki/Supported_USB\-Devices 예: .PP .RS 4 +smartctl d1 [info: \-H \-i \-c \-A] \-d sat %s +.PD 0 +.PP +.PD smartctl parity \-d sat %s .PD 0 .PD @@ -1672,7 +1679,7 @@ exclude /tmp/ .PD 0 .PP .PD -smartctl d1 \-d sat %s +smartctl d1 [info: \-H \-i \-c \-A] \-d sat %s .PD 0 .PP .PD @@ -1728,7 +1735,7 @@ exclude \\System Volume Information .PD 0 .PP .PD -smartctl d1 \-d sat %s +smartctl d1 [info: \-H \-i \-c \-A] \-d sat %s .PD 0 .PP .PD diff --git a/doc/snapraid-ko.d b/doc/snapraid-ko.d index 77975251..beed6dcd 100644 --- a/doc/snapraid-ko.d +++ b/doc/snapraid-ko.d @@ -1305,6 +1305,9 @@ Configuration RAID 컨트롤러의 경우 장치가 고정되어 있을 가능성이 높으므로 `%s`를 사용할 필요가 없을 수 있습니다. + 기본 `-a` 옵션을 대체하기 위해 `[info: ...]` 태그를 사용하여 + 사용자 정의 정보 옵션 문자열을 지정할 수도 있습니다. + 가능한 옵션은 smartmontools 설명서를 참조하십시오: :https://www.smartmontools.org/wiki/Supported_RAID-Controllers @@ -1312,6 +1315,7 @@ Configuration 예: + :smartctl d1 [info: -H -i -c -A] -d sat %s :smartctl parity -d sat %s smartignore DISK/PARITY ATTR [ATTR...] @@ -1344,7 +1348,7 @@ Configuration :data d3 /mnt/disk3/ :exclude /lost+found/ :exclude /tmp/ - :smartctl d1 -d sat %s + :smartctl d1 [info: -H -i -c -A] -d sat %s :smartctl d2 -d usbjmicron %s :smartctl parity -d areca,1/1 /dev/sg0 :smartctl 2-parity -d areca,2/1 /dev/sg0 @@ -1360,7 +1364,7 @@ Configuration :exclude Thumbs.db :exclude \$RECYCLE.BIN :exclude \System Volume Information - :smartctl d1 -d sat %s + :smartctl d1 [info: -H -i -c -A] -d sat %s :smartctl d2 -d usbjmicron %s :smartctl parity -d areca,1/1 /dev/arcmsr0 :smartctl 2-parity -d areca,2/1 /dev/arcmsr0 diff --git a/doc/snapraid-ko.txt b/doc/snapraid-ko.txt index 489bc7fb..bab04c3c 100644 --- a/doc/snapraid-ko.txt +++ b/doc/snapraid-ko.txt @@ -1403,6 +1403,9 @@ PARITY는 `parity`, `2-parity`, `3-parity`, `4-parity`, `5-parity`, RAID 컨트롤러의 경우 장치가 고정되어 있을 가능성이 높으므로 `%s`를 사용할 필요가 없을 수 있습니다. +기본 `-a` 옵션을 대체하기 위해 `[info: ...]` 태그를 사용하여 +사용자 정의 정보 옵션 문자열을 지정할 수도 있습니다. + 가능한 옵션은 smartmontools 설명서를 참조하십시오: https://www.smartmontools.org/wiki/Supported_RAID-Controllers @@ -1410,6 +1413,7 @@ RAID 컨트롤러의 경우 장치가 고정되어 있을 가능성이 높으므 예: + smartctl d1 [info: -H -i -c -A] -d sat %s smartctl parity -d sat %s 7.18 smartignore DISK/PARITY ATTR [ATTR...] @@ -1446,7 +1450,7 @@ Unix의 일반적인 설정 예는 다음과 같습니다: data d3 /mnt/disk3/ exclude /lost+found/ exclude /tmp/ - smartctl d1 -d sat %s + smartctl d1 [info: -H -i -c -A] -d sat %s smartctl d2 -d usbjmicron %s smartctl parity -d areca,1/1 /dev/sg0 smartctl 2-parity -d areca,2/1 /dev/sg0 @@ -1462,7 +1466,7 @@ Windows의 일반적인 설정 예는 다음과 같습니다: exclude Thumbs.db exclude \$RECYCLE.BIN exclude \System Volume Information - smartctl d1 -d sat %s + smartctl d1 [info: -H -i -c -A] -d sat %s smartctl d2 -d usbjmicron %s smartctl parity -d areca,1/1 /dev/arcmsr0 smartctl 2-parity -d areca,2/1 /dev/arcmsr0 diff --git a/doc/snapraid-pl.1 b/doc/snapraid-pl.1 index f064534c..573a32e1 100644 --- a/doc/snapraid-pl.1 +++ b/doc/snapraid-pl.1 @@ -1638,6 +1638,9 @@ W określonych OPCJACH ciąg \`%s\` jest zastępowany nazwą urządzenia. W przypadku kontrolerów RAID, urządzenie jest prawdopodobnie stałe i może nie być konieczne użycie \`%s\`. .PP +Możesz również określić niestandardowy ciąg opcji informacyjnych za pomocą +znacznika \`[info: ...]\`, aby zastąpić domyślną opcję \`\-a\`. +.PP Zapoznaj się z dokumentacją smartmontools, aby uzyskać możliwe opcje: .PP .RS 4 @@ -1653,6 +1656,10 @@ https://www.smartmontools.org/wiki/Supported_USB\-Devices Na przykład: .PP .RS 4 +smartctl d1 [info: \-H \-i \-c \-A] \-d sat %s +.PD 0 +.PP +.PD smartctl parity \-d sat %s .PD 0 .PD @@ -1719,7 +1726,7 @@ exclude /tmp/ .PD 0 .PP .PD -smartctl d1 \-d sat %s +smartctl d1 [info: \-H \-i \-c \-A] \-d sat %s .PD 0 .PP .PD @@ -1775,7 +1782,7 @@ exclude \\System Volume Information .PD 0 .PP .PD -smartctl d1 \-d sat %s +smartctl d1 [info: \-H \-i \-c \-A] \-d sat %s .PD 0 .PP .PD diff --git a/doc/snapraid-pl.d b/doc/snapraid-pl.d index e2b9a57e..48423766 100644 --- a/doc/snapraid-pl.d +++ b/doc/snapraid-pl.d @@ -1352,6 +1352,9 @@ Configuration nazwą urządzenia. W przypadku kontrolerów RAID, urządzenie jest prawdopodobnie stałe i może nie być konieczne użycie `%s`. + Możesz również określić niestandardowy ciąg opcji informacyjnych za pomocą + znacznika `[info: ...]`, aby zastąpić domyślną opcję `-a`. + Zapoznaj się z dokumentacją smartmontools, aby uzyskać możliwe opcje: :https://www.smartmontools.org/wiki/Supported_RAID-Controllers @@ -1359,6 +1362,7 @@ Configuration Na przykład: + :smartctl d1 [info: -H -i -c -A] -d sat %s :smartctl parity -d sat %s smartignore DISK/PARITY ATTR [ATTR...] @@ -1391,7 +1395,7 @@ Configuration :data d3 /mnt/disk3/ :exclude /lost+found/ :exclude /tmp/ - :smartctl d1 -d sat %s + :smartctl d1 [info: -H -i -c -A] -d sat %s :smartctl d2 -d usbjmicron %s :smartctl parity -d areca,1/1 /dev/sg0 :smartctl 2-parity -d areca,2/1 /dev/sg0 @@ -1407,7 +1411,7 @@ Configuration :exclude Thumbs.db :exclude \$RECYCLE.BIN :exclude \System Volume Information - :smartctl d1 -d sat %s + :smartctl d1 [info: -H -i -c -A] -d sat %s :smartctl d2 -d usbjmicron %s :smartctl parity -d areca,1/1 /dev/arcmsr0 :smartctl 2-parity -d areca,2/1 /dev/arcmsr0 diff --git a/doc/snapraid-pl.txt b/doc/snapraid-pl.txt index 4e7a18c3..59f56d64 100644 --- a/doc/snapraid-pl.txt +++ b/doc/snapraid-pl.txt @@ -1450,6 +1450,9 @@ W określonych OPCJACH ciąg `%s` jest zastępowany nazwą urządzenia. W przypadku kontrolerów RAID, urządzenie jest prawdopodobnie stałe i może nie być konieczne użycie `%s`. +Możesz również określić niestandardowy ciąg opcji informacyjnych za pomocą +znacznika `[info: ...]`, aby zastąpić domyślną opcję `-a`. + Zapoznaj się z dokumentacją smartmontools, aby uzyskać możliwe opcje: https://www.smartmontools.org/wiki/Supported_RAID-Controllers @@ -1457,6 +1460,7 @@ Zapoznaj się z dokumentacją smartmontools, aby uzyskać możliwe opcje: Na przykład: + smartctl d1 [info: -H -i -c -A] -d sat %s smartctl parity -d sat %s 7.18 smartignore DISK/PARITY ATTR [ATTR...] @@ -1493,7 +1497,7 @@ Przykład typowej konfiguracji dla systemu Unix: data d3 /mnt/disk3/ exclude /lost+found/ exclude /tmp/ - smartctl d1 -d sat %s + smartctl d1 [info: -H -i -c -A] -d sat %s smartctl d2 -d usbjmicron %s smartctl parity -d areca,1/1 /dev/sg0 smartctl 2-parity -d areca,2/1 /dev/sg0 @@ -1509,7 +1513,7 @@ Przykład typowej konfiguracji dla systemu Windows: exclude Thumbs.db exclude \$RECYCLE.BIN exclude \System Volume Information - smartctl d1 -d sat %s + smartctl d1 [info: -H -i -c -A] -d sat %s smartctl d2 -d usbjmicron %s smartctl parity -d areca,1/1 /dev/arcmsr0 smartctl 2-parity -d areca,2/1 /dev/arcmsr0 diff --git a/doc/snapraid-pt.1 b/doc/snapraid-pt.1 index 0a877236..04f905e4 100644 --- a/doc/snapraid-pt.1 +++ b/doc/snapraid-pt.1 @@ -1676,6 +1676,9 @@ Nas OPTIONS especificadas, a string \`%s\` é substituída pelo nome do dispositivo. Para controladores RAID, o dispositivo é provavelmente fixo, e você pode não precisar usar \`%s\`. .PP +Você também pode especificar uma string personalizada de opções de informação +usando a tag \`[info: ...]\` para substituir a opção padrão \`\-a\`. +.PP Consulte a documentação do smartmontools para possíveis opções: .PP .RS 4 @@ -1691,6 +1694,10 @@ https://www.smartmontools.org/wiki/Supported_USB\-Devices Por exemplo: .PP .RS 4 +smartctl d1 [info: \-H \-i \-c \-A] \-d sat %s +.PD 0 +.PP +.PD smartctl parity \-d sat %s .PD 0 .PD @@ -1757,7 +1764,7 @@ exclude /tmp/ .PD 0 .PP .PD -smartctl d1 \-d sat %s +smartctl d1 [info: \-H \-i \-c \-A] \-d sat %s .PD 0 .PP .PD @@ -1813,7 +1820,7 @@ exclude \\System Volume Information .PD 0 .PP .PD -smartctl d1 \-d sat %s +smartctl d1 [info: \-H \-i \-c \-A] \-d sat %s .PD 0 .PP .PD diff --git a/doc/snapraid-pt.d b/doc/snapraid-pt.d index 7f5e0a98..cca11dbc 100644 --- a/doc/snapraid-pt.d +++ b/doc/snapraid-pt.d @@ -1390,6 +1390,9 @@ Configuração nome do dispositivo. Para controladores RAID, o dispositivo é provavelmente fixo, e você pode não precisar usar `%s`. + Você também pode especificar uma string personalizada de opções de informação + usando a tag `[info: ...]` para substituir a opção padrão `-a`. + Consulte a documentação do smartmontools para possíveis opções: :https://www.smartmontools.org/wiki/Supported_RAID-Controllers @@ -1397,6 +1400,7 @@ Configuração Por exemplo: + :smartctl d1 [info: -H -i -c -A] -d sat %s :smartctl parity -d sat %s smartignore DISK/PARITY ATTR [ATTR...] @@ -1429,7 +1433,7 @@ Configuração :data d3 /mnt/disk3/ :exclude /lost+found/ :exclude /tmp/ - :smartctl d1 -d sat %s + :smartctl d1 [info: -H -i -c -A] -d sat %s :smartctl d2 -d usbjmicron %s :smartctl parity -d areca,1/1 /dev/sg0 :smartctl 2-parity -d areca,2/1 /dev/sg0 @@ -1445,7 +1449,7 @@ Configuração :exclude Thumbs.db :exclude \$RECYCLE.BIN :exclude \System Volume Information - :smartctl d1 -d sat %s + :smartctl d1 [info: -H -i -c -A] -d sat %s :smartctl d2 -d usbjmicron %s :smartctl parity -d areca,1/1 /dev/arcmsr0 :smartctl 2-parity -d areca,2/1 /dev/arcmsr0 diff --git a/doc/snapraid-pt.txt b/doc/snapraid-pt.txt index 1dc6efa5..fb3cff46 100644 --- a/doc/snapraid-pt.txt +++ b/doc/snapraid-pt.txt @@ -1488,6 +1488,9 @@ Nas OPTIONS especificadas, a string `%s` é substituída pelo nome do dispositivo. Para controladores RAID, o dispositivo é provavelmente fixo, e você pode não precisar usar `%s`. +Você também pode especificar uma string personalizada de opções de informação +usando a tag `[info: ...]` para substituir a opção padrão `-a`. + Consulte a documentação do smartmontools para possíveis opções: https://www.smartmontools.org/wiki/Supported_RAID-Controllers @@ -1495,6 +1498,7 @@ Consulte a documentação do smartmontools para possíveis opções: Por exemplo: + smartctl d1 [info: -H -i -c -A] -d sat %s smartctl parity -d sat %s 7.18 smartignore DISK/PARITY ATTR [ATTR...] @@ -1531,7 +1535,7 @@ Um exemplo de uma configuração típica para Unix é: data d3 /mnt/disk3/ exclude /lost+found/ exclude /tmp/ - smartctl d1 -d sat %s + smartctl d1 [info: -H -i -c -A] -d sat %s smartctl d2 -d usbjmicron %s smartctl parity -d areca,1/1 /dev/sg0 smartctl 2-parity -d areca,2/1 /dev/sg0 @@ -1547,7 +1551,7 @@ Um exemplo de uma configuração típica para Windows é: exclude Thumbs.db exclude \$RECYCLE.BIN exclude \System Volume Information - smartctl d1 -d sat %s + smartctl d1 [info: -H -i -c -A] -d sat %s smartctl d2 -d usbjmicron %s smartctl parity -d areca,1/1 /dev/arcmsr0 smartctl 2-parity -d areca,2/1 /dev/arcmsr0 diff --git a/doc/snapraid-ro.1 b/doc/snapraid-ro.1 index 3145a3fa..6622c3e0 100644 --- a/doc/snapraid-ro.1 +++ b/doc/snapraid-ro.1 @@ -1641,6 +1641,9 @@ PARITY este unul dintre numele de paritate: \`parity\`, \`2\-parity\`, \`3\-pari numele dispozitivului. Pentru controlerele RAID, dispozitivul este probabil fix și este posibil să nu fie nevoie să utilizați \`%s\`. .PP +De asemenea, puteți specifica un șir de opțiuni de informații personalizate +utilizând eticheta \`[info: ...]\` pentru a înlocui opțiunea implicită \`\-a\`. +.PP Consultați documentația smartmontools pentru opțiuni posibile: .PP .RS 4 @@ -1656,6 +1659,10 @@ https://www.smartmontools.org/wiki/Supported_USB\-Devices De exemplu: .PP .RS 4 +smartctl d1 [info: \-H \-i \-c \-A] \-d sat %s +.PD 0 +.PP +.PD smartctl parity \-d sat %s .PD 0 .PD @@ -1722,7 +1729,7 @@ exclude /tmp/ .PD 0 .PP .PD -smartctl d1 \-d sat %s +smartctl d1 [info: \-H \-i \-c \-A] \-d sat %s .PD 0 .PP .PD @@ -1778,7 +1785,7 @@ exclude \\System Volume Information .PD 0 .PP .PD -smartctl d1 \-d sat %s +smartctl d1 [info: \-H \-i \-c \-A] \-d sat %s .PD 0 .PP .PD diff --git a/doc/snapraid-ro.d b/doc/snapraid-ro.d index 7ed90352..49a9f38b 100644 --- a/doc/snapraid-ro.d +++ b/doc/snapraid-ro.d @@ -1355,6 +1355,9 @@ Configurare numele dispozitivului. Pentru controlerele RAID, dispozitivul este probabil fix și este posibil să nu fie nevoie să utilizați `%s`. + De asemenea, puteți specifica un șir de opțiuni de informații personalizate + utilizând eticheta `[info: ...]` pentru a înlocui opțiunea implicită `-a`. + Consultați documentația smartmontools pentru opțiuni posibile: :https://www.smartmontools.org/wiki/Supported_RAID-Controllers @@ -1362,6 +1365,7 @@ Configurare De exemplu: + :smartctl d1 [info: -H -i -c -A] -d sat %s :smartctl parity -d sat %s smartignore DISK/PARITY ATTR [ATTR...] @@ -1394,7 +1398,7 @@ Configurare :data d3 /mnt/disk3/ :exclude /lost+found/ :exclude /tmp/ - :smartctl d1 -d sat %s + :smartctl d1 [info: -H -i -c -A] -d sat %s :smartctl d2 -d usbjmicron %s :smartctl parity -d areca,1/1 /dev/sg0 :smartctl 2-parity -d areca,2/1 /dev/sg0 @@ -1410,7 +1414,7 @@ Configurare :exclude Thumbs.db :exclude \$RECYCLE.BIN :exclude \System Volume Information - :smartctl d1 -d sat %s + :smartctl d1 [info: -H -i -c -A] -d sat %s :smartctl d2 -d usbjmicron %s :smartctl parity -d areca,1/1 /dev/arcmsr0 :smartctl 2-parity -d areca,2/1 /dev/arcmsr0 diff --git a/doc/snapraid-ro.txt b/doc/snapraid-ro.txt index 8d514d79..b65968bc 100644 --- a/doc/snapraid-ro.txt +++ b/doc/snapraid-ro.txt @@ -1453,6 +1453,9 @@ PARITY este unul dintre numele de paritate: `parity`, `2-parity`, `3-parity`, numele dispozitivului. Pentru controlerele RAID, dispozitivul este probabil fix și este posibil să nu fie nevoie să utilizați `%s`. +De asemenea, puteți specifica un șir de opțiuni de informații personalizate +utilizând eticheta `[info: ...]` pentru a înlocui opțiunea implicită `-a`. + Consultați documentația smartmontools pentru opțiuni posibile: https://www.smartmontools.org/wiki/Supported_RAID-Controllers @@ -1460,6 +1463,7 @@ Consultați documentația smartmontools pentru opțiuni posibile: De exemplu: + smartctl d1 [info: -H -i -c -A] -d sat %s smartctl parity -d sat %s 7.18 smartignore DISK/PARITY ATTR [ATTR...] @@ -1496,7 +1500,7 @@ Un exemplu de configurare tipică pentru Unix este: data d3 /mnt/disk3/ exclude /lost+found/ exclude /tmp/ - smartctl d1 -d sat %s + smartctl d1 [info: -H -i -c -A] -d sat %s smartctl d2 -d usbjmicron %s smartctl parity -d areca,1/1 /dev/sg0 smartctl 2-parity -d areca,2/1 /dev/sg0 @@ -1512,7 +1516,7 @@ Un exemplu de configurare tipică pentru Windows este: exclude Thumbs.db exclude \$RECYCLE.BIN exclude \System Volume Information - smartctl d1 -d sat %s + smartctl d1 [info: -H -i -c -A] -d sat %s smartctl d2 -d usbjmicron %s smartctl parity -d areca,1/1 /dev/arcmsr0 smartctl 2-parity -d areca,2/1 /dev/arcmsr0 diff --git a/doc/snapraid-ru.1 b/doc/snapraid-ru.1 index 9165cbb8..bf17dd51 100644 --- a/doc/snapraid-ru.1 +++ b/doc/snapraid-ru.1 @@ -1643,6 +1643,9 @@ PARITY — это одно из имен четности: \`parity\`, \`2\-pari именем устройства. Для контроллеров RAID устройство, вероятно, фиксировано, и вам может не потребоваться использовать \`%s\`. .PP +Вы также можете указать пользовательскую строку параметров информации с помощью +тега \`[info: ...]\`, чтобы заменить параметр по умолчанию \`\-a\`. +.PP Возможные опции см. в документации smartmontools: .PP .RS 4 @@ -1658,6 +1661,10 @@ https://www.smartmontools.org/wiki/Supported_USB\-Devices Например: .PP .RS 4 +smartctl d1 [info: \-H \-i \-c \-A] \-d sat %s +.PD 0 +.PP +.PD smartctl parity \-d sat %s .PD 0 .PD @@ -1724,7 +1731,7 @@ exclude /tmp/ .PD 0 .PP .PD -smartctl d1 \-d sat %s +smartctl d1 [info: \-H \-i \-c \-A] \-d sat %s .PD 0 .PP .PD @@ -1780,7 +1787,7 @@ exclude \\System Volume Information .PD 0 .PP .PD -smartctl d1 \-d sat %s +smartctl d1 [info: \-H \-i \-c \-A] \-d sat %s .PD 0 .PP .PD diff --git a/doc/snapraid-ru.d b/doc/snapraid-ru.d index 08fd21b4..9a9d6285 100644 --- a/doc/snapraid-ru.d +++ b/doc/snapraid-ru.d @@ -1357,6 +1357,9 @@ Configuration именем устройства. Для контроллеров RAID устройство, вероятно, фиксировано, и вам может не потребоваться использовать `%s`. + Вы также можете указать пользовательскую строку параметров информации с помощью + тега `[info: ...]`, чтобы заменить параметр по умолчанию `-a`. + Возможные опции см. в документации smartmontools: :https://www.smartmontools.org/wiki/Supported_RAID-Controllers @@ -1364,6 +1367,7 @@ Configuration Например: + :smartctl d1 [info: -H -i -c -A] -d sat %s :smartctl parity -d sat %s smartignore DISK/PARITY ATTR [ATTR...] @@ -1396,7 +1400,7 @@ Configuration :data d3 /mnt/disk3/ :exclude /lost+found/ :exclude /tmp/ - :smartctl d1 -d sat %s + :smartctl d1 [info: -H -i -c -A] -d sat %s :smartctl d2 -d usbjmicron %s :smartctl parity -d areca,1/1 /dev/sg0 :smartctl 2-parity -d areca,2/1 /dev/sg0 @@ -1412,7 +1416,7 @@ Configuration :exclude Thumbs.db :exclude \$RECYCLE.BIN :exclude \System Volume Information - :smartctl d1 -d sat %s + :smartctl d1 [info: -H -i -c -A] -d sat %s :smartctl d2 -d usbjmicron %s :smartctl parity -d areca,1/1 /dev/arcmsr0 :smartctl 2-parity -d areca,2/1 /dev/arcmsr0 diff --git a/doc/snapraid-ru.txt b/doc/snapraid-ru.txt index 7277d9fd..9cbcb8e2 100644 --- a/doc/snapraid-ru.txt +++ b/doc/snapraid-ru.txt @@ -1455,6 +1455,9 @@ PARITY — это одно из имен четности: `parity`, `2-parity`, именем устройства. Для контроллеров RAID устройство, вероятно, фиксировано, и вам может не потребоваться использовать `%s`. +Вы также можете указать пользовательскую строку параметров информации с помощью +тега `[info: ...]`, чтобы заменить параметр по умолчанию `-a`. + Возможные опции см. в документации smartmontools: https://www.smartmontools.org/wiki/Supported_RAID-Controllers @@ -1462,6 +1465,7 @@ PARITY — это одно из имен четности: `parity`, `2-parity`, Например: + smartctl d1 [info: -H -i -c -A] -d sat %s smartctl parity -d sat %s 7.18 smartignore DISK/PARITY ATTR [ATTR...] @@ -1498,7 +1502,7 @@ PARITY — это одно из имен четности: `parity`, `2-parity`, data d3 /mnt/disk3/ exclude /lost+found/ exclude /tmp/ - smartctl d1 -d sat %s + smartctl d1 [info: -H -i -c -A] -d sat %s smartctl d2 -d usbjmicron %s smartctl parity -d areca,1/1 /dev/sg0 smartctl 2-parity -d areca,2/1 /dev/sg0 @@ -1514,7 +1518,7 @@ PARITY — это одно из имен четности: `parity`, `2-parity`, exclude Thumbs.db exclude \$RECYCLE.BIN exclude \System Volume Information - smartctl d1 -d sat %s + smartctl d1 [info: -H -i -c -A] -d sat %s smartctl d2 -d usbjmicron %s smartctl parity -d areca,1/1 /dev/arcmsr0 smartctl 2-parity -d areca,2/1 /dev/arcmsr0 diff --git a/doc/snapraid-sv.1 b/doc/snapraid-sv.1 index 5b8cabc7..fc0379dd 100644 --- a/doc/snapraid-sv.1 +++ b/doc/snapraid-sv.1 @@ -1642,6 +1642,9 @@ I de specificerade ALTERNATIVEN ersätts strängen \`%s\` med enhetens namn. För RAID\-kontroller är enheten sannolikt fixerad, och du kanske inte behöver använda \`%s\`. .PP +Du kan också specificera en anpassad sträng för informationsalternativ med +hjälp av taggen \`[info: ...]\` för att ersätta standardalternativet \`\-a\`. +.PP Se smartmontools dokumentation för möjliga alternativ: .PP .RS 4 @@ -1657,6 +1660,10 @@ https://www.smartmontools.org/wiki/Supported_USB\-Devices Till exempel: .PP .RS 4 +smartctl d1 [info: \-H \-i \-c \-A] \-d sat %s +.PD 0 +.PP +.PD smartctl parity \-d sat %s .PD 0 .PD @@ -1723,7 +1730,7 @@ exclude /tmp/ .PD 0 .PP .PD -smartctl d1 \-d sat %s +smartctl d1 [info: \-H \-i \-c \-A] \-d sat %s .PD 0 .PP .PD @@ -1779,7 +1786,7 @@ exclude \\System Volume Information .PD 0 .PP .PD -smartctl d1 \-d sat %s +smartctl d1 [info: \-H \-i \-c \-A] \-d sat %s .PD 0 .PP .PD diff --git a/doc/snapraid-sv.d b/doc/snapraid-sv.d index 676d0da6..484bba18 100644 --- a/doc/snapraid-sv.d +++ b/doc/snapraid-sv.d @@ -1356,6 +1356,9 @@ Konfiguration enhetens namn. För RAID-kontroller är enheten sannolikt fixerad, och du kanske inte behöver använda `%s`. + Du kan också specificera en anpassad sträng för informationsalternativ med + hjälp av taggen `[info: ...]` för att ersätta standardalternativet `-a`. + Se smartmontools dokumentation för möjliga alternativ: :https://www.smartmontools.org/wiki/Supported_RAID-Controllers @@ -1363,6 +1366,7 @@ Konfiguration Till exempel: + :smartctl d1 [info: -H -i -c -A] -d sat %s :smartctl parity -d sat %s smartignore DISK/PARITY ATTR [ATTR...] @@ -1395,7 +1399,7 @@ Konfiguration :data d3 /mnt/disk3/ :exclude /lost+found/ :exclude /tmp/ - :smartctl d1 -d sat %s + :smartctl d1 [info: -H -i -c -A] -d sat %s :smartctl d2 -d usbjmicron %s :smartctl parity -d areca,1/1 /dev/sg0 :smartctl 2-parity -d areca,2/1 /dev/sg0 @@ -1411,7 +1415,7 @@ Konfiguration :exclude Thumbs.db :exclude \$RECYCLE.BIN :exclude \System Volume Information - :smartctl d1 -d sat %s + :smartctl d1 [info: -H -i -c -A] -d sat %s :smartctl d2 -d usbjmicron %s :smartctl parity -d areca,1/1 /dev/arcmsr0 :smartctl 2-parity -d areca,2/1 /dev/arcmsr0 diff --git a/doc/snapraid-sv.txt b/doc/snapraid-sv.txt index c9e06ef8..7254a7df 100644 --- a/doc/snapraid-sv.txt +++ b/doc/snapraid-sv.txt @@ -1454,6 +1454,9 @@ I de specificerade ALTERNATIVEN ersätts strängen `%s` med enhetens namn. För RAID-kontroller är enheten sannolikt fixerad, och du kanske inte behöver använda `%s`. +Du kan också specificera en anpassad sträng för informationsalternativ med +hjälp av taggen `[info: ...]` för att ersätta standardalternativet `-a`. + Se smartmontools dokumentation för möjliga alternativ: https://www.smartmontools.org/wiki/Supported_RAID-Controllers @@ -1461,6 +1464,7 @@ Se smartmontools dokumentation för möjliga alternativ: Till exempel: + smartctl d1 [info: -H -i -c -A] -d sat %s smartctl parity -d sat %s 7.18 smartignore DISK/PARITY ATTR [ATTR...] @@ -1497,7 +1501,7 @@ Ett exempel på en typisk konfiguration för Unix är: data d3 /mnt/disk3/ exclude /lost+found/ exclude /tmp/ - smartctl d1 -d sat %s + smartctl d1 [info: -H -i -c -A] -d sat %s smartctl d2 -d usbjmicron %s smartctl parity -d areca,1/1 /dev/sg0 smartctl 2-parity -d areca,2/1 /dev/sg0 @@ -1513,7 +1517,7 @@ Ett exempel på en typisk konfiguration för Windows är: exclude Thumbs.db exclude \$RECYCLE.BIN exclude \System Volume Information - smartctl d1 -d sat %s + smartctl d1 [info: -H -i -c -A] -d sat %s smartctl d2 -d usbjmicron %s smartctl parity -d areca,1/1 /dev/arcmsr0 smartctl 2-parity -d areca,2/1 /dev/arcmsr0 diff --git a/doc/snapraid-uk.1 b/doc/snapraid-uk.1 index c9f073b1..d848f9ea 100644 --- a/doc/snapraid-uk.1 +++ b/doc/snapraid-uk.1 @@ -1811,6 +1811,9 @@ PARITY — це одне з імен парності: \`parity\`, ймовірно фіксований, і вам може не знадобитися використовувати \`%s\`. .PP +Ви також можете вказати користувацький рядок параметрів інформації за допомогою +тега \`[info: ...]\`, щоб замінити параметр за замовчуванням \`\-a\`. +.PP Зверніться до документації smartmontools для можливих опцій: .PP @@ -1827,6 +1830,10 @@ https://www.smartmontools.org/wiki/Supported_USB\-Devices Наприклад: .PP .RS 4 +smartctl d1 [info: \-H \-i \-c \-A] \-d sat %s +.PD 0 +.PP +.PD smartctl parity \-d sat %s .PD 0 .PD @@ -1896,7 +1903,7 @@ exclude /tmp/ .PD 0 .PP .PD -smartctl d1 \-d sat %s +smartctl d1 [info: \-H \-i \-c \-A] \-d sat %s .PD 0 .PP .PD @@ -1952,7 +1959,7 @@ exclude \\System Volume Information .PD 0 .PP .PD -smartctl d1 \-d sat %s +smartctl d1 [info: \-H \-i \-c \-A] \-d sat %s .PD 0 .PP .PD diff --git a/doc/snapraid-uk.d b/doc/snapraid-uk.d index 01030749..cc9b0eb4 100644 --- a/doc/snapraid-uk.d +++ b/doc/snapraid-uk.d @@ -1514,6 +1514,9 @@ Name{number} ймовірно фіксований, і вам може не знадобитися використовувати `%s`. + Ви також можете вказати користувацький рядок параметрів інформації за допомогою + тега `[info: ...]`, щоб замінити параметр за замовчуванням `-a`. + Зверніться до документації smartmontools для можливих опцій: @@ -1522,6 +1525,7 @@ Name{number} Наприклад: + :smartctl d1 [info: -H -i -c -A] -d sat %s :smartctl parity -d sat %s smartignore DISK/PARITY ATTR [ATTR...] @@ -1557,7 +1561,7 @@ Name{number} :data d3 /mnt/disk3/ :exclude /lost+found/ :exclude /tmp/ - :smartctl d1 -d sat %s + :smartctl d1 [info: -H -i -c -A] -d sat %s :smartctl d2 -d usbjmicron %s :smartctl parity -d areca,1/1 /dev/sg0 :smartctl 2-parity -d areca,2/1 /dev/sg0 @@ -1573,7 +1577,7 @@ Name{number} :exclude Thumbs.db :exclude \$RECYCLE.BIN :exclude \System Volume Information - :smartctl d1 -d sat %s + :smartctl d1 [info: -H -i -c -A] -d sat %s :smartctl d2 -d usbjmicron %s :smartctl parity -d areca,1/1 /dev/arcmsr0 :smartctl 2-parity -d areca,2/1 /dev/arcmsr0 diff --git a/doc/snapraid-uk.txt b/doc/snapraid-uk.txt index 82b990d9..ad8b0a59 100644 --- a/doc/snapraid-uk.txt +++ b/doc/snapraid-uk.txt @@ -1612,6 +1612,9 @@ PARITY — це одне з імен парності: `parity`, ймовірно фіксований, і вам може не знадобитися використовувати `%s`. +Ви також можете вказати користувацький рядок параметрів інформації за допомогою +тега `[info: ...]`, щоб замінити параметр за замовчуванням `-a`. + Зверніться до документації smartmontools для можливих опцій: @@ -1620,6 +1623,7 @@ PARITY — це одне з імен парності: `parity`, Наприклад: + smartctl d1 [info: -H -i -c -A] -d sat %s smartctl parity -d sat %s 7.18 smartignore DISK/PARITY ATTR [ATTR...] @@ -1659,7 +1663,7 @@ PARITY — це одне з імен парності: `parity`, data d3 /mnt/disk3/ exclude /lost+found/ exclude /tmp/ - smartctl d1 -d sat %s + smartctl d1 [info: -H -i -c -A] -d sat %s smartctl d2 -d usbjmicron %s smartctl parity -d areca,1/1 /dev/sg0 smartctl 2-parity -d areca,2/1 /dev/sg0 @@ -1675,7 +1679,7 @@ PARITY — це одне з імен парності: `parity`, exclude Thumbs.db exclude \$RECYCLE.BIN exclude \System Volume Information - smartctl d1 -d sat %s + smartctl d1 [info: -H -i -c -A] -d sat %s smartctl d2 -d usbjmicron %s smartctl parity -d areca,1/1 /dev/arcmsr0 smartctl 2-parity -d areca,2/1 /dev/arcmsr0 diff --git a/doc/snapraid-zh.1 b/doc/snapraid-zh.1 index 54c74d9a..78c843d5 100644 --- a/doc/snapraid-zh.1 +++ b/doc/snapraid-zh.1 @@ -1476,6 +1476,8 @@ PARITY 是奇偶校验名称之一:\`parity\`、\`2\-parity\`、\`3\-parity\` 对于 RAID 控制器,设备可能是固定的, 您可能不需要使用 \`%s\`。 .PP +您还可以使用 \`[info: ...]\` 标记指定自定义信息选项字符串,以替换默认的 \`\-a\` 选项。 +.PP 请参阅 smartmontools 文档以了解可能的选项: .PP .RS 4 @@ -1491,6 +1493,10 @@ https://www.smartmontools.org/wiki/Supported_USB\-Devices 例如: .PP .RS 4 +smartctl d1 [info: \-H \-i \-c \-A] \-d sat %s +.PD 0 +.PP +.PD smartctl parity \-d sat %s .PD 0 .PD @@ -1555,7 +1561,7 @@ exclude /tmp/ .PD 0 .PP .PD -smartctl d1 \-d sat %s +smartctl d1 [info: \-H \-i \-c \-A] \-d sat %s .PD 0 .PP .PD @@ -1611,7 +1617,7 @@ exclude \\System Volume Information .PD 0 .PP .PD -smartctl d1 \-d sat %s +smartctl d1 [info: \-H \-i \-c \-A] \-d sat %s .PD 0 .PP .PD diff --git a/doc/snapraid-zh.d b/doc/snapraid-zh.d index 8ccd3100..819036a7 100644 --- a/doc/snapraid-zh.d +++ b/doc/snapraid-zh.d @@ -1190,6 +1190,8 @@ Configuration 对于 RAID 控制器,设备可能是固定的, 您可能不需要使用 `%s`。 + 您还可以使用 `[info: ...]` 标记指定自定义信息选项字符串,以替换默认的 `-a` 选项。 + 请参阅 smartmontools 文档以了解可能的选项: :https://www.smartmontools.org/wiki/Supported_RAID-Controllers @@ -1197,6 +1199,7 @@ Configuration 例如: + :smartctl d1 [info: -H -i -c -A] -d sat %s :smartctl parity -d sat %s smartignore DISK/PARITY ATTR [ATTR...] @@ -1227,7 +1230,7 @@ Configuration :data d3 /mnt/disk3/ :exclude /lost+found/ :exclude /tmp/ - :smartctl d1 -d sat %s + :smartctl d1 [info: -H -i -c -A] -d sat %s :smartctl d2 -d usbjmicron %s :smartctl parity -d areca,1/1 /dev/sg0 :smartctl 2-parity -d areca,2/1 /dev/sg0 @@ -1243,7 +1246,7 @@ Configuration :exclude Thumbs.db :exclude \$RECYCLE.BIN :exclude \System Volume Information - :smartctl d1 -d sat %s + :smartctl d1 [info: -H -i -c -A] -d sat %s :smartctl d2 -d usbjmicron %s :smartctl parity -d areca,1/1 /dev/arcmsr0 :smartctl 2-parity -d areca,2/1 /dev/arcmsr0 diff --git a/doc/snapraid-zh.txt b/doc/snapraid-zh.txt index 654d202d..b60ba881 100644 --- a/doc/snapraid-zh.txt +++ b/doc/snapraid-zh.txt @@ -1288,6 +1288,8 @@ PARITY 是奇偶校验名称之一:`parity`、`2-parity`、`3-parity`、 对于 RAID 控制器,设备可能是固定的, 您可能不需要使用 `%s`。 +您还可以使用 `[info: ...]` 标记指定自定义信息选项字符串,以替换默认的 `-a` 选项。 + 请参阅 smartmontools 文档以了解可能的选项: https://www.smartmontools.org/wiki/Supported_RAID-Controllers @@ -1295,6 +1297,7 @@ PARITY 是奇偶校验名称之一:`parity`、`2-parity`、`3-parity`、 例如: + smartctl d1 [info: -H -i -c -A] -d sat %s smartctl parity -d sat %s 7.18 smartignore DISK/PARITY ATTR [ATTR...] @@ -1329,7 +1332,7 @@ Unix 的典型配置示例如下: data d3 /mnt/disk3/ exclude /lost+found/ exclude /tmp/ - smartctl d1 -d sat %s + smartctl d1 [info: -H -i -c -A] -d sat %s smartctl d2 -d usbjmicron %s smartctl parity -d areca,1/1 /dev/sg0 smartctl 2-parity -d areca,2/1 /dev/sg0 @@ -1345,7 +1348,7 @@ Windows 的典型配置示例如下: exclude Thumbs.db exclude \$RECYCLE.BIN exclude \System Volume Information - smartctl d1 -d sat %s + smartctl d1 [info: -H -i -c -A] -d sat %s smartctl d2 -d usbjmicron %s smartctl parity -d areca,1/1 /dev/arcmsr0 smartctl 2-parity -d areca,2/1 /dev/arcmsr0 diff --git a/doc/snapraid.1 b/doc/snapraid.1 index 41d4ede7..de7958f6 100644 --- a/doc/snapraid.1 +++ b/doc/snapraid.1 @@ -1643,6 +1643,9 @@ In the specified OPTIONS, the \`%s\` string is replaced by the device name. For RAID controllers, the device is likely fixed, and you may not need to use \`%s\`. .PP +You can also specify a custom info options string using the +\`[info: ...]\` tag to override the default \`\-a\` option. +.PP Refer to the smartmontools documentation for possible options: .PP .RS 4 @@ -1658,6 +1661,10 @@ https://www.smartmontools.org/wiki/Supported_USB\-Devices For example: .PP .RS 4 +smartctl d1 [info: \-H \-i \-c \-A] \-d sat %s +.PD 0 +.PP +.PD smartctl parity \-d sat %s .PD 0 .PD @@ -1724,7 +1731,7 @@ exclude /tmp/ .PD 0 .PP .PD -smartctl d1 \-d sat %s +smartctl d1 [info: \-H \-i \-c \-A] \-d sat %s .PD 0 .PP .PD @@ -1780,7 +1787,7 @@ exclude \\System Volume Information .PD 0 .PP .PD -smartctl d1 \-d sat %s +smartctl d1 [info: \-H \-i \-c \-A] \-d sat %s .PD 0 .PP .PD diff --git a/doc/snapraid.d b/doc/snapraid.d index 8e962458..b93df235 100644 --- a/doc/snapraid.d +++ b/doc/snapraid.d @@ -1357,6 +1357,9 @@ Configuration device name. For RAID controllers, the device is likely fixed, and you may not need to use `%s`. + You can also specify a custom info options string using the + `[info: ...]` tag to override the default `-a` option. + Refer to the smartmontools documentation for possible options: :https://www.smartmontools.org/wiki/Supported_RAID-Controllers @@ -1364,6 +1367,7 @@ Configuration For example: + :smartctl d1 [info: -H -i -c -A] -d sat %s :smartctl parity -d sat %s smartignore DISK/PARITY ATTR [ATTR...] @@ -1396,7 +1400,7 @@ Configuration :data d3 /mnt/disk3/ :exclude /lost+found/ :exclude /tmp/ - :smartctl d1 -d sat %s + :smartctl d1 [info: -H -i -c -A] -d sat %s :smartctl d2 -d usbjmicron %s :smartctl parity -d areca,1/1 /dev/sg0 :smartctl 2-parity -d areca,2/1 /dev/sg0 @@ -1412,7 +1416,7 @@ Configuration :exclude Thumbs.db :exclude \$RECYCLE.BIN :exclude \System Volume Information - :smartctl d1 -d sat %s + :smartctl d1 [info: -H -i -c -A] -d sat %s :smartctl d2 -d usbjmicron %s :smartctl parity -d areca,1/1 /dev/arcmsr0 :smartctl 2-parity -d areca,2/1 /dev/arcmsr0 diff --git a/doc/snapraid.txt b/doc/snapraid.txt index 49f59a96..b236676b 100644 --- a/doc/snapraid.txt +++ b/doc/snapraid.txt @@ -1455,6 +1455,9 @@ In the specified OPTIONS, the `%s` string is replaced by the device name. For RAID controllers, the device is likely fixed, and you may not need to use `%s`. +You can also specify a custom info options string using the +`[info: ...]` tag to override the default `-a` option. + Refer to the smartmontools documentation for possible options: https://www.smartmontools.org/wiki/Supported_RAID-Controllers @@ -1462,6 +1465,7 @@ Refer to the smartmontools documentation for possible options: For example: + smartctl d1 [info: -H -i -c -A] -d sat %s smartctl parity -d sat %s 7.18 smartignore DISK/PARITY ATTR [ATTR...] @@ -1498,7 +1502,7 @@ An example of a typical configuration for Unix is: data d3 /mnt/disk3/ exclude /lost+found/ exclude /tmp/ - smartctl d1 -d sat %s + smartctl d1 [info: -H -i -c -A] -d sat %s smartctl d2 -d usbjmicron %s smartctl parity -d areca,1/1 /dev/sg0 smartctl 2-parity -d areca,2/1 /dev/sg0 @@ -1514,7 +1518,7 @@ An example of a typical configuration for Windows is: exclude Thumbs.db exclude \$RECYCLE.BIN exclude \System Volume Information - smartctl d1 -d sat %s + smartctl d1 [info: -H -i -c -A] -d sat %s smartctl d2 -d usbjmicron %s smartctl parity -d areca,1/1 /dev/arcmsr0 smartctl 2-parity -d areca,2/1 /dev/arcmsr0 diff --git a/snapraid.conf.example b/snapraid.conf.example index 91db9a68..911cad42 100644 --- a/snapraid.conf.example +++ b/snapraid.conf.example @@ -129,11 +129,16 @@ exclude /lost+found/ # Defines a custom smartctl command to obtain the SMART attributes # for each disk. This may be required for RAID controllers and for # some USB disk that cannot be autodetected. +# # In the specified options, the "%s" string is replaced by the device name. +# # Refers at the smartmontools documentation about the possible options: # RAID -> https://www.smartmontools.org/wiki/Supported_RAID-Controllers # USB -> https://www.smartmontools.org/wiki/Supported_USB-Devices -#smartctl d1 -d sat %s +# +# In the custom command, you can also specify a custom info options string +# using the '[info: ...]' tag to override the default '-a' option. +#smartctl d1 [info: -H -i -c -A] -d sat %s #smartctl d2 -d usbjmicron %s #smartctl parity -d areca,1/1 /dev/sg0 #smartctl 2-parity -d areca,2/1 /dev/sg0 diff --git a/snapraid.conf.example.windows b/snapraid.conf.example.windows index 2bc7179d..c46cd856 100644 --- a/snapraid.conf.example.windows +++ b/snapraid.conf.example.windows @@ -144,11 +144,16 @@ exclude \Windows\ # Defines a custom smartctl command to obtain the SMART attributes # for each disk. This may be required for RAID controllers and for # some USB disk that cannot be autodetected. +# # In the specified options, the "%s" string is replaced by the device name. +# # Refers at the smartmontools documentation about the possible options: # RAID -> https://www.smartmontools.org/wiki/Supported_RAID-Controllers # USB -> https://www.smartmontools.org/wiki/Supported_USB-Devices -#smartctl d1 -d sat %s +# +# In the custom command, you can also specify a custom info options string +# using the '[info: ...]' tag to override the default '-a' option. +#smartctl d1 [info: -H -i -c -A] -d sat %s #smartctl d2 -d usbjmicron %s #smartctl parity -d areca,1/1 /dev/arcmsr0 #smartctl 2-parity -d areca,2/1 /dev/arcmsr0