We present here for the first time a unifying perspective for the lack of equipartition in non-linear ordered systems and the low temperature phase-space fragmentation in disordered systems. We demonstrate that they are just two manifestation of the same underlying phenomenon: ergodicity breaking. Inspired by recent experiments, suggesting that lasing in optically active disordered media is related to an ergodicity-breaking transition, we studied numerically a statistical mechanics model for the nonlinearly coupled light modes in a disordered medium under external pumping. Their collective behavior appears to be akin to the one displayed around the ergodicity-breaking transition in glasses, as we show measuring the glass order parameter of the replica-symmetry-breaking theory. Most remarkably, we also find that at the same critical point a breakdown of energy equipartition among light modes occurs, the typical signature of ergodicity breaking in non-linear systems as the celebrated Fermi-Pasta-Ulam model. The crucial ingredient of our system which allows us to find equipartition breakdown together with replica symmetry breaking is that the amplitudes of light modes are locally unbounded, i.e., they are only subject to a global constraint. The physics of random lasers appears thus as a unique test-bed to develop under a unifying perspective the study of ergodicity breaking in statistical disordered systems and non-linear ordered ones.