restorecond: Will not restore a file with more than one hard link (/etc/resolv.conf) No such file or directory Error and Solution

Posted on in Categories , last updated July 1, 2010

I see the following error in my SELinux enabled CentOS or RHEL server:

Jun 21 13:58:43 server3 restorecond: Will not restore a file with more than one hard link (/etc/resolv.conf) No such file or directory
Jun 21 16:14:51 server3 restorecond: Will not restore a file with more than one hard link (/etc/resolv.conf) No such file or directory
Jun 22 13:32:23 server3 restorecond: Will not restore a file with more than one hard link (/etc/resolv.conf) No such file or directory

How do I fix this problem?

You or one of your script may have made additional hard link to your /etc/resolv.conf file. Under CentOS / RHEL / Fedora, file /etc/sysconfig/networking/profiles/default/resolv.conf hard linked with /etc/resolv.conf. To find all hard links, enter:
find / -xdev -samefile /etc/resolv.conf
Sample outputs:

 /etc/sysconfig/networking/profiles/default/resolv.conf

To fix this problem type the following commands:
# rm /etc/sysconfig/networking/profiles/default/resolv.conf
# restorecon /etc/resolv.conf
# ln /etc/resolv.conf /etc/sysconfig/networking/profiles/default/resolv.conf

Posted by: Vivek Gite

The author is the creator of nixCraft and a seasoned sysadmin and a trainer for the Linux operating system/Unix shell scripting. He has worked with global clients and in various industries, including IT, education, defense and space research, and the nonprofit sector. Follow him on Twitter, Facebook, Google+.

1 comment

Leave a Comment