logging udev events at boot time

Adapted from Peter Rajnoha post:

  • create a special systemd unit to monitor udev during boot:
    cat > /etc/systemd/system/systemd-udev-monitor.service <<EOF
    Description=udev Monitoring
    After=systemd-udevd-control.socket systemd-udevd-kernel.socket
    Before=sysinit.target systemd-udev-trigger.service
    ExecStart=/usr/bin/sh -c "/usr/sbin/udevadm monitor --udev --env > /udev_monitor.log"
  • run systemctl daemon-reload
  • run systemctl enable systemd-udev-monitor.service
  • reboot
  • append "systemd.log_level=debug systemd.log_target=kmsg udev.log-priority=debug log_buf_len=8M" to kernel command line
  • collect the logs in /udev_monitor.log
Alternatively this can be done with by setting udev_log="debug" in /etc/udev/udev.conf, rebooting and running
journalctl --all --this-boot --no-pager -o verbose
journalctl --all --this-boot --no-pager

Udev events happening at init time require re-creating the initramfs, which will copy udev.conf with the modified setting. It can be done on CentOS 7 with

dracut -f

Leave a Reply

Your email address will not be published. Required fields are marked *