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

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, DevOps engineer, and a trainer for the Linux operating system/Unix shell scripting. Get the latest tutorials on SysAdmin, Linux/Unix and open source topics via RSS/XML feed or weekly email newsletter.

Share this on (or read 1 comments/add one below):

1 comment

    Have a question? Post it on our forum!