Use 'private' bind mounts

When plain '--rbind' is used, the 'umount' process executed later in the
setup process completely unmounts the bound filesystem, resulting in various
forms of breakage on the host used to do the setup. When a Live CD is used
and the system will be immediately shutdown/rebooted, this isn't an issue,
but in other scenarios it can be problematic.

Making the bind mounts 'private' avoids this problem. This patch changes
the setup guides for 'modern' distribution versions but does not touch
the older ones where this functionality may not be available.

Signed-off-by: Kevin P. Fleming <kevin@km6g.us>
Signed-off-by: Richard Laager <rlaager@wiktel.com>
This commit is contained in:
Kevin P. Fleming
2022-01-16 08:33:14 -05:00
committed by Richard Laager
parent 7b974c4181
commit 5713bc08ed
5 changed files with 29 additions and 29 deletions

View File

@@ -719,9 +719,9 @@ Step 4: System Configuration
#. Bind the virtual filesystems from the LiveCD environment to the new
system and ``chroot`` into it::
mount --rbind /dev /mnt/dev
mount --rbind /proc /mnt/proc
mount --rbind /sys /mnt/sys
mount --make-private --rbind /dev /mnt/dev
mount --make-private --rbind /proc /mnt/proc
mount --make-private --rbind /sys /mnt/sys
chroot /mnt /usr/bin/env DISK=$DISK UUID=$UUID bash --login
**Note:** This is using ``--rbind``, not ``--bind``.
@@ -1216,9 +1216,9 @@ Mount everything correctly::
If needed, you can chroot into your installed environment::
mount --rbind /dev /mnt/dev
mount --rbind /proc /mnt/proc
mount --rbind /sys /mnt/sys
mount --make-private --rbind /dev /mnt/dev
mount --make-private --rbind /proc /mnt/proc
mount --make-private --rbind /sys /mnt/sys
mount -t tmpfs tmpfs /mnt/run
mkdir /mnt/run/lock
chroot /mnt /bin/bash --login