Provided are a method, system, and program for encoding data onto a
storage medium. Host data is received and a plurality of device blocks
are generated to include the host data. A directory is generated
including entries for physical locations on the storage medium, wherein
each entry identifies one device block at the physical location
corresponding to the entry, and wherein the directory is used to access
data on the storage medium. The directory entries are encoded in the
device blocks written to the storage medium.