Use the normalized path for unmounting, patch by Peter Daum
[grml2usb.git] / grml2usb
index 3bf80e8..b5338bd 100755 (executable)
--- a/grml2usb
+++ b/grml2usb
@@ -869,7 +869,7 @@ def unmount(target, unmount_options):
     # make sure we unmount only already mounted targets
     target_unmount = False
     mounts = open('/proc/mounts').readlines()
-    mountstring = re.compile(".*%s.*" % re.escape(target))
+    mountstring = re.compile(".*%s.*" % re.escape(os.path.realpath(target)))
     for line in mounts:
         if re.match(mountstring, line):
             target_unmount = True