28.2. User Accessing Files: fuser

Suppose that we want to unmount a file system under /mnt:

$ mount -l | grep /mnt
/dev/sda on /mnt type ext2 (rw,noexec,nosuid,nodev,noatime,user=jj)

The attempt to unmount it fails:

$ umount /mnt
umount: /mnt: device is busy

To find out which processes are accessing the files in the /mnt directory, enter:

$ fuser -v /mnt/*

                     USER        PID ACCESS COMMAND
                     jj        26597 f....  less

Following termination of the less process, which was running on another terminal, the file system can successfully be unmounted.