In Ubuntu 22.04.1 (jammy), package version `9.60+ds-1build3` of `hdparm` is
included. `hdparm.patch` (see #37) is included in this package (see file
`/usr/lib/hdparm/hdparm-functions`, lines 108 to 120). But this patch can't fix
the issue:
1. Line 78:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
local WANTED_DISK="$1"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sets `WANTED_DISK` as configured in `/etc/hdparm.conf`, i.e.
`/dev/disk/by-id/ata-…`.
Resolves symbolic link. `DISC` is now `/dev/sd…` for example.
3. Lines 228 to 232:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if [ -n "$OPTIONS" ] && [ "$DISC" = "$WANTED_DISK" ] then echo $OPTIONS return 0 fi
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If options for the disk have been set in `/etc/hdparm.conf` and `DISC` and
`WANTED_DISK` are equal, the options are printed. But this will not happen
because `DISC` contains resolved symbolic link (`/dev/sd…`) whereas
`WANTED_DISK` contains original value according to `/etc/hdparm.conf`
(`/dev/disk/by-id/ata-…`). Hence, they are not equal!
In Ubuntu 22.04.1 (jammy), package version `9.60+ds-1build3` of `hdparm` is hdparm/ hdparm- functions` , lines 108 to 120). But this patch can't fix
included. `hdparm.patch` (see #37) is included in this package (see file
`/usr/lib/
the issue:
1. Line 78:
~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~
local WANTED_DISK="$1"
~~~
Sets `WANTED_DISK` as configured in `/etc/hdparm.conf`, i.e. disk/by- id/ata- …`.
`/dev/
2. Lines 113 and 114:
~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~
DISC=$ (readlink -m "$KEY")
DISC=$ {DISC%% [[:digit: ]]*} ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~
~~~
Resolves symbolic link. `DISC` is now `/dev/sd…` for example.
3. Lines 228 to 232:
~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~
if [ -n "$OPTIONS" ] && [ "$DISC" = "$WANTED_DISK" ]
then
echo $OPTIONS
return 0
fi ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~
~~~
If options for the disk have been set in `/etc/hdparm.conf` and `DISC` and dev/disk/ by-id/ata- …`). Hence, they are not equal!
`WANTED_DISK` are equal, the options are printed. But this will not happen
because `DISC` contains resolved symbolic link (`/dev/sd…`) whereas
`WANTED_DISK` contains original value according to `/etc/hdparm.conf`
(`/
Therefore, `hdparm.patch` doesn't fix this issue.