A method of controlling a disk drive is disclosed that is capable of
precise and real-time detection of an abnormal floating height of a
magnetic head over an entire area of a magnetic disk. The method of
controlling the disk drive includes the steps of: calculating a servo
gain difference between a servo gain value obtained from a servo frame of
the disk drive and a normal servo gain value recorded in the servo frame,
the normal servo gain value being a servo gain value when a magnetic head
flies normally relative to a magnetic disk; and forbidding the magnetic
head writing data into the magnetic disk when the servo gain difference
is equal to or greater than a predetermined value.