You can open Activity Monitor, click on processes, click Inspect, click "Open Files and Ports," and that list will have everything that the program is accessing. If whatever is being accessed is on the external HDD by whatever program, closing that program should allow you to unmount the external HDD.