[Libguestfs] [PATCH 1/2] rescue: Suggest using recursive bind mounts.

Richard W.M. Jones rjones at redhat.com
Thu Mar 24 10:48:31 UTC 2016


Since /dev and other directories contain sub-mounts, suggest using
--rbind instead of --bind.  This also allows us to remove the /dev/pts
line.
---
 rescue/rescue.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/rescue/rescue.c b/rescue/rescue.c
index 53afdae..9a7c988 100644
--- a/rescue/rescue.c
+++ b/rescue/rescue.c
@@ -453,10 +453,9 @@ do_suggestion (struct drv *drvs)
 
     /* If it's Linux, print the bind-mounts. */
     if (type && STREQ (type, "linux")) {
-      printf ("mount --bind /dev /sysroot/dev\n");
-      printf ("mount --bind /dev/pts /sysroot/dev/pts\n");
-      printf ("mount --bind /proc /sysroot/proc\n");
-      printf ("mount --bind /sys /sysroot/sys\n");
+      printf ("mount --rbind /dev /sysroot/dev\n");
+      printf ("mount --rbind /proc /sysroot/proc\n");
+      printf ("mount --rbind /sys /sysroot/sys\n");
     }
 
     printf ("\n");
-- 
2.7.4




More information about the Libguestfs mailing list