From 93a44b1dbeb0908930887fd5d17111fc58a35d4b Mon Sep 17 00:00:00 2001
From: Stephen Soltesz <soltesz@cs.princeton.edu>
Date: Mon, 18 Apr 2011 15:30:30 -0400
Subject: [PATCH] Add extra umounts for /dev and /sys In some cases,
 /tmp/mnt/sysimg was failing to umount due to these mount points

---
 source/steps/ChainBootNode.py | 2 ++
 source/steps/InstallInit.py   | 4 ++++
 2 files changed, 6 insertions(+)

diff --git a/source/steps/ChainBootNode.py b/source/steps/ChainBootNode.py
index 3b9df6d..504ea63 100644
--- a/source/steps/ChainBootNode.py
+++ b/source/steps/ChainBootNode.py
@@ -157,6 +157,8 @@ def Run( vars, log ):
     log.write( "Unmounting disks.\n" )
     utils.sysexec( "umount %s/vservers" % SYSIMG_PATH, log )
     utils.sysexec( "umount %s/proc" % SYSIMG_PATH, log )
+    utils.sysexec( "umount %s/dev" % SYSIMG_PATH, log )
+    utils.sysexec( "umount %s/sys" % SYSIMG_PATH, log )
     utils.sysexec( "umount %s" % SYSIMG_PATH, log )
     utils.sysexec( "vgchange -an", log )
 
diff --git a/source/steps/InstallInit.py b/source/steps/InstallInit.py
index 32fbafe..3456343 100644
--- a/source/steps/InstallInit.py
+++ b/source/steps/InstallInit.py
@@ -64,9 +64,13 @@ def Run( vars, log ):
     except OSError, e:
         pass
 
+    # NOTE: added /sys and /dev b/c some nodes fail due to this when disk is
+    # nearly full.
     utils.sysexec_noerr( "umount %s/proc" % SYSIMG_PATH , log )
     utils.sysexec_noerr( "umount %s/mnt/cdrom" % SYSIMG_PATH , log )
     utils.sysexec_noerr( "umount %s/vservers" % SYSIMG_PATH , log )
+    utils.sysexec_noerr( "umount %s/sys" % SYSIMG_PATH , log )
+    utils.sysexec_noerr( "umount %s/dev" % SYSIMG_PATH , log )
     utils.sysexec_noerr( "umount %s" % SYSIMG_PATH , log )
     vars['ROOT_MOUNTED']= 0
 
-- 
2.47.0