Question: I found the question
[Where HDFS stores files locally by default?](https://stackoverflow.com/questions/2358402/where-hdfs-stores-files-locally-by-default).

My HDFS store data in /tmp/ folder which is deleted by system. 

I want to change **where HDFS stores files locally** .

I am looking in hdfs-default.xml but cannot find dfs.data.dir 

Run `bin/hadoop version`

```
Hadoop 2.8.2
Subversion https://git-wip-us.apache.org/repos/asf/hadoop.git -r 66c47f2a01ad9637879e95f80c41f798373828fb
Compiled by jdu on 2017-10-19T20:39Z
Compiled with protoc 2.5.0
From source with checksum dce55e5afe30c210816b39b631a53b1d
This command was run using /usr/local/hadoop/share/hadoop/common/hadoop-common-2.8.2.jar

```

**Edit**   

I want to know detail that:   

Which file and how should I edit to change HDFS stores files locally ?

Answer: 
Look for `dfs.datanode.data.dir`. Docs here - <http://hadoop.apache.org/docs/r2.8.2/hadoop-project-dist/hadoop-hdfs/hdfs-default.xml>
When you first extracted your hadoop, hdfs-site.xml is present in $HADOOP\_HOME/etc/hadoop and is empty by default. You can add the following configuration to your hdfs-site.xml to change your local store location:

```
<property> 
      <name>dfs.data.dir</name> 
      <value>path_to_dir</value> 
</property> 

<property> 
      <name>dfs.name.dir</name> 
      <value>path_to_dir</value> 
</property> 

```