function to force/lazy umount if stale/hanging
This commit is contained in:
parent
c56c9ed2c7
commit
7c276f31b8
12
gaboshlib/g_staleumount.bashfunc
Normal file
12
gaboshlib/g_staleumount.bashfunc
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
function g_staleumount {
|
||||||
|
grep -v tracefs /proc/mounts | grep -v /run/ | cut -d' ' -f2 | while read g_mount
|
||||||
|
do
|
||||||
|
if ! timeout --signal=KILL 120 ls -d "$g_mount" >/dev/null
|
||||||
|
then
|
||||||
|
g_echo_error "Unmounting stale/hanging $g_mount with -lf"
|
||||||
|
umount -lf "$g_mount"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user