@Slimani Ibrahim
It's not recommended to format the NameNode more than once except when NameNode loses metadata information.
The reason could be this property which tells NameNode where to store its metadata information on disk is dfs.namenode.name.dir in your case its points to /tmp, so every time you restart your system the /tmp directory gets flushed and hence you have to format the NameNode again.
So, make sure you point the property dfs.namenode.name.dir to a more persistent location
(something like /hadoop/hdfs/namenode similar for datanode property/hadoop/hdfs/datanode) which does not get's cleared every time if you restart your system that will resolve this problem.
I hope that the above answers your questions. Please accept the answer you found most useful.