2022/08/13

外付けUSB SATAディスクのS.M.A.R.T.監視

smartdの起動が失敗している

# /etc/init.d/smartd start
 * Starting smartd ...
 * start-stop-daemon: failed to start `/usr/sbin/smartd'
 * Failed to start smartd
 * ERROR: smartd failed to start

これだけでは何が原因かわからず放置していたが、調査することに。

syslogを確認すると、「Unable to register device /dev/sdb (no Directive -d removable). Exiting.」という記述があり、リムーバブルメディアなので、ストレージの種別を特定できないため、起動を諦めているようだ。

Aug 13 17:33:40 edo smartd[30246]: smartd 7.3 2022-02-28 r5338 [x86_64-linux-5.15.59-gentoo-x86_64] (local build)
Aug 13 17:33:40 edo smartd[30246]: Copyright (C) 2002-22, Bruce Allen, Christian Franke, www.smartmontools.org
Aug 13 17:33:40 edo smartd[30246]: Opened configuration file /etc/smartd.conf
Aug 13 17:33:40 edo smartd[30246]: Configuration file /etc/smartd.conf parsed.
Aug 13 17:33:40 edo smartd[30246]: Device: /dev/sda, type changed from 'scsi' to 'sat'
Aug 13 17:33:40 edo smartd[30246]: Device: /dev/sda [SAT], opened
Aug 13 17:33:40 edo smartd[30246]: Device: /dev/sda [SAT], Crucial_CT500MX200SSD1, S/N:15170F6041F6, WWN:5-00a075-10f6041f6, FW:MU01, 500 GB
Aug 13 17:33:40 edo smartd[30246]: Device: /dev/sda [SAT], found in smartd database 7.3/5387: Crucial/Micron Client SSDs
Aug 13 17:33:40 edo smartd[30246]: Device: /dev/sda [SAT], enabled SMART Attribute Autosave.
Aug 13 17:33:40 edo smartd[30246]: Device: /dev/sda [SAT], enabled SMART Automatic Offline Testing.
Aug 13 17:33:40 edo smartd[30246]: Device: /dev/sda [SAT], is SMART capable. Adding to "monitor" list.
Aug 13 17:33:40 edo smartd[30246]: Device: /dev/sdb, unable to autodetect device type
Aug 13 17:33:40 edo smartd[30246]: Unable to register device /dev/sdb (no Directive -d removable). Exiting.
Aug 13 17:33:40 edo /etc/init.d/smartd[30245]: start-stop-daemon: failed to start `/usr/sbin/smartd'
Aug 13 17:33:40 edo /etc/init.d/smartd[30224]: ERROR: smartd failed to start

ここまで分かれば、対応は早い。ネットで調べると、デバイスの種類の設定は-dで行い、SATAの場合は「-d sat」とのこと。

/etc/smartd.confの設定に-d satを追加

# grep -v "\(^ *#\)\|\(^ *$\)" /etc/smartd.conf
/dev/sda -a -o on -S on -s (S/../.././01|L/../../6/01) -m root
/dev/sdb -a -o on -S on -s (S/../.././01|L/../../6/01) -m root -d sat

起動できるようになった

Aug 13 17:55:02 edo smartd[18627]: smartd 7.3 2022-02-28 r5338 [x86_64-linux-5.15.59-gentoo-x86_64] (local build)
Aug 13 17:55:02 edo smartd[18627]: Copyright (C) 2002-22, Bruce Allen, Christian Franke, www.smartmontools.org
Aug 13 17:55:02 edo smartd[18627]: Opened configuration file /etc/smartd.conf
Aug 13 17:55:02 edo smartd[18627]: Configuration file /etc/smartd.conf parsed.
Aug 13 17:55:02 edo smartd[18627]: Device: /dev/sda, type changed from 'scsi' to 'sat'
Aug 13 17:55:02 edo smartd[18627]: Device: /dev/sda [SAT], opened
Aug 13 17:55:02 edo smartd[18627]: Device: /dev/sda [SAT], Crucial_CT500MX200SSD1, S/N:15170F6041F6, WWN:5-00a075-10f6041f6, FW:MU01, 500 GB
Aug 13 17:55:02 edo smartd[18627]: Device: /dev/sda [SAT], found in smartd database 7.3/5387: Crucial/Micron Client SSDs
Aug 13 17:55:02 edo smartd[18627]: Device: /dev/sda [SAT], enabled SMART Attribute Autosave.
Aug 13 17:55:02 edo smartd[18627]: Device: /dev/sda [SAT], enabled SMART Automatic Offline Testing.
Aug 13 17:55:02 edo smartd[18627]: Device: /dev/sda [SAT], is SMART capable. Adding to "monitor" list.
Aug 13 17:55:02 edo smartd[18627]: Device: /dev/sdb [SAT], opened
Aug 13 17:55:02 edo smartd[18627]: Device: /dev/sdb [SAT], Samsung SSD 850 EVO 500GB, S/N:S21GNXAG512333Z, WWN:5-002538-d400eb467, FW:EMT01B6Q, 500 GB
Aug 13 17:55:02 edo smartd[18627]: Device: /dev/sdb [SAT], found in smartd database 7.3/5387: Samsung based SSDs
Aug 13 17:55:02 edo smartd[18627]: Device: /dev/sdb [SAT], enabled SMART Attribute Autosave.
Aug 13 17:55:02 edo smartd[18627]: Device: /dev/sdb [SAT], can't monitor Current_Pending_Sector count - no Attribute 197
Aug 13 17:55:02 edo smartd[18627]: Device: /dev/sdb [SAT], can't monitor Offline_Uncorrectable count - no Attribute 198
Aug 13 17:55:02 edo smartd[18627]: Device: /dev/sdb [SAT], enabled SMART Automatic Offline Testing.
Aug 13 17:55:02 edo smartd[18627]: Device: /dev/sdb [SAT], is SMART capable. Adding to "monitor" list.
Aug 13 17:55:02 edo smartd[18627]: Monitoring 2 ATA/SATA, 0 SCSI/SAS and 0 NVMe devices
Aug 13 17:55:02 edo smartd[18629]: smartd has fork()ed into background mode. New PID=18629.
Aug 13 17:55:02 edo smartd[18629]: file /run/smartd.pid written containing PID 18629

0 件のコメント:

コメントを投稿