Sync to disk before un-mounting

This commit is contained in:
Jason Mehring 2014-11-06 23:58:34 -05:00
parent 23f1212b00
commit f8c9dd684c

View File

@ -39,6 +39,9 @@ umount_kill() {
# since we are doing an exact string match on the path # since we are doing an exact string match on the path
MOUNTDIR=$(echo "${MOUNTDIR}" | sed s#//*#/#g) 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" 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}") for dir in $(sudo grep "${MOUNTDIR}" /proc/mounts | cut -f2 -d" " | sort -r | grep "^${MOUNTDIR}")
do do