SHARE
TWEET

udev

ikay0 Dec 16th, 2018 81 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. cloud_user@emu8971c:~$ udevadm info --name=/dev/xvdb1 --attribute-walk
  2.  
  3. Udevadm info starts with the device specified by the devpath and then
  4. walks up the chain of parent devices. It prints for every device
  5. found, all possible attributes in the udev rules key format.
  6. A rule to match, can be composed by the attributes of the device
  7. and the attributes from one single parent device.
  8.  
  9.   looking at device '/devices/vbd-51728/block/xvdb/xvdb1':
  10.     KERNEL=="xvdb1"
  11.     SUBSYSTEM=="block"
  12.     DRIVER==""
  13.     ATTR{alignment_offset}=="0"
  14.     ATTR{discard_alignment}=="0"
  15.     ATTR{inflight}=="       0        0"
  16.     ATTR{partition}=="1"
  17.     ATTR{ro}=="0"
  18.     ATTR{size}=="4192256"
  19.     ATTR{start}=="2048"
  20.     ATTR{stat}=="     154        0    10352      424        0        0        0        0        0      356      424"
  21.  
  22.  
  23.  
  24. cloud_user@emu8971c:~$ sudo cat /etc/udev/rules.d/81-persistent-dev.rules
  25. ATTR{size}=="4192256", ATTR{partition}=="1", SUBSYSTEM=="block", KERNEL=="xvdb1", SYMLINK+="/dev/test_link"
  26.  
  27. cloud_user@emu8971c:~$ udevadm control --reload-rules
  28.  
  29. cloud_user@emu8971c:~$ sudo /etc/init.d/udev restart
  30.  
  31. cloud_user@emu8971c:~$ udevadm test -a -p $(udevadm info -q path -n /dev/xvdb1)
  32. calling: test
  33. version 229
  34. This program is for debugging only, it does not run any program
  35. specified by a RUN key. It may show incorrect results, because
  36. some values may be different, or not available at a simulation run.
  37.  
  38. === trie on-disk ===
  39. tool version:          229
  40. file size:         6841781 bytes
  41. header size             80 bytes
  42. strings            1755245 bytes
  43. nodes              5086456 bytes
  44. Load module index
  45. timestamp of '/etc/systemd/network' changed
  46. timestamp of '/lib/systemd/network' changed
  47. Parsed configuration file /lib/systemd/network/99-default.link
  48. Parsed configuration file /etc/systemd/network/50-cloud-init-eth0.link
  49. Created link configuration context.
  50. timestamp of '/etc/udev/rules.d' changed
  51. Skipping overridden file: /lib/udev/rules.d/60-cdrom_id.rules.
  52. Reading rules file: /lib/udev/rules.d/40-vm-hotadd.rules
  53. Reading rules file: /lib/udev/rules.d/50-apport.rules
  54. Reading rules file: /lib/udev/rules.d/50-firmware.rules
  55. Reading rules file: /lib/udev/rules.d/50-udev-default.rules
  56. Reading rules file: /lib/udev/rules.d/55-dm.rules
  57. Reading rules file: /lib/udev/rules.d/56-lvm.rules
  58. Reading rules file: /lib/udev/rules.d/60-block.rules
  59. Skipping empty file: /etc/udev/rules.d/60-cdrom_id.rules
  60. Reading rules file: /lib/udev/rules.d/60-drm.rules
  61. Reading rules file: /lib/udev/rules.d/60-evdev.rules
  62. Reading rules file: /lib/udev/rules.d/60-gnupg.rules
  63. Reading rules file: /lib/udev/rules.d/60-open-vm-tools.rules
  64. Reading rules file: /lib/udev/rules.d/60-persistent-alsa.rules
  65. Reading rules file: /lib/udev/rules.d/60-persistent-input.rules
  66. Reading rules file: /lib/udev/rules.d/60-persistent-storage-dm.rules
  67. Reading rules file: /lib/udev/rules.d/60-persistent-storage-tape.rules
  68. Reading rules file: /lib/udev/rules.d/60-persistent-storage.rules
  69. Reading rules file: /lib/udev/rules.d/60-persistent-v4l.rules
  70. Reading rules file: /lib/udev/rules.d/60-serial.rules
  71. Reading rules file: /lib/udev/rules.d/60-vlan-network-interface.rules
  72. Reading rules file: /lib/udev/rules.d/61-persistent-storage-android.rules
  73. Reading rules file: /lib/udev/rules.d/63-md-raid-arrays.rules
  74. Reading rules file: /lib/udev/rules.d/64-btrfs.rules
  75. Reading rules file: /lib/udev/rules.d/64-md-raid-assembly.rules
  76. Reading rules file: /lib/udev/rules.d/66-azure-ephemeral.rules
  77. Reading rules file: /lib/udev/rules.d/66-snapd-autoimport.rules
  78. Reading rules file: /lib/udev/rules.d/69-bcache.rules
  79. Reading rules file: /lib/udev/rules.d/69-lvm-metad.rules
  80. Reading rules file: /lib/udev/rules.d/70-debian-uaccess.rules
  81. Reading rules file: /lib/udev/rules.d/70-iscsi-network-interface.rules
  82. Reading rules file: /lib/udev/rules.d/70-mouse.rules
  83. Reading rules file: /etc/udev/rules.d/70-persistent-net.rules
  84. Reading rules file: /lib/udev/rules.d/70-power-switch.rules
  85. Reading rules file: /lib/udev/rules.d/70-resolvconf-initramfs-copy.rules
  86. Reading rules file: /lib/udev/rules.d/70-uaccess.rules
  87. Reading rules file: /lib/udev/rules.d/71-power-switch-proliant.rules
  88. Reading rules file: /lib/udev/rules.d/71-seat.rules
  89. Reading rules file: /lib/udev/rules.d/73-seat-late.rules
  90. Reading rules file: /lib/udev/rules.d/73-special-net-names.rules
  91. Reading rules file: /lib/udev/rules.d/73-usb-net-by-mac.rules
  92. Reading rules file: /lib/udev/rules.d/75-net-description.rules
  93. Reading rules file: /lib/udev/rules.d/75-probe_mtd.rules
  94. Reading rules file: /lib/udev/rules.d/78-graphics-card.rules
  95. Reading rules file: /lib/udev/rules.d/78-sound-card.rules
  96. Reading rules file: /lib/udev/rules.d/80-debian-compat.rules
  97. Reading rules file: /lib/udev/rules.d/80-drivers.rules
  98. Reading rules file: /lib/udev/rules.d/80-ifupdown.rules
  99. Reading rules file: /lib/udev/rules.d/80-net-setup-link.rules
  100. Reading rules file: /etc/udev/rules.d/81-persistent-dev.rules
  101. Reading rules file: /lib/udev/rules.d/85-hdparm.rules
  102. Reading rules file: /lib/udev/rules.d/85-keyboard-configuration.rules
  103. Reading rules file: /lib/udev/rules.d/99-systemd.rules
  104. Reading rules file: /lib/udev/rules.d/99-vmware-scsi-udev.rules
  105. rules contain 49152 bytes tokens (4096 * 12 bytes), 14306 bytes strings
  106. 2178 strings (27343 bytes), 1451 de-duplicated (13765 bytes), 728 trie nodes used
  107. value '[dmi/id]sys_vendor' is 'Xen'
  108. value '[dmi/id]sys_vendor' is 'Xen'
  109. IMPORT builtin 'blkid' /lib/udev/rules.d/60-persistent-storage.rules:76
  110. Failure opening block device /dev/xvdb1: Permission denied
  111. IMPORT builtin 'blkid' returned non-zero
  112. IMPORT 'probe-bcache -o udev /dev/xvdb1' /lib/udev/rules.d/69-bcache.rules:16
  113. starting 'probe-bcache -o udev /dev/xvdb1'
  114. Process 'probe-bcache -o udev /dev/xvdb1' succeeded.
  115. LINK '/dev/test_link' /etc/udev/rules.d/81-persistent-dev.rules:1
  116. handling device node '/dev/xvdb1', devnum=b202:17, mode=0600, uid=0, gid=0
  117. preserve already existing symlink '/dev/block/202:17' to '../xvdb1'
  118. creating link '/dev//dev/test_link' to '/dev/xvdb1'
  119. creating symlink '/dev//dev/test_link' to '../../xvdb1'
  120. atomically replace '/dev//dev/test_link'
  121. symlink '../../xvdb1' '/dev//dev/test_link.tmp-b202:17' failed: Permission denied
  122. .ID_FS_TYPE_NEW=
  123. ACTION=-p
  124. DEVLINKS=/dev//dev/test_link
  125. DEVNAME=/dev/xvdb1
  126. DEVPATH=/devices/vbd-51728/block/xvdb/xvdb1
  127. DEVTYPE=partition
  128. ID_FS_TYPE=
  129. ID_PART_TABLE_TYPE=dos
  130. ID_PART_TABLE_UUID=9597e8c2
  131. MAJOR=202
  132. MINOR=17
  133. SUBSYSTEM=block
  134. TAGS=:systemd:
  135. USEC_INITIALIZED=9707191285
  136. Unload module index
  137. Unloaded link configuration context.
  138. cloud_user@emu8971c:~$
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top