This letter characterizes the optimal policy for minimizing the bandwidth use and the number of required connections between nodes for repairing losses in scenarios that use the Internet of Things (IoT) devices for distributed storage. In particular, we consider the problem of a system that will not receive replacement nodes to compensate for node losses and analyze the problem considering a lead node, which coordinates the repair process. We show that the optimal strategy can be computed with a low-complexity, Viterbi-like algorithm. Our numerical results show that the proposed optimal scheme not only achieves the minimum bandwidth use for the problem, but also reduces the number of IoT device-to-device connections from O(s^2) to O(s) for s remaining nodes, compared to using no leader for coordination.