A tracking controller includes a tracking error detecting section and a tracking control section. The tracking error detecting section generates and outputs a tracking error signal that represents how much the focal point of a light beam has shifted from a target track on a storage medium. The tracking control section generates a drive signal in response to the tracking error signal so as to move the light beam such that the focal point of the light beam is located right on the target track. The gain of at least one of the tracking error signal and the drive signal is switched depending on whether or not the focal point of the light beam is located on a recorded area of the storage medium on which data has already been written.