Datanodes can store blocks in multiple directories typically allocated on different local disk drives. In order to setup multiple directories, one needs to specifiy a comma-separated list of pathnames as values under config parameters dfs.data.dir/dfs.datanode.data.dir. Datanodes will attempt to place equal amount of data in each of directories.
Namenode also supports multiple directories, which in the case store the name space image and edit logs. In order to setup multiple directories one needs to specify a comma-separated list of pathnames as values under config parameters dfs.name.dir/dfs.namenode.data.dir .
The namenode directories ae used for the namespace data replication so that image and log could be restored from the remaining disks/volumes if one of the disks fails.
Hope it will answer your query to some extent.