From f8c9dd684c633425dd4e4a8455bdfbf25b61cc0a Mon Sep 17 00:00:00 2001 From: Jason Mehring Date: Thu, 6 Nov 2014 23:58:34 -0500 Subject: [PATCH] Sync to disk before un-mounting --- umount_kill.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/umount_kill.sh b/umount_kill.sh index c647107..57778c9 100755 --- a/umount_kill.sh +++ b/umount_kill.sh @@ -39,6 +39,9 @@ umount_kill() { # since we are doing an exact string match on the path MOUNTDIR=$(echo "${MOUNTDIR}" | sed s#//*#/#g) + # Sync the disk befoe un-mounting to be sure everything is written + sync + warn "-> Attempting to kill any processes still running in '${MOUNTDIR}' before un-mounting" for dir in $(sudo grep "${MOUNTDIR}" /proc/mounts | cut -f2 -d" " | sort -r | grep "^${MOUNTDIR}") do