A new vibration-based mechanism of optical frequency/wavelength sweeping in fiber lasers induced by optical path length modulation of a laser cavity section is proposed. The mechanism is implemented for an erbium-doped fiber ring laser with a saturable absorber. Without the vibrations, the laser generates a single longitudinal mode (SLM) radiation. We show experimentally for the first time that mechanical vibrations of the laser cavity section can lead to mode dynamics in both frequency and time domains. The possibility of obtaining various mode dynamics, such as vibration-induced sweeping in a wavelength range of up to 2.2 nm or SLM generation with periodic mode hopping between two fixed longitudinal modes depending on the pump wavelength, is experimentally shown. In this vibration-based approach, the interval between changes in the laser cavity modes has good stability, because it directly relates to the vibration period.