Disk Utility won't Unmount HD for formatting
You can force unmount a drive by running the following Terminal command:

diskutil unmountDisk force /Volumes/VOLUMENAME


Replace VOLUMENAME with the name of a volume on the disk you are trying to unmount.

Following this, attempt to Erase/Partition the drive again in Disk Utility. Using the above command can interrupt file read/writes, which can cause file corruption. However, since you are erasing the drive anyway, this doesn't really matter in your situation.