[Bug 2029502] [NEW] udev ata_id environment keys not imported for sata hdd
Mauricio
2029502 at bugs.launchpad.net
Thu Aug 3 14:59:00 UTC 2023
Public bug reported:
Hello,
While debugging why `pm-utils` hdparam udev rules were not picked up by my
SATA HDD, I found that it depends on the presence of the `ID_ATA_FEATURE_SET_APM`
env key to set the drive advanced power management. This key is returned by
`ata_id` correctly but, among other values, they are never imported as
environment keys by udev.
They seem to be imported in `/lib/udev/rules.d/60-persistent-
storage.rules`
# ATA
KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", SUBSYSTEMS=="scsi", \
ATTRS{vendor}=="ATA", IMPORT{program}="ata_id --export $devnode"
But this rule is not applied since `sg3_utils` already set an
`ID_SERIAL` in
https://github.com/hreinecke/sg3_utils/blob/master/scripts/55-scsi-
sg3_id.rules#L100C61-L100C61
I workaround this by introducing a new rule that imports the `ata_id` output on that
device, without the ID_SERIAL condition, which makes hdparm to detect APM correctly.
So, regardless of how hdparm is detecting APM capabilities, I'm not sure the current
behavior is expected or not. I would expect that the `ata_id` env properties are
always imported if the device has `ID_ATA=1`
# lsb_release -rd
Description: Ubuntu 22.04.2 LTS
Release: 22.04
# apt-cache policy systemd
systemd:
Installed: 249.11-0ubuntu3.9
** Affects: systemd (Ubuntu)
Importance: Undecided
Status: New
** Tags: udev
** Description changed:
Hello,
While debugging why `pm-utils` hdparam udev rules were not picked up by my
SATA HDD, I found that it depends on the presence of the `ID_ATA_FEATURE_SET_APM`
env key to set the drive advanced power management. This key is returned by
`ata_id` correctly but, among other values, they are never imported as
environment keys by udev.
They seem to be imported in `/lib/udev/rules.d/60-persistent-
storage.rules`
# ATA
KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", SUBSYSTEMS=="scsi", \
- ATTRS{vendor}=="ATA", IMPORT{program}="ata_id --export $devnode"
+ ATTRS{vendor}=="ATA", IMPORT{program}="ata_id --export $devnode"
But this rule is not applied since `sg3_utils` already set an
- `ID_SERIAL` in [1].
+ `ID_SERIAL` in
+ https://github.com/hreinecke/sg3_utils/blob/master/scripts/55-scsi-
+ sg3_id.rules#L100C61-L100C61
I workaround this by introducing a new rule that imports the `ata_id` output on that
device, without the ID_SERIAL condition, which makes hdparm to detect APM correctly.
So, regardless of how hdparm is detecting APM capabilities, I'm not sure the current
behavior is expected or not. I would expect that the `ata_id` env properties are
always imported if the device has `ID_ATA=1`
# lsb_release -rd
Description: Ubuntu 22.04.2 LTS
Release: 22.04
# apt-cache policy systemd
systemd:
- Installed: 249.11-0ubuntu3.9
+ Installed: 249.11-0ubuntu3.9
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to systemd in Ubuntu.
https://bugs.launchpad.net/bugs/2029502
Title:
udev ata_id environment keys not imported for sata hdd
Status in systemd package in Ubuntu:
New
Bug description:
Hello,
While debugging why `pm-utils` hdparam udev rules were not picked up by my
SATA HDD, I found that it depends on the presence of the `ID_ATA_FEATURE_SET_APM`
env key to set the drive advanced power management. This key is returned by
`ata_id` correctly but, among other values, they are never imported as
environment keys by udev.
They seem to be imported in `/lib/udev/rules.d/60-persistent-
storage.rules`
# ATA
KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", SUBSYSTEMS=="scsi", \
ATTRS{vendor}=="ATA", IMPORT{program}="ata_id --export $devnode"
But this rule is not applied since `sg3_utils` already set an
`ID_SERIAL` in
https://github.com/hreinecke/sg3_utils/blob/master/scripts/55-scsi-
sg3_id.rules#L100C61-L100C61
I workaround this by introducing a new rule that imports the `ata_id` output on that
device, without the ID_SERIAL condition, which makes hdparm to detect APM correctly.
So, regardless of how hdparm is detecting APM capabilities, I'm not sure the current
behavior is expected or not. I would expect that the `ata_id` env properties are
always imported if the device has `ID_ATA=1`
# lsb_release -rd
Description: Ubuntu 22.04.2 LTS
Release: 22.04
# apt-cache policy systemd
systemd:
Installed: 249.11-0ubuntu3.9
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/2029502/+subscriptions
More information about the foundations-bugs
mailing list