Formation and dynamics of structural defects in ion chains