Skip to content

Instantly share code, notes, and snippets.

@groundnuty
Created April 3, 2018 14:21
Show Gist options
  • Save groundnuty/58cf85d07370c06657324564f8b849cc to your computer and use it in GitHub Desktop.
Save groundnuty/58cf85d07370c06657324564f8b849cc to your computer and use it in GitHub Desktop.
Umount stale file handles
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