How to find out what process is using a file system

Hi folks,

In this article I will discuss how to fix a problem with unmounting file systems in Ubuntu. Suppose you want to unmount a file system /some/endpoint for example in Ubuntu but run into an error like

umount: /some/endpoint: target is busy
        (In some cases useful info about processes that
         use the device is found by lsof(8) or fuser(1).)
Mount is denied because the NTFS volume is already exclusively opened.
The volume may be already mounted, or another software may use it which
could be identified for example by the help of the 'fuser' command.

An easy way to find out what exactly is using that endpoint is to run the following command:

lsof | grep /some/endpoint

Once you see what process is using the filesystem, you can then go ahead to kill or end it.

Leave a Reply

Your email address will not be published. Required fields are marked *