Skip to content

Instantly share code, notes, and snippets.

@vifino
Last active December 16, 2020 18:31
Show Gist options
  • Save vifino/10b4864f94ec009d275f5c17f950eabe to your computer and use it in GitHub Desktop.
Save vifino/10b4864f94ec009d275f5c17f950eabe to your computer and use it in GitHub Desktop.
FreeBSD devd Configs for Storage Servers

FreeBSD devd configs for Storage Servers

These are configs for FreeBSD's devd to handle certain events better:

ses-fault.conf

This config instructs devd to set the fault notification for a drive whenever the CAM layer reports errors. This only works if the disk is in a disk shelf with SES support (like netapp shelves).

Works in base FreeBSD installs!

TLER.conf

This config attempts to enable TLER support for all drives. Prevents possible deadlocks. If supported by the drives, this enables a timeout of 7 seconds for both read and write failures. I chose 7 seconds because there are a couple drives that only support this setting.

Needs smartmontools to be installed on the system.

# Use SES to mark disk as faulty when CAM errors occur.
# Note that this is errors, not timeouts.
notify 100 {
match "system" "CAM";
match "subsystem" "periph";
match "type" "error";
action "sesutil fault $cdev on";
};
# Try to enable TLER on new disks.
# Uses a setting of 7 seconds for read/write as a safe option.
notify 100 {
match "system" "GEOM";
match "subsystem" "DEV";
match "type" "CREATE";
match "device-name" "a?da[0-9]+";
action "smartctl -l scterc,70,70 /dev/$cdev";
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment