Code:
:: Primary IDE Controller (IDE0)
hda -> Primary Master
hdb -> Primary Slave
:: Secondary Controller (IDE1)
hdc -> Secondary Master
hdd -> Secondary Slave
Each partition on a device is referred to by a number, so the first partition on /dev/hdd would be /dev/hdd1, second would be /dev/hdd2...