If you bought an iMac with a 3TB hard drive between December 2012 and September 2013 and you're having problems with that drive, Apple will replace it for free.
The iMac (27-inch) 3TB Hard Drive Replacement Program replaces 3TB hard drives that, according to Apple, "fall under certain conditions." The service will be performed at your local apple Store or at a nearby Apple Authorized Service Provider.
According to the Replacement Program website, Apple has contacted iMac owners who registered their iMac with a valid email address. If you did not register, you can check if your iMac is eligible by entering the serial number on the Replacement Program website.
The 3TB hard drive was a custom option for the 27-inch iMac. It was not part of the standard configuration. These iMacs were among the first to feature the new thin design.