|
130 | 130 | *
|
131 | 131 | * ## Device type detection, multipath #
|
132 | 132 | *
|
133 |
| - * There's a big difference in how a drive is accessed. While libatasmart performs |
134 |
| - * essentially no device type detection and sends a I/O request right away |
135 |
| - * (with usual error handling), `smartctl` implements a logic to determine which |
136 |
| - * protocol to use, supporting various passthrough mechanisms and interface bridges. |
137 |
| - * Such detection is not always reliable though, having known issues with `dm-multipath` |
138 |
| - * for example. For this case most plugin functions provide the `'extra'` argument |
139 |
| - * allowing consumers to provide specific arguments such as `'--device=' for device |
140 |
| - * type override`. This is only supported by the smartmontools plugin and ignored |
141 |
| - * by the libatasmart plugin. |
142 |
| - * |
| 133 | + * There's a big difference in how a drive is accessed. While `libatasmart` performs |
| 134 | + * only very basic device type detection based on parent subsystem as retrieved from |
| 135 | + * the udev database, `smartctl` implements logic to determine which protocol to use, |
| 136 | + * supporting variety of passthrough mechanisms and interface bridges. Such detection |
| 137 | + * is not always reliable though, having known issues with `dm-multipath` for example. |
| 138 | + * |
| 139 | + * For this case most plugin functions consume the `extra` argument allowing |
| 140 | + * callers to specify arguments such as `--device=` for device type override. This |
| 141 | + * is only supported by the smartmontools plugin and ignored by the libatasmart |
| 142 | + * plugin. |
| 143 | + * |
| 144 | + * As a well kept secret libatasmart has historically supported device type override |
| 145 | + * via the `ID_ATA_SMART_ACCESS` udev property. There's no public C API for this and |
| 146 | + * libblockdev generally tends to avoid any udev interaction, leaving the burden |
| 147 | + * to callers. |
| 148 | + * |
| 149 | + * Valid values for this property include `auto`, `linux-ide`, `sat16`, `sat12`, |
| 150 | + * `sunplus`, `jmicron`. |
| 151 | + * |
| 152 | + * A common example to override QEMU ATA device type, which often requires legacy |
| 153 | + * IDE protocol: |
| 154 | + * |[ |
| 155 | + * KERNEL=="sd*", ENV{ID_VENDOR}=="ATA", ENV{ID_MODEL}=="QEMU_HARDDISK", ENV{ID_ATA}=="1", ENV{ID_ATA_SMART_ACCESS}="linux-ide" |
| 156 | + * ]| |
143 | 157 | */
|
144 | 158 |
|
145 | 159 | /**
|
|
0 commit comments