Index: src/main/java/org/apache/hadoop/hbase/master/MasterFileSystem.java =================================================================== --- src/main/java/org/apache/hadoop/hbase/master/MasterFileSystem.java (revision 1163742) +++ src/main/java/org/apache/hadoop/hbase/master/MasterFileSystem.java (working copy) @@ -324,6 +324,12 @@ if (!FSUtils.rootRegionExists(fs, rd)) { bootstrap(rd, c); } + // Create META and ROOT tableInfo if required. + if (!FSUtils.rootTableInfoExists(fs, rd)) { + FSUtils.createTableDescriptor(HTableDescriptor.ROOT_TABLEDESC, this.conf); + FSUtils.createTableDescriptor(HTableDescriptor.META_TABLEDESC, this.conf); + } + return rd; } Index: src/main/java/org/apache/hadoop/hbase/util/FSUtils.java =================================================================== --- src/main/java/org/apache/hadoop/hbase/util/FSUtils.java (revision 1163742) +++ src/main/java/org/apache/hadoop/hbase/util/FSUtils.java (working copy) @@ -490,6 +490,19 @@ return fs.exists(rootRegionDir); } + /** + * Checks if .tableinfo exists for root region + * + * @param fs file system + * @param rootdir root directory of HBase installation + * @return true if exists + * @throws IOException + */ + public static boolean rootTableInfoExists(FileSystem fs, Path rootdir) + throws IOException { + Path tablePath = getTableInfoPath(rootdir, "-ROOT-"); + return fs.exists(tablePath); + } /** * Compute HDFS blocks distribution of a given file, or a portion of the file