HDFS Offline Image Viewer Tool – oiv 3

Usually fsimage files, which contain file system namespace on namenodes are not human-readable. So, Hadoop provided HDFS Offline Image viewer in hadoop-2.0.4 release to view the fsimage contents in readable format.

This is completely offline in its functionality and doesn’t require HDFS cluster to be running. It can easily process very large fsimage files quickly and present in required output format.

HDFS Offline Image Viewer:

Syntax for this command:

Here Options are processing options which decide the output format and these are not mandatory.  Default processing option is lsr -style output format. 

It supports other output processing formats as well, as listed in below screen.

Other two important processing options are Indented ( Uses levels of indentation to delineate the sections within the file) and XML format (Creates an XML document with all elements of the fsimage enumerated).

By default oiv tool overwrites the output files If they already exist.

Basic Usage:

1. Actual HDFS file system directory structure listed by fs -lsr command.

2. Using oiv tool to view fsimage file in -lsr format. Input file directory is mentioned in -i option and output directory location is mentioned in -o option.

The output file fsimage.txt is created in $HOME directory looks like below.

Thus the output of oiv tool is similar to lsr -style output.

XML Format:

The output file can be created in .xml format also so that it will be suitable for further analysis by XML tools.

Syntax for Usage of XML processing option:

Example usage and output file screen shots are provided below.

Output format looks like below.

Indented Format:

This indented format is used to delineate the section of input fsimage file into separate levels of indentation. Usually this will created in .txt file extension.

Syntax for indented format is

Example usage of indented option is shown below.

The output of indented format looks like as shown below

One of the another important option is -skipBlocks which skips inode’s blocks information and significantly decreases output and increases speed in case of large image files.

Profile photo of Siva

About Siva

Senior Hadoop developer with 4 years of experience in designing and architecture solutions for the Big Data domain and has been involved with several complex engagements. Technical strengths include Hadoop, YARN, Mapreduce, Hive, Sqoop, Flume, Pig, HBase, Phoenix, Oozie, Falcon, Kafka, Storm, Spark, MySQL and Java.

Leave a comment

Your email address will not be published. Required fields are marked *

Review Comments
default image

I am a plsql developer. Intrested to move into bigdata.

Neetika Singh ITA Hadoop in Dec/2016 December 22, 2016