A host device is coupled to a peripheral device such as a multi media card
or the like, where the peripheral device includes a solid state data
storage segment. The peripheral device has means for initiating a
defragmentation function, such as registers for comparing a current
performance measure against a threshold performance metric, or block
validity parameters received form the host device for the data storage
segment of the peripheral device. Once met, the means for initiating
cause a defragmentation function to execute on the data storage segment.
A logical layer of the data storage segment is accessed by the host
device and a physical layer of the data storage segment is accessed by
the peripheral device. The defragmentation program may be resident on
either the host or peripheral device. Defragmentation may be enabled to
execute automatically once initiated, such as by a continuous or periodic
background scan of current performance of the data storage segment.