FS#64490 - [arch-install-scripts] Host root is mounted to /etc/resolv.conf
Attached to Project:
Arch Linux
Opened by Maxim (mxfm) - Wednesday, 13 November 2019, 21:19 GMT
Last edited by morganamilo (morganamilo) - Monday, 18 November 2019, 04:02 GMT
Opened by Maxim (mxfm) - Wednesday, 13 November 2019, 21:19 GMT
Last edited by morganamilo (morganamilo) - Monday, 18 November 2019, 04:02 GMT
|
Details
Description: after switching in arch-chroot host root is
mounted to /etc/resolv.conf.
According to the source (https://git.archlinux.org/arch-install-scripts.git/tree/arch-chroot.in#n26) there is some logic to handle special cases of resolv.conf, but in my setup I have plain, not linked file. Additional info: * package version(s) 22-1 * config and/or log files etc. * link to upstream bug report, if any Steps to reproduce: 1) Mount some partition to some directory or do a bind mount. 2) Call lsblk, try to delete /etc/resolv.conf. I noticed this issue some time ago. |
This task depends upon
Closed by morganamilo (morganamilo)
Monday, 18 November 2019, 04:02 GMT
Reason for closing: Not a bug
Additional comments about closing: it's a feature
Monday, 18 November 2019, 04:02 GMT
Reason for closing: Not a bug
Additional comments about closing: it's a feature
I can't parse this. You can't possibly mean that a directory is mounted on a file. Do you mean /etc/resolv.conf from the host is bind mounted into the chroot? That's worked as intended.
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 698.7G 0 disk
├─sda1 8:1 0 2M 0 part
├─sda2 8:2 0 10G 0 part [SWAP]
└─sda3 8:3 0 688.6G 0 part /etc/resolv.conf
Okay, that looks bizarre and I think lsblk is broken in attempting to convey the meaning behind this, but also, that is not actually a bug.
$ sudo mount --bind /var/lib/archbuild/extra-x86_64/root /var/lib/archbuild/extra-x86_64/root && sudo arch-chroot /var/lib/archbuild/extra-x86_64/root/ findmnt /etc/resolv.conf
TARGET SOURCE FSTYPE OPTIONS
/etc/resolv.conf /dev/sda3[/etc/resolv.conf] btrfs rw,relatime,space_cache,subvolid=5,subvol=/etc/resolv.conf
It's a completely ordinary bind mount, as expected.
$ sudo mount --bind /var/lib/archbuild/extra-x86_64/root /var/lib/archbuild/extra-x86_64/root && sudo arch-chroot /var/lib/archbuild/extra-x86_64/root/ file /etc/resolv.conf
/etc/resolv.conf: ASCII text
It's a completely ordinary ASCII text file, as expected, not a directory.
> try to delete /etc/resolv.conf
Why would you want to do that? Because you hate the internet? This is an unsupported operation.
I see. I was confused by ...
> Okay, that looks bizarre and I think lsblk is broken in attempting to convey the meaning behind this, but also, that is not actually a bug.
this. I thought there is some bug in mounting.
> Why would you want to do that? Because you hate the internet? This is an unsupported operation.
Because during installation I move my custom resolv.conf from backup to /etc/resolv.conf. This cannot be done because of the following error:
mv: inter-device move failed: 'etc.resolv.conf.back' to '/mnt/2/etc/resolv.conf'; unable to remove target: Device or resource busy
The solution is to unmount resolv.conf.
Tl;dr I was confused by lsblk output and mv error, concluded that there is arch-chroot bug. If it works as intended, the issue can be closed.