The servo control in a hard disk drive (HDD) system relies heavily on the position information obtained from the servo sectors. As the tracks-per-inch (TPI) gets higher and higher in HDDs, writing of servo sectors takes a longer and longer time. One way to solve this problem is to use servo track writers to write spiral servo patterns on the disks and then perform self servo writing (SSW) within each HDD unit. The quality of the spirals is the key to achieve high TPI in SSW. This paper discusses high precision tracking control algorithms for the writing of spiral servo patterns. An iterative learning scheme is introduced, which combines a disturbance observer with the zero phase error tracking algorithm, and develops a new way of designing asymptotically optimal feedforward inputs for a general two degree of freedom control systems. In learning control schemes, non-repetitive disturbances have an adverse influence on the tracking performance. The paper analyzes this situation, and develops a robust learning scheme to deal with the problem.