Created
April 3, 2018 14:21
-
-
Save groundnuty/58cf85d07370c06657324564f8b849cc to your computer and use it in GitHub Desktop.
Umount stale file handles
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while read -r mountp ; do if ! timeout 3s ls "$mountp" 1>/dev/null ; then echo "umounting $mountp" ; umount -l $mountp ; fi ; done < <(mount | cut -d ' ' -f 3) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment