Talk:S.M.A.R.T.

From ArchWiki

Updating the database

I'm running smartctl 7.1, and it looks like the database is out of date. I had to run sudo /usr/sbin/update-smart-drivedb to get my >1 year old drive to appear as if supported.

We don't mention anywhere how to update the drivedb, nor ways to do it automatically.Beepboo (talk) 11:25, 7 December 2020 (UTC)Reply[reply]

Updates of the drive database are covered by upstream releases and Arch package updates. If you notice it is outdated, you might consider submitting a bug report or request for new release. — Lahwaacz (talk) 09:04, 3 September 2023 (UTC)Reply[reply]
The drive database gets updated more frequently than smartmontools has releases. IMO, running update-smart-drivedb could be added to a tip in case smartctl says the drive in not in the database. The only issue I see is that most of the smartctl commands in the article don't contain the full output (-x). -- nl6720 (talk) 11:27, 3 September 2023 (UTC)Reply[reply]
Ideally upstream should have some instructions regarding this. But update-smart-drivedb(8) still mentions RELEASE_7_3_DRIVEDB as the default branch (IIUC) even though the current version is 7.4... — Lahwaacz (talk) 12:26, 3 September 2023 (UTC)Reply[reply]

smartdnotify script broken for usernames longer than 8 chars

The sample script /usr/share/smartmontools/smartd_warning.d/smartdnotify is broken when the username is longer than 8 chars. This happens because the w command defaults to 8 chars for the username column. According to the w man page the length of the column can be changed via the PROCPS_USERLEN environment variable. I suggesto to add something like export PROCPS_USERLEN=32 (32 being the maximum allowed value) at the beginning of the script. Mbeniamino (talk) 08:00, 29 December 2023 (UTC)Reply[reply]

`w -hs` in smartdnotify script does not output display number

w command used by the sample script /usr/share/smartmontools/smartd_warning.d/smartdnotify does not output DISPLAY number, at least in my device (e.g. user1               15:30m lightdm --session-child 13 20). This source suggested it can be done using ps e -u username.

 w -hs | awk '{print $1}' | while read USER; do
   USER_ID=$(id -u $USER)
   ps e -u "$USER" | sed -rn 's/.* DISPLAY=(:[0-9]*).*/\1/p' | uniq | while read DISPLAY_ID; do
     sudo -u "$USER" DISPLAY="$DISPLAY_ID" DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/$USER_ID/bus" notify-send "S.M.A.R.T Error ($SMARTD_FAILTYPE)" "$SMARTD_MESSAGE" --icon=dialog-warning -u critical
   done
 done

Curben (talk) 07:04, 18 May 2024 (UTC)Reply[reply]