A novel partitioning approach for linear switching large-scale systems is presented. We assume that the modes of the switching system are unknown a priori but can be detected. We propose an online partitioning scheme that can partition the system when the mode switches, thus adapting the partition to the mode. Moreover, after the system has been partitioned, we apply a decentralized state-feedback control scheme to stabilize the system. We also apply a dwell time stability scheme to prove that the closed-loop system remains stable even after both the mode and partition changes. The proposed approach is illustrated by means of an automatic generation control problem related to frequency deviation regulation in a large-scale power network.