There can be several mount points under management in linux. I want to umount them all or don't umount any. Since there are cases when linux cannot umount a device (like someone is on the mount point), I want to add a function to check all mount points and see if the devices can be umounted before I actually perform umount action.
Is there any functions like trylock
to test if a device is umountable? Or if there are any function to check if any user is using the mount point like lsof
?