A disk drive is disclosed comprising a disk, an actuator arm, a head
coupled to the actuator arm, a base, and an optical sensor operable to
detect a position of the actuator arm. The optical sensor comprises a
light source that is stationary relative to the base, a plurality of
light sensitive sensors positioned to receive light from the light
source, and a substantially opaque element positioned between the light
source and the light sensitive sensors configured to control an amount of
light at least one of the plurality of light sensitive sensors detects
relative to the position of the actuator arm.