tuned icon indicating copy to clipboard operation
tuned copied to clipboard

Removable devices check in disk plugin excludes aacraid (Adaptek RAID) arrays

Open me-vlad opened this issue 5 years ago • 3 comments

Hello,

Disk plugin checks for supported device types and excludes removable devices from supported list. But some hardware raid controllers (f.e. Adaptek) has removable flag hardcoded in their kernel module source code: https://github.com/torvalds/linux/blob/master/drivers/scsi/aacraid/aachba.c In this case hw raid arrays ignored by tuned profile.

Removable devices check was added in commit 148203c

me-vlad avatar Dec 16 '19 15:12 me-vlad

After little investigation I discovered that not just adaptek (aacraid) controllers sets removable flag but ips and dpt_i2o can do the same. Example from debian bug list: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=404927

We need to workaround this issue by excluding these controllers in disk plugin or add a option to the profile configuration file (something like ignore_removable_flag=sda).

me-vlad avatar Feb 04 '20 17:02 me-vlad

Hi,

yes, I think a per-instance option ignore_removable_flag=True|False would make sense. You could use it as follows to ignore the flag in sda but not in sdb.

[disk_sda]
type=disk
devices=sda
ignore_removable_flag=True

[disk_sdb]
type=disk
devices=sdb
ignore_removable_flag=False

The default woud be ignore_removable_flag=False to preserve the current behaviour.

olysonek avatar Feb 10 '20 13:02 olysonek

I think there might be some security considerations to this feature. I think there is an expectation in Tuned that the data that Tuned reads from the system is trusted, controlled by the administrator. By allowing Tuned to handle removable devices, such as flash drives, I think we might be breaking this expectation - the HW metadata is under the control of the person who plugs in the HW.

Right now, I can't think of a case where this would be a problem, however I think it deserves some thought.

olysonek avatar Feb 20 '20 10:02 olysonek