• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

Starting udev: udevd inotify_init failed: too many open files

by admin

The Problem

After a server has been restarted after patching – The error below can possibly be witnessed during boot and the same error is visible in /var/log/boot.log:

Starting udev: udevd inotify_init failed: too many open files

Due to udev fails to start, network and bonding interfaces are missing (including modules/drivers).

The Solution

There was a change in /etc/sysctl.conf, /etc/sysctl.d/99-install-oracle which included below stanza to overcome some issue with Veritas Cluster:

fs.inotify.max_queued_events = 0
fs.inotify.max_user_instances = 0
fs.inotify.max_user_watches = 0
fs.dir-notify-enable = 0

fs.inotify is used by various programs/apps and udev as well to track changes in files – in this case watchers are set to 0 hence udev can’t use watchers to track all changes on OS and throw error around too many open files. As system was restarted – OS started to use new settings for fs.inotify and caused whole issue with udev.

To resolve the issue, follow the steps outlined below:

1. Revert changes from /etc/sysctl.conf and any file which might still hold new value in /etc/sysctl.d/ folder, below command can be used to easily find all files where change was applied in /etc.

# grep -rnw /etc -e "fs.inotify" 2>/dev/null

2. To revert changes open vi edit for /etc/sysctl.conf and comment new stanza:

#fs.inotify.max_queued_events = 0
#fs.inotify.max_user_instances = 0
#fs.inotify.max_user_watches = 0
#fs.dir-notify-enable = 0

3. Save the file and reboot – after reboot verify if interfaces are up and if udev starts without any issues. By default on CentOS/RHEL 6, fs.inotify stanzas are set to:

fs.inotify.max_queued_events = 16384
fs.inotify.max_user_instances = 128
fs.inotify.max_user_watches = 8192
fs.dir-notify-enable = 1

4. You can check current setting for fs.inotify by executing sysctl command:

# sysctl -a | grep fs.inotify

Filed Under: CentOS/RHEL 6, CentOS/RHEL 7, Linux

Some more articles you might also be interested in …

  1. CentOS / RHEL 7 : How to configure cache-only nameserver
  2. SSH Connection Refused by TCP Wrapper
  3. CentOS / RHEL 6 : How to configure kdump
  4. lrzuntar Command Examples in Linux
  5. deluser: command not found
  6. How to mount USB flash drive in Linux
  7. fstrim Command Examples in Linux
  8. ssh-copy-id Command Examples in Linux
  9. How to identify the HBA cards/ports and WWN in Linux
  10. cuyo Command Examples in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • nixos-rebuild Command Examples in Linux
  • nixos-option: Command Examples in Linux
  • nixos-container : Command Examples in Linux
  • nitrogen Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright