I referred to these questions Name node is in safe mode. Not able to leave and SafeModeException : Name node is in safe mode.
the commands i have executed is below
it shows that the safe mode is off but the immediate next command shows name node is in safe mode.
and ls /root is shown below
how to fix it ??

