I was going through the Gentoo Handbook in preparation for installing Gentoo on my system.
In the Chrooting section, these commands are given:
mount --rbind /sys /mnt/gentoo/sys
mount --make-rslave /mnt/gentoo/sys
mount --rbind /dev /mnt/gentoo/dev
mount --make-rslave /mnt/gentoo/dev
These are the doubts I have regarding this section:
I'm no Linux expert but based on a little digging I did, I found out that a bind mount
takes an existing directory tree and replicates it under a different point. The directories and files in the bind mount are the same as the original. Any modification on one side is immediately reflected on the other side, since the two views show the same data.
What I don't understand is, how does making a bind mount in /mnt/gentoo/sys help? The original directory tree is in the installation medium which will be removed. So any changes made in the medium will not be reflected here. What is the purpose of using this command instead of
mount -t sysfs sysfs /mnt/gentoo/sys
What is the purpose of using rbind? Assuming that the purpose of the bind mounting was only to create a /sys file on the /mnt/gentoo and not make use of bind mount's reflective feature, why use of rbind? Again, as far as I know, rbind is used when there are mount points under the original directory being bind mounted. But there aren't any mount points under /sys are there?