DebuggingUdev

Differences between revisions 8 and 9
Revision 8 as of 2008-12-21 22:37:13
Size: 2984
Editor: host-74-211-54-214
Comment: update for intrepid replacement of the udevmonitor command.
Revision 9 as of 2011-11-28 18:05:41
Size: 3425
Editor: serge-hallyn
Comment:
Deletions are marked like this. Additions are marked like this.
Line 44: Line 44:
 * To get more debug info from udev,
  * edit /usr/share/initramfs-tools/scripts/init-top/udev, and change the line starting udev by adding --debug and sending stdout and stderr into a file under/dev/.initramfs. For instance:

    /sbin/udevd --daemon --debug --resolve-names=never > /dev/.initramfs/udev.out 2>&1
  * then run sudo update-initramfs -k all -u
  * After reboot, /dev/.initramfs/udev.out will have the udev debug info.

Debugging Central

This page is part of the debugging series — pages with debugging details for a variety of Ubuntu packages.

General notes

  • The default names for devices come from the kernel.
  • Our naming policy is to follow the standard devices.txt suggested names, applying them where the kernel driver uses a mnemonic name.

  • We do not supply special names, no, you cannot have /dev/pony.

  • However if ponies are a class of devices that share a common subsystem or driver, and are commonly addressed in this way, you could have /dev/pony0.../dev/ponyN

  • The numbers on the end of the enumerated devices are assigned by the kernel on a first-come, first-served basis.
  • This means every time you boot, the numbers swap around.
  • This is not a bug.
  • We counter the above by creating symlinks with device-unique names (serial numbers, UUIDs, etc.) e.g. /dev/disk/by-uuid and /dev/input/by-id

  • udev does not mount your disks, HAL, gnome-volume-manager and pmount do that.
  • udev doesn't pick which module gets loaded, modprobe does that.

Common symptoms

  • /dev/null with wrong permissions: udev failed to start in the real filesystem, make sure that the udevd from the initramfs was killed, and that there is only one udev startup script.

  • 3-minute hang on boot: one of the devices rules is failing, check /var/log/udev as noted below.

    • often this is ifup, hdparm, etc.

Useful things

  • sudo udevmonitor -e ... this should be run for any problems when a device is plugged in, or removed. It will output UEVENT blocks for the event from the kernel, and a following UDEV block; these are timestamped so you know how long it takes to process. The UDEV block contains more information, which udev adds through various helper programs.

    • note that in Ubuntu 8.10, the udevmonitor command has been replaced with the "udevadm monitor" command. This changes the above command to sudo udevadm monitor --e

  • /var/log/udev, this is the output from above for the boot process. Especially note whether a UDEV block takes a long amount of time to appear, or doesn't appear at all.

  • To see the actions udevd is taking, you can run it in verbose debug mode:
    • sudo pkill udevd
    • sudo udevd --debug-trace --verbose --suppress-syslog
  • To get more debug info from udev,
    • edit /usr/share/initramfs-tools/scripts/init-top/udev, and change the line starting udev by adding --debug and sending stdout and stderr into a file under/dev/.initramfs. For instance:
      • /sbin/udevd --daemon --debug --resolve-names=never > /dev/.initramfs/udev.out 2>&1

    • then run sudo update-initramfs -k all -u
    • After reboot, /dev/.initramfs/udev.out will have the udev debug info.

Known bugs

Description of known issues, how to recognise them and stock responses/actions.

Open

Bug#

Description

Action

TBD.

TBD.

TBD.

Closed

Bug#

Description

Action

TBD.

TBD.

TBD.

Non-bugs

TBD.


CategoryBugSquad CategoryDebugging

DebuggingUdev (last edited 2017-01-30 00:30:05 by lfaraone)