[OPAL] Indicate HW OPAL in LUKS header
When blkid
tool probes the disk and partitions for UUIDs and other info, it also scans OPAL-locked areas, which results in kernel read errors and (in my case) degraded performance due to downgrade from UDMA/133 to UDMA/33. If I understand it correctly, it is not possible to determine whether the HW OPAL encryption is used just from reading the LUKS header, so the tool cannot easily skip further probes in case the HW OPAL encryption is used.
There is a work-in-progress PR in util-linux
package for blkid
tool with discussion https://github.com/util-linux/util-linux/pull/2889 (and currently working PR from me https://github.com/util-linux/util-linux/pull/2882) about detecting LUKS+OPAL and not actually reading from the locked area.
The current logic, which seems to work for me, if that when LUKS header is found and ioctl
IOC_OPAL_GET_STATUS
indicates a lock, no more probes are done. I think the ideal scenario would be to check for LUKS, if it uses HW OPAL encryption, and only in this case check the ioctl
IOC_OPAL_GET_STATUS
.
Currently the LUKS header does not contain information about HW OPAL usage without reading the JSON block. So my questions - would it make sense to add it and would it be possible to add it, please?