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

by on July 1, 2010 · 1 comment· LAST UPDATED July 1, 2010

in

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

TwitterFacebookGoogle+PDF versionFound an error/typo on this page? Help us!

{ 1 comment… read it below or add one }

1 Francisco Maia March 12, 2013 at 11:08 pm

Thank you for sending my error away ;)

Reply

Leave a Comment

Tagged as: , , , , , , , , , , ,

Previous Faq:

Next Faq: