デバイスとその親デバイスの属性の表示

/sys内でudevが検出したデバイスおよびすべての親デバイスのすべてのプロパティを表示するには、--attribute-walkオプションを使用します。

  1. デバイスに対してudevadm info --attribute-walkを実行します。

    /dev/sdaおよびすべての親デバイスに関する情報を表示するには、次を実行します:

    udevadm info --attribute-walk --name=/dev/sda
    ...
      looking at device '/devices/pci0000:00/0000:00:04.0/virtio1/host2/target2:0:0/2:0:0:1/block/sda':
        KERNEL=="sda"
        SUBSYSTEM=="block"
        DRIVER==""
        ATTR{alignment_offset}=="0"
        ATTR{capability}=="40"
        ATTR{discard_alignment}=="0"
        ATTR{diskseq}=="1"
        ATTR{events}==""
        ATTR{events_async}==""
        ATTR{events_poll_msecs}=="-1"
        ATTR{ext_range}=="256"
        ATTR{hidden}=="0"
        ATTR{inflight}=="       0        0"
        ATTR{integrity/device_is_integrity_capable}=="0"
        ATTR{integrity/format}=="none"
        ATTR{integrity/protection_interval_bytes}=="0"
        ATTR{integrity/read_verify}=="0"
        ATTR{integrity/tag_size}=="0"
        ATTR{integrity/write_generate}=="0"
    ...
        ATTR{trace/enable}=="0"
        ATTR{trace/end_lba}=="disabled"
        ATTR{trace/pid}=="disabled"
        ATTR{trace/start_lba}=="disabled"
    
      looking at parent device '/devices/pci0000:00/0000:00:04.0/virtio1/host2/target2:0:0/2:0:0:1':
        KERNELS=="2:0:0:1"
        SUBSYSTEMS=="scsi"
        DRIVERS=="sd"
        ATTRS{blacklist}=="TRY_VPD_PAGES"
        ATTRS{delete}=="(not readable)"
        ATTRS{device_blocked}=="0"
        ATTRS{device_busy}=="0"
        ATTRS{dh_state}=="detached"
        ATTRS{eh_timeout}=="10"
        ATTRS{evt_capacity_change_reported}=="0"
        ATTRS{evt_inquiry_change_reported}=="0"
        ATTRS{evt_lun_change_reported}=="0"
        ATTRS{evt_media_change}=="0"
        ATTRS{evt_mode_parameter_change_reported}=="0"
        ATTRS{evt_soft_threshold_reached}=="0"
        ATTRS{inquiry}==""
        ATTRS{iocounterbits}=="32"
        ATTRS{iodone_cnt}=="0x34ad3b"
        ATTRS{ioerr_cnt}=="0x2"
        ATTRS{iorequest_cnt}=="0x34ad3b"
        ATTRS{model}=="BlockVolume     "
    ...
        ATTRS{vpd_pg83}==""
        ATTRS{wwid}=="naa.601666418e094990a94f6e388025315b"
    
      looking at parent device '/devices/pci0000:00/0000:00:04.0/virtio1/host2/target2:0:0':
        KERNELS=="target2:0:0"
        SUBSYSTEMS=="scsi"
        DRIVERS==""
        ATTRS{power/control}=="auto"
        ATTRS{power/runtime_active_time}=="2172559026"
        ATTRS{power/runtime_status}=="active"
        ATTRS{power/runtime_suspended_time}=="0"
    
      looking at parent device '/devices/pci0000:00/0000:00:04.0/virtio1/host2':
        KERNELS=="host2"
        SUBSYSTEMS=="scsi"
        DRIVERS==""
        ATTRS{power/control}=="auto"
        ATTRS{power/runtime_active_time}=="2172559046"
        ATTRS{power/runtime_status}=="active"
        ATTRS{power/runtime_suspended_time}=="0"
    
      looking at parent device '/devices/pci0000:00/0000:00:04.0/virtio1':
        KERNELS=="virtio1"
        SUBSYSTEMS=="virtio"
        DRIVERS=="virtio_scsi"
        ATTRS{device}=="0x0008"
        ATTRS{features}=="0110000000000000000000000000110010000000000000000000000000000000"
        ATTRS{power/control}=="auto"
        ATTRS{power/runtime_active_time}=="0"
        ATTRS{power/runtime_status}=="unsupported"
        ATTRS{power/runtime_suspended_time}=="0"
        ATTRS{status}=="0x0000000f"
        ATTRS{vendor}=="0x108e"
    
      looking at parent device '/devices/pci0000:00/0000:00:04.0':
        KERNELS=="0000:00:04.0"
        SUBSYSTEMS=="pci"
        DRIVERS=="virtio-pci"
        ATTRS{ari_enabled}=="0"
    ...
        ATTRS{revision}=="0x00"
        ATTRS{subsystem_device}=="0x0008"
        ATTRS{subsystem_vendor}=="0x108e"
        ATTRS{vendor}=="0x1af4"
    
      looking at parent device '/devices/pci0000:00':
        KERNELS=="pci0000:00"
        SUBSYSTEMS==""
        DRIVERS==""
        ATTRS{power/control}=="auto"
        ATTRS{power/runtime_active_time}=="0"
        ATTRS{power/runtime_status}=="unsupported"
        ATTRS{power/runtime_suspended_time}=="0"
        ATTRS{waiting_for_supplier}=="0"
    
    

    コマンドはそのデバイス・パスで指定されたデバイスから開始し、親デバイスのチェーンをたどります。コマンドによって検出されたすべてのデバイスについて、udevルールの一致キー形式を使用して、デバイスとその親デバイスに対して可能な属性を表示します。