In preparation of a chroot I'm doing an mount --bind /etc/resolv.conf ${MOUNTPOINT}/etc/resolv.conf
. I need this because the ${MOUNTPOINT}
contains a broken etc/resolv.conf
.
However, mount
is missing the point of the operation. It complains that ${MOUNTPOINT}/etc/resolv.conf
"is a symbolic link to nowhere". Yes, I know. That's why I'm doing the rebind in the first place.
[edit] By request, /etc/resolv.conf
is a normal file:
-rw-r--r-- 1 root root 42 Feb 6 12:52 /etc/resolv.conf
with normal content
nameserver 192.168.4.1
This should also be used after the chroot, but not by changing the actual ${MOUNTPOINT}/etc/resolv.conf
. That should remain as-is:
lrwxrwxrwx 1 root root 27 Jun 14 2017 ${MOUNTPOINT}/etc/resolv.conf -> /run/resolvconf/resolv.conf
(Background: I know about rebinding /run/
in the context of resolv.conf
. Doesn't work for me, /etc/resolv.conf
is a real file and not a symbolic link. It's only ${MOUNTPOINT}/etc/resolv.conf
that's broken, and it's only broken during the chroot
so I can't just overwrite it).
la -la /etc/resolv.conf
output to the question? – Rui F Ribeiro Mar 12 '18 at 12:50chroot
. That's what I'm trying to avoid here. – MSalters Mar 12 '18 at 12:58chroot
and have umounted everything, the link should be untouched. – MSalters Mar 12 '18 at 13:35mount
the paths are resolved first (source and destination)... and in your case the destination can't be resolved. – don_crissti Mar 12 '18 at 13:55/etc/resolv.conf
to your chroot. – GAD3R Mar 12 '18 at 14:30