Skip to content

Instantly share code, notes, and snippets.

@donnydavis
Created August 29, 2019 16:05
Show Gist options
  • Save donnydavis/e639bf25d9fe0c0afb58922d296b1c36 to your computer and use it in GitHub Desktop.
Save donnydavis/e639bf25d9fe0c0afb58922d296b1c36 to your computer and use it in GitHub Desktop.
Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.
looking at device '/devices/pci0000:00/0000:00:01.1/ata1/host0/target0:0:0/0:0:0:0/block/sr0':
KERNEL=="sr0"
SUBSYSTEM=="block"
DRIVER==""
ATTR{events_poll_msecs}=="-1"
ATTR{ext_range}=="1"
ATTR{events}=="media_change eject_request"
ATTR{size}=="940"
ATTR{stat}==" 66 0 472 68 0 0 0 0 0 100 8 0 0 0 0"
ATTR{events_async}==""
ATTR{alignment_offset}=="0"
ATTR{discard_alignment}=="0"
ATTR{capability}=="119"
ATTR{range}=="1"
ATTR{hidden}=="0"
ATTR{ro}=="0"
ATTR{removable}=="1"
ATTR{inflight}==" 0 0"
looking at parent device '/devices/pci0000:00/0000:00:01.1/ata1/host0/target0:0:0/0:0:0:0':
KERNELS=="0:0:0:0"
SUBSYSTEMS=="scsi"
DRIVERS=="sr"
ATTRS{model}=="QEMU DVD-ROM "
ATTRS{eh_timeout}=="10"
ATTRS{queue_type}=="none"
ATTRS{evt_capacity_change_reported}=="0"
ATTRS{ncq_prio_enable}=="0"
ATTRS{device_busy}=="0"
ATTRS{device_blocked}=="0"
ATTRS{evt_soft_threshold_reached}=="0"
ATTRS{evt_lun_change_reported}=="0"
ATTRS{blacklist}=="NOREPORTLUN"
ATTRS{timeout}=="30"
ATTRS{iorequest_cnt}=="0x181"
ATTRS{scsi_level}=="6"
ATTRS{type}=="5"
ATTRS{wwid}=="t10.ATA QEMU DVD-ROM QM00001 "
ATTRS{evt_mode_parameter_change_reported}=="0"
ATTRS{evt_inquiry_change_reported}=="0"
ATTRS{iocounterbits}=="32"
ATTRS{state}=="running"
ATTRS{vendor}=="QEMU "
ATTRS{queue_depth}=="1"
ATTRS{ioerr_cnt}=="0x2"
ATTRS{iodone_cnt}=="0x180"
ATTRS{evt_media_change}=="0"
ATTRS{rev}=="2.5+"
looking at parent device '/devices/pci0000:00/0000:00:01.1/ata1/host0/target0:0:0':
KERNELS=="target0:0:0"
SUBSYSTEMS=="scsi"
DRIVERS==""
looking at parent device '/devices/pci0000:00/0000:00:01.1/ata1/host0':
KERNELS=="host0"
SUBSYSTEMS=="scsi"
DRIVERS==""
looking at parent device '/devices/pci0000:00/0000:00:01.1/ata1':
KERNELS=="ata1"
SUBSYSTEMS==""
DRIVERS==""
looking at parent device '/devices/pci0000:00/0000:00:01.1':
KERNELS=="0000:00:01.1"
SUBSYSTEMS=="pci"
DRIVERS=="ata_piix"
ATTRS{subsystem_vendor}=="0x1af4"
ATTRS{consistent_dma_mask_bits}=="32"
ATTRS{dma_mask_bits}=="32"
ATTRS{broken_parity_status}=="0"
ATTRS{irq}=="0"
ATTRS{ari_enabled}=="0"
ATTRS{vendor}=="0x8086"
ATTRS{enable}=="1"
ATTRS{msi_bus}=="1"
ATTRS{revision}=="0x00"
ATTRS{local_cpulist}=="0"
ATTRS{subsystem_device}=="0x1100"
ATTRS{class}=="0x010180"
ATTRS{local_cpus}=="1"
ATTRS{resource1}=="P"
ATTRS{resource3}==""
ATTRS{device}=="0x7010"
ATTRS{driver_override}=="(null)"
ATTRS{d3cold_allowed}=="0"
looking at parent device '/devices/pci0000:00':
KERNELS=="pci0000:00"
SUBSYSTEMS==""
DRIVERS==""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment