In this work we propose a novel fully distributed approach to endow robots in a swarm with awareness of their relative position with respect to the rest of the swarm. Such spatial awareness can be used to support spatially differentiated task allocation or for pattern formation. In particular, we aim to partition the robots in the swarm in two (or more) distinct and spatially segregated groups. The distributed approach we propose only relies on local wireless communications and is based on a combination of distributed consensus and load balancing. We propose two metrics to measure the effectiveness of the obtained partitioning and we test the performance and the scalability of our algorithm in extensive simulation experiments. We also validate it in a small set of experiments with real robots.