When i add a path to path.data,the exist shards unassign

i have 2 shard on each node.but, i found i can not to _optimize the index ,because the is no enough space.so, i try to add a path to path.data.when i restart the elasticsearch,all shards are unassign.how can i do now?