1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-26 03:22:00 +03:00
Commit Graph

4 Commits

Author SHA1 Message Date
Joerg Steffens
8d0edd1172 udev-rules: make tape devices also accessable by ENV{ID_SCSI_SERIAL}
Tape and tape changer devices from Amazon Webservice Storage Gateway VTLs
and maybe other iSCSI VTLs all have the same ENV{ID_SERIAL}.
The results is, that only the last device is available in
/dev/tape/by-id/, as the former devices have been overwritten.
However, the devices can be distinguished by ENV{ID_SCSI_SERIAL}.

ENV{ID_SCSI_SERIAL} is not set on directly connected SCSI devices.

This rule additional creates links based on the ENV{ID_SCSI_SERIAL}, if
it is set.

In my case, it creates (ID_SCSI_SERIAL)
/dev/tape/by-id/scsi-AMZN_SGW-6BF81D02_MC_00001
/dev/tape/by-id/scsi-AMZN_SGW-6BF81D02_TD_00001
/dev/tape/by-id/scsi-AMZN_SGW-6BF81D02_TD_00002
...

instead of only (ID_SERIAL)
scsi-2414d5a4e5f5347572d364246
2017-12-27 11:37:18 +01:00
Joerg Steffens
7f8ddf96a2 udev-rules: make tape-changers also apprear in /dev/tape/by-path/
It is important to be able to access tape changer ("Medium Changers") by
persistant name.
While tape devices can be accessed via /dev/tape/by-id/ and
/dev/tape/by-path/, tape-changers could only be accessed by
/dev/tape/by-id/.
However, in some cases, especially when accessing Amazon Webservice
Storage Gateway VTLs (or accessing iSCSI VTLs in general?) this does not
work, as all tape devices and the tape changer have the same ENV{ID_SERIAL}.
The results is, that only the last device is available in
/dev/tape/by-id/, as the former devices have been overwritten.

As this behavior is hard to change without breaking consistentcy,
this additional device in /dev/tape/by-path/ can be used to access the medium changes.
The tape devices can also be accessed by this path.

The content of the directory will now look like:

  # SCSI tape device, rewind (unchanged)
  /dev/tape/by-path/$env{ID_PATH} -> ../../st*

  # SCSI tape device, no-rewind (unchanged)
  /dev/tape/by-path/$env{ID_PATH}-nst -> ../../nst*

  # SCSI tape changer device (newly added)
  /dev/tape/by-path/$env{ID_PATH}-changer -> ../../sg*

Tape devices and tape changer have different ID_PATHs.
SCSI tape changer get the suffix "-changer"
to make them better distinguishable from tape devices.
2017-11-21 12:21:49 +01:00
Rusty Bird
542127ea96 rules: UDEV_DISABLE_PERSISTENT_STORAGE_RULES_FLAG property (#3714)
Sometimes, the persistent storage rules should be skipped for a subset
of devices. For example, the Qubes operating system prevents dom0 from
parsing untrusted block device content (such as filesystem metadata) by
shipping a custom 60-persistent-storage.rules, patched to bail out early
if the device name matches a hardcoded pattern.

As a less brittle and more flexible alternative, this commit adds a line
to the two relevant .rules files which makes them test the value of the
UDEV_DISABLE_PERSISTENT_STORAGE_RULES_FLAG device property, modeled
after the various DM_UDEV_DISABLE_*_RULES_FLAG properties.
2016-07-15 18:47:42 +02:00
Kay Sievers
3e2147858f move imported udev into place 2012-04-04 05:05:07 +02:00