RHEL Server no longer booting ('dracut: SELinux: Could not open policy file')

Solution Verified - Updated -

Environment

  • Red Hat Enterprise Linux

Issue

  • Server has stopped responding, it prompts for login but does not prompt for password
  • Rebooting the server to check the current state returned SELinux error messages as follow:
dracut: Mounted root filesystem /dev/mapper/system-root
dracut: Loading SELinux policy
dracut: SELinux: Could not open policy file <= /etc/selinux/targeted/policy/policy.24: No such file or directory /sbin/load_policy: Can't load policy: No such file or directory
No such file or directory
dracut: Switching root

Resolution

  • Move contents of /etc back to it's correct place, example:
  # mv /etc/yum.repos.d/*  /etc/

Root Cause

  • Contents of /etc had been moved, effectively deleting them.

Diagnostic Steps

  • Rescue env may not automatically detect the root fs (as /etc was effectively 'missing')
  • 'find' was used to figure out where it had been moved
  • The command 'mv *' might be the one that caused the problem:
$ pwd
  /home/your-user
$ mkdrir main-dir
$ cd main-dir/
$ mkdir test1 test2 test3 test4
$ ls
  test1  test2  test3  test4
$ mv *
$ ls
  test4
$ ls test4/
  test1  test2  test3

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.