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

The Geek Diary

CONCEPTS | BASICS | HOWTO

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • Linux Services
    • VCS
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
    • Data Guard
  • DevOps
    • Docker
    • Shell Scripting
  • Interview Questions
  • 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. Understanding Variables in Bash Shell Under Linux
  2. “btrfs” command examples to Create and Manage Btrfs File System
  3. How to change the path of the auditd log file /var/log/audit/audit.log
  4. How to make CentOS/RHEL 7 FIPS 140-2 compliant
  5. How to resize (extend) a partition-based file system in Linux
  6. Linux OS Service ‘acpid’
  7. How To Configure SNMP Daemons: snmpd and snmptrapd on CentOS/RHEL 5,6 and 7
  8. Passwordless SSH not working for local users on LDAP servers – CentOS/RHEL 7
  9. Where to find ASMLib / oracleasm RPMs for CentOS/RHEL, SUSE, OEL
  10. How to Configure ACL(Access Control Lists) in Linux FileSystem

You May Also Like

Primary Sidebar

Recent Posts

  • How to Disable IPv6 on Ubuntu 18.04 Bionic Beaver Linux
  • How to Capture More Logs in /var/log/dmesg for CentOS/RHEL
  • Unable to Start RDMA Services on CentOS/RHEL 7
  • How to rename a KVM VM with virsh
  • Archives
  • Contact Us
  • Copyright

© 2021 · The Geek Diary