Off-Topic Question: Check if filesystem is in use

Sedat Dilek sedat.dilek at gmail.com
Fri Mar 29 06:42:37 UTC 2013


Hi,

...guess this is a Linux-Filesystem specific question... Why not ask
also on "linux-fsdevel" <linux-fsdevel at vger.kernel.org>?

Regards,
- Sedat -

On Fri, Mar 29, 2013 at 6:45 AM, Harald Becker <ralda at gmx.de> wrote:
> Hi,
>
> as here are several experts, and not so much traffic at the moment, I
> throw in an off-topic question (which may still be of interest for
> other system managers):
>
> In a shell script I like to check if a mounted filesystem is still in
> use by any other process in the system. If there is no more process
> using the filesystem some cleanup actions has to be done and
> afterwards the filesystem is unmounted. As the filesystem is only a
> temporary filesystem it's contents is lost after the unmount, so the
> cleanup action has to be done before the umount. And that cleanup shall
> only be done when there are no more processes actively using the
> filesystem. As I do not know which processes got forked off and are
> still using the filesystem I'm not able to check for existence of
> specific processes. So I'm in need of a test to determine if there is
> any process using a filesystem (that is the filesystem is busy).
>
> What do you think is the best way to achieve this?
>
> Many thx for suggestions
> Harald
> _______________________________________________
> busybox mailing list
> busybox at busybox.net
> http://lists.busybox.net/mailman/listinfo/busybox


More information about the busybox mailing list