Q:

How do I detect what device an external HDD is mapped to?

I want to backup data to an external drive that is always connected to the same external USB port.
How do I detect what device the external drive is mapped to?

A:

There are several ways of dealing with that. To see the attached devices, use sudo fdisk -l. To see where devices are mounted, use mount (before you can use a device, you have to mount it, that is -- attach it to an existing, empty directory which is called "mountpoint").
Even if the device is always conntected to the same USB port, you cannot be sure that it always gets the device. Therefore, use the device ID when mounting:
sudo blkid

This will show you a list of devices along with their UUID's, which determine the devices in a unique manner:
/dev/sda1: UUID="395b2e65-af41-4026-8492-d6f17b08ad8b" TYPE="ext4" 
/dev/sda5: UUID="db9e00d0-afe9-4386-95c1-a11a13324932" TYPE="swap" 
/dev/sda6: UUID="11842584-3992-47c8-81a8-ac1aa498ce2d" TYPE="ext4"

Instead of /dev/sda1, for example, you can access them then by ls /dev/disk/by-uuid/395b2e65-af41-4026-8492-c6f17b08ad8b, which is maybe more obscure, but better.

