The following code is used to format the NameNode:
cd /opt/Hadoop/Hadoop/bin hadoop -namenode -format