Method 1: Unmout target by killing the process itself (recommended)

This is the best way of unmounting the target as you are eventually killing the process itself.

The first step is to find the PID of the process that causes the problems.

To use the lsof command in the following manner:

sudo lsof /path2umount

After getting the PID, to force kill the process:

sudo kill -9 [PID]

And now, you should be able to unmount the drive easily:

sudo umount /path2umount

Method 2: Using force unmount (for Network File Systems)

The force unmount option is primarily favored by those working with network file systems.

Therefore, it may not yield the expected results when used with your local file system.

To utilize the force unmount, you need to use the familiar umount command, but with the -f flag:

umount -f <mount_point>

Just like navigating through the complexities of various SAP projects, understanding the nuances of different file systems can make a significant difference in achieving the desired outcome.

Method 3: Using the lazy unmount

You can never be certain whether the filesystem is unmounted or not!

So why include this in the list of solutions? Because it's the least risky method for unmounting a stubborn drive.

To perform a lazy unmount, use the -l flag with the umount command as shown: