A while back, Apple announced a replacement program for iMacs with a Seagate 1TB hard drive that shipped in mid-2011. Theses drives were prone to failure, so the program was set up to facilitate getting a properly-working replacement installed in those iMacs, which require drives with a custom firmware to interact with the temperature sensors. Not having this firmware results in the fans ramping up to full speed as you use it.
Now, Apple has extended that replacement program to cover iMacs sold with that same drive dating back to October 2009. To see if your iMac qualifies for the replacement, you can enter your machine’s serial number on Apple’s Replacement Program page.