[smartmontools-support] smartd settings per disk type
Orsiris de Jong
ozy at netpower.fr
Sat Jun 29 23:46:03 CEST 2019
Hello,
Is there a way to set different settings in smartd.conf, depending on the disk type (nvme, ssd, spinning) ?
Best regards.
Orsiris de Jong
http://www.netpower.fr
Tél: 06 75 40 48 41
-----Message initial-----
> De: Orsiris de Jong <ozy at netpower.fr>
> Envoyé: mercredi 5 juin 2019 17:10
> À: smartmontools-support at listi.jpberlin.de
> Sujet: smartd settings per disk type
>
> Hello,
>
> I'm currently (re)developping a Python GUI for smartd, that works with Windows
> and Linux.
>
> I would like to be able to create different smartd configuration profiles
> depending on the disk type (ie: spinning disks, ssd, nvme & removable is the
> most common usecase).
> So far, from what I've understood from smartd.conf(5) manual page, I can use
> the follwing to specify different settings depending on disks:
>
> DEVICESCAN -d nvme [various settings for nvme disks]
> DEVICESCAN -d removable [various settins for usb / other removable disks]
>
> My problem is to identify spinning disks and SSD disks, which simply look
> like SCSI devices on most modern computers.
>
> I can workaround by making something like the following pseudo code:
> for device in smartctl --scan:
> disk_type = grep "Rotation rate" device
>
> The upper would give me a list of /dev/xxx with it's type, which I then can
> feed smartd.conf with instead of DEVICESCAN lines like:
>
> # spinning disks
> /dev/sda [various settings for spinning disks]
> /dev/sdb [various settings for spinning disks]
> # ssd disks
> /dev/sdd [various settings for ssd disks]
> # nvme disks
> DEVICESCAN -d nvme [various settings for nvme disks]
>
> This solution isn't the best because it's not dynamic, ie once the smartd.conf
> file is written, it will stay that way until the pseudo code above is executed
> again, evzn if the disk labels change.
>
> Is there any better solution I may use ?
>
> Also, I've read that the -d removable option is experimental. With which version
> was it implemented so I don't break things with elder smartmontools releases
> ?
>
> My goal is to achieve the underlying code to this GUI part, in the least "ugly"
> way:
> https://github.com/deajan/smartd_pyngui/issues/2
>
> Best regards.
>
> Orsiris de Jong
> http://www.netpower.fr
> Tél: 06 75 40 48 41
More information about the Smartmontools-support
mailing list