UDEV Rule to stop testing smart_status of WD ATA drive
by bamunds from LinuxQuestions.org on (#4WEPP)
The syslog is filling every 10 minutes with an error: Code:udisksd[3327]: Error performing housekeeping for drive /org/freedesktop/UDisks2/drives/WDC_WD2000BB_00GUA0_WD_WCAL81332011: Error updating SMART data: sk_disk_smart_status: Input/output error (udisks-error-quark, 0)Research found this is a bug in udiskd which is polling the Western Digital ATA drive. This appears to be a long known bug from
https://bugs.freedesktop.org/show_bug.cgi?id=53475
The solution in Comment #2 is to create a udev rule that tells udev to not poll the drive and leave it to smartd instead.
I've tried to create a rule, my first attempt at this for a disk. It is:
Code:# cat /etc/udev/rules.d/20-WDDrive.rules KERNEL=="sdb", SUBSYSTEM=="block", ATTR{idVendor}=="ATA", ATTR{idModel}=="WDC WD2000BB-00G", ENV{ID_ATA_FEATURE_SET_SMART}="0", ENV{ID_ATA_FEATURE_SET_SMART_ENABLED}="0"
The required information to set the rule is pulled from udevadm info.
Code:# udevadm info --query=all --path=/sys/block/sdb | more
P: /devices/pci0000:00/0000:00:1f.1/ata5/host4/target4:0:1/4:0:1:0/block/sdb
N: sdb
S: disk/by-id/ata-WDC_WD2000BB-00GUA0_WD-WCAL81332011
E: DEVLINKS=/dev/disk/by-id/ata-WDC_WD2000BB-00GUA0_WD-WCAL81332011
E: DEVNAME=/dev/sdb
E: DEVPATH=/devices/pci0000:00/0000:00:1f.1/ata5/host4/target4:0:1/4:0:1:0/block
/sdb
E: DEVTYPE=disk
E: ID_ATA=1
E: ID_ATA_DOWNLOAD_MICROCODE=1
E: ID_ATA_FEATURE_SET_AAM=1
E: ID_ATA_FEATURE_SET_AAM_CURRENT_VALUE=128
E: ID_ATA_FEATURE_SET_AAM_ENABLED=1
E: ID_ATA_FEATURE_SET_AAM_VENDOR_RECOMMENDED_VALUE=128
E: ID_ATA_FEATURE_SET_HPA=1
E: ID_ATA_FEATURE_SET_HPA_ENABLED=1
E: ID_ATA_FEATURE_SET_PM=1
E: ID_ATA_FEATURE_SET_PM_ENABLED=1
E: ID_ATA_FEATURE_SET_SECURITY=1
E: ID_ATA_FEATURE_SET_SECURITY_ENABLED=0
E: ID_ATA_FEATURE_SET_SECURITY_ERASE_UNIT_MIN=0
E: ID_ATA_FEATURE_SET_SECURITY_FROZEN=1
E: ID_ATA_FEATURE_SET_SMART=1
E: ID_ATA_FEATURE_SET_SMART_ENABLED=1and Code:# udevadm info --query=all --name=/dev/sdb --attribute-walk
Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.
looking at device '/devices/pci0000:00/0000:00:1f.1/ata5/host4/target4:0:1/4:0:1:0/block/sdb':
KERNEL=="sdb"
SUBSYSTEM=="block"
DRIVER==""
ATTR{ext_range}=="256"
ATTR{range}=="16"
ATTR{alignment_offset}=="0"
ATTR{ro}=="0"
ATTR{stat}==" 786 0 49835 8595 16 1 136 4 0 5736 8597"
ATTR{events_poll_msecs}=="-1"
ATTR{events_async}==""
ATTR{size}=="390721968"
ATTR{discard_alignment}=="0"
ATTR{capability}=="50"
ATTR{removable}=="0"
ATTR{events}==""
ATTR{inflight}==" 0 0"
looking at parent device '/devices/pci0000:00/0000:00:1f.1/ata5/host4/target4:0:1/4:0:1:0':
KERNELS=="4:0:1:0"
SUBSYSTEMS=="scsi"
DRIVERS=="sd"
ATTRS{evt_media_change}=="0"
ATTRS{evt_mode_parameter_change_reported}=="0"
ATTRS{evt_inquiry_change_reported}=="0"
ATTRS{vendor}=="ATA "
ATTRS{evt_capacity_change_reported}=="0"
ATTRS{model}=="WDC WD2000BB-00G"
ATTRS{evt_lun_change_reported}=="0"
ATTRS{iorequest_cnt}=="0x7cc"
ATTRS{wwid}=="t10.ATA WDC WD2000BB-00GUA0 WD-WCAL81332011\0\0\0\0\0"
ATTRS{dh_state}=="detached"
ATTRS{iocounterbits}=="32"
ATTRS{type}=="0"
ATTRS{queue_type}=="simple"
ATTRS{device_busy}=="0"
ATTRS{vpd_pg80}==""
ATTRS{device_blocked}=="0"
ATTRS{scsi_level}=="6"
ATTRS{inquiry}==""
ATTRS{eh_timeout}=="10"
ATTRS{state}=="running"
ATTRS{iodone_cnt}=="0x7cc"
ATTRS{queue_depth}=="1"
ATTRS{ioerr_cnt}=="0x27d"
ATTRS{vpd_pg83}==""
ATTRS{timeout}=="30"
ATTRS{evt_soft_threshold_reached}=="0"
ATTRS{rev}=="2D08"
ATTRS{ncq_prio_enable}=="0"
looking at parent device '/devices/pci0000:00/0000:00:1f.1/ata5/host4/target4:0:1':
KERNELS=="target4:0:1"
SUBSYSTEMS=="scsi"
DRIVERS==""
looking at parent device '/devices/pci0000:00/0000:00:1f.1/ata5/host4':
KERNELS=="host4"
SUBSYSTEMS=="scsi"
DRIVERS==""
looking at parent device '/devices/pci0000:00/0000:00:1f.1/ata5':
KERNELS=="ata5"
SUBSYSTEMS==""
DRIVERS==""
looking at parent device '/devices/pci0000:00/0000:00:1f.1':
KERNELS=="0000:00:1f.1"
SUBSYSTEMS=="pci"
DRIVERS=="ata_piix"
ATTRS{broken_parity_status}=="0"
ATTRS{subsystem_device}=="0x6051"
ATTRS{dma_mask_bits}=="32"
ATTRS{vendor}=="0x8086"
ATTRS{resource1}=="P"
ATTRS{local_cpus}=="3"
ATTRS{class}=="0x01018a"
ATTRS{numa_node}=="-1"
ATTRS{msi_bus}=="1"
ATTRS{device}=="0x27df"
ATTRS{local_cpulist}=="0-1"
ATTRS{driver_override}=="(null)"
ATTRS{d3cold_allowed}=="0"
ATTRS{irq}=="18"
ATTRS{revision}=="0x01"
ATTRS{consistent_dma_mask_bits}=="32"
ATTRS{enable}=="1"
ATTRS{subsystem_vendor}=="0x107b"
looking at parent device '/devices/pci0000:00':
KERNELS=="pci0000:00"
SUBSYSTEMS==""
DRIVERS==""The rule is suppose to simply tell udev not to see the smart feature set according to the original bug fix posting. Unforunately the rule isn't working, because I did a reload of udev rules and still I'm getting the error generated every 10 minutes. Can someone suggest some re-writes?
Oh I'm reading the man for udev and also online manuals to try and understand
Cheers


https://bugs.freedesktop.org/show_bug.cgi?id=53475
The solution in Comment #2 is to create a udev rule that tells udev to not poll the drive and leave it to smartd instead.
I've tried to create a rule, my first attempt at this for a disk. It is:
Code:# cat /etc/udev/rules.d/20-WDDrive.rules KERNEL=="sdb", SUBSYSTEM=="block", ATTR{idVendor}=="ATA", ATTR{idModel}=="WDC WD2000BB-00G", ENV{ID_ATA_FEATURE_SET_SMART}="0", ENV{ID_ATA_FEATURE_SET_SMART_ENABLED}="0"
The required information to set the rule is pulled from udevadm info.
Code:# udevadm info --query=all --path=/sys/block/sdb | more
P: /devices/pci0000:00/0000:00:1f.1/ata5/host4/target4:0:1/4:0:1:0/block/sdb
N: sdb
S: disk/by-id/ata-WDC_WD2000BB-00GUA0_WD-WCAL81332011
E: DEVLINKS=/dev/disk/by-id/ata-WDC_WD2000BB-00GUA0_WD-WCAL81332011
E: DEVNAME=/dev/sdb
E: DEVPATH=/devices/pci0000:00/0000:00:1f.1/ata5/host4/target4:0:1/4:0:1:0/block
/sdb
E: DEVTYPE=disk
E: ID_ATA=1
E: ID_ATA_DOWNLOAD_MICROCODE=1
E: ID_ATA_FEATURE_SET_AAM=1
E: ID_ATA_FEATURE_SET_AAM_CURRENT_VALUE=128
E: ID_ATA_FEATURE_SET_AAM_ENABLED=1
E: ID_ATA_FEATURE_SET_AAM_VENDOR_RECOMMENDED_VALUE=128
E: ID_ATA_FEATURE_SET_HPA=1
E: ID_ATA_FEATURE_SET_HPA_ENABLED=1
E: ID_ATA_FEATURE_SET_PM=1
E: ID_ATA_FEATURE_SET_PM_ENABLED=1
E: ID_ATA_FEATURE_SET_SECURITY=1
E: ID_ATA_FEATURE_SET_SECURITY_ENABLED=0
E: ID_ATA_FEATURE_SET_SECURITY_ERASE_UNIT_MIN=0
E: ID_ATA_FEATURE_SET_SECURITY_FROZEN=1
E: ID_ATA_FEATURE_SET_SMART=1
E: ID_ATA_FEATURE_SET_SMART_ENABLED=1and Code:# udevadm info --query=all --name=/dev/sdb --attribute-walk
Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.
looking at device '/devices/pci0000:00/0000:00:1f.1/ata5/host4/target4:0:1/4:0:1:0/block/sdb':
KERNEL=="sdb"
SUBSYSTEM=="block"
DRIVER==""
ATTR{ext_range}=="256"
ATTR{range}=="16"
ATTR{alignment_offset}=="0"
ATTR{ro}=="0"
ATTR{stat}==" 786 0 49835 8595 16 1 136 4 0 5736 8597"
ATTR{events_poll_msecs}=="-1"
ATTR{events_async}==""
ATTR{size}=="390721968"
ATTR{discard_alignment}=="0"
ATTR{capability}=="50"
ATTR{removable}=="0"
ATTR{events}==""
ATTR{inflight}==" 0 0"
looking at parent device '/devices/pci0000:00/0000:00:1f.1/ata5/host4/target4:0:1/4:0:1:0':
KERNELS=="4:0:1:0"
SUBSYSTEMS=="scsi"
DRIVERS=="sd"
ATTRS{evt_media_change}=="0"
ATTRS{evt_mode_parameter_change_reported}=="0"
ATTRS{evt_inquiry_change_reported}=="0"
ATTRS{vendor}=="ATA "
ATTRS{evt_capacity_change_reported}=="0"
ATTRS{model}=="WDC WD2000BB-00G"
ATTRS{evt_lun_change_reported}=="0"
ATTRS{iorequest_cnt}=="0x7cc"
ATTRS{wwid}=="t10.ATA WDC WD2000BB-00GUA0 WD-WCAL81332011\0\0\0\0\0"
ATTRS{dh_state}=="detached"
ATTRS{iocounterbits}=="32"
ATTRS{type}=="0"
ATTRS{queue_type}=="simple"
ATTRS{device_busy}=="0"
ATTRS{vpd_pg80}==""
ATTRS{device_blocked}=="0"
ATTRS{scsi_level}=="6"
ATTRS{inquiry}==""
ATTRS{eh_timeout}=="10"
ATTRS{state}=="running"
ATTRS{iodone_cnt}=="0x7cc"
ATTRS{queue_depth}=="1"
ATTRS{ioerr_cnt}=="0x27d"
ATTRS{vpd_pg83}==""
ATTRS{timeout}=="30"
ATTRS{evt_soft_threshold_reached}=="0"
ATTRS{rev}=="2D08"
ATTRS{ncq_prio_enable}=="0"
looking at parent device '/devices/pci0000:00/0000:00:1f.1/ata5/host4/target4:0:1':
KERNELS=="target4:0:1"
SUBSYSTEMS=="scsi"
DRIVERS==""
looking at parent device '/devices/pci0000:00/0000:00:1f.1/ata5/host4':
KERNELS=="host4"
SUBSYSTEMS=="scsi"
DRIVERS==""
looking at parent device '/devices/pci0000:00/0000:00:1f.1/ata5':
KERNELS=="ata5"
SUBSYSTEMS==""
DRIVERS==""
looking at parent device '/devices/pci0000:00/0000:00:1f.1':
KERNELS=="0000:00:1f.1"
SUBSYSTEMS=="pci"
DRIVERS=="ata_piix"
ATTRS{broken_parity_status}=="0"
ATTRS{subsystem_device}=="0x6051"
ATTRS{dma_mask_bits}=="32"
ATTRS{vendor}=="0x8086"
ATTRS{resource1}=="P"
ATTRS{local_cpus}=="3"
ATTRS{class}=="0x01018a"
ATTRS{numa_node}=="-1"
ATTRS{msi_bus}=="1"
ATTRS{device}=="0x27df"
ATTRS{local_cpulist}=="0-1"
ATTRS{driver_override}=="(null)"
ATTRS{d3cold_allowed}=="0"
ATTRS{irq}=="18"
ATTRS{revision}=="0x01"
ATTRS{consistent_dma_mask_bits}=="32"
ATTRS{enable}=="1"
ATTRS{subsystem_vendor}=="0x107b"
looking at parent device '/devices/pci0000:00':
KERNELS=="pci0000:00"
SUBSYSTEMS==""
DRIVERS==""The rule is suppose to simply tell udev not to see the smart feature set according to the original bug fix posting. Unforunately the rule isn't working, because I did a reload of udev rules and still I'm getting the error generated every 10 minutes. Can someone suggest some re-writes?
Oh I'm reading the man for udev and also online manuals to try and understand
Cheers