≡ Menu

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

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

Tweet itFacebook itGoogle+ itPDF itFound an error/typo on this page?

{ 1 comment… add one }

  • Francisco Maia March 12, 2013, 11:08 pm

    Thank you for sending my error away ;)

Leave a Comment