1

To configure S.M.A.R.T. monitoring, it's indicated configuration file /etc/smartd.conf should be customized by identifying each device and the smartctl parameters assigned to it, except:

  • smartctl still uses the slightly unpredictable standard of identifying devices by name [/dev/sda, /dev/sdb, etc.]. Years ago, kernel developers saw the issue with this and switched to better methods of identification, particularly UUID, PARTUUID, and LABEL, but unless I'm missing it, smartctl seems not as "smart" as we would like.
  • When I start a particular system, the drives that house a RAID configuration may be /dev/<sda - sdh>, but if there happens to be a USB drive inserted at boot, those names will switched to /dev/<sdb - sdi> (if there are two USB drives attached, they might shift more, or on the next boot, they might not).

What are others doing to avoid this and ensure the S.M.A.R.T. configuration is appropriate for the mounted devices? (Please don't suggest leaving the USB slot empty - that's not a reliable solution.)

Giacomo1968
  • 58,727
Dennis
  • 225

1 Answers1

1

This forum thread appears to have the same question:

sda, sdb ... is used to indicate the drives, but I learned the allocation with sda, sda ... is not fixed and can change.

[C]an UUIDs be used instead of sdx, and if so, what would a command in smartd.conf look like?

  • These appear to resolve the issue:

    I think your best bet to track the whole disk based on unique media is to use the entries in /dev/disk/by-id since those entries are generated from data on the disk itself.

    • They are simple symlinks, so should be able to use them just about anywhere that the target device name is needed.

    If you do not like the symlinks in /dev/disk/by-id (too long/obscure), you can create your own in /dev with udev rules.

    • See man udev for details; example:
      SUBSYSTEM=="block", ACTION=="add", KERNEL=="sd*", ENV{ID_SERIAL}=="XXXX", SYMLINK+="mydisk%n"
      


Just tested, works!
Screenshot

JW0914
  • 9,096