Shouldn't the second part of this loop be done outside of the loop? That way we do it only once instead of once per block device.