private void createInitialFileSystemLayout() throws IOException {
    final String[] protectedSubDirs =
      new String[] { HConstants.BASE_NAMESPACE_DIR, HConstants.HFILE_ARCHIVE_DIRECTORY,
        HConstants.HBCK_SIDELINEDIR_NAME, MobConstants.MOB_DIR_NAME };

    // With the introduction of RegionProcedureStore,
    // there's no need to create MasterProcWAL dir here anymore. See HBASE-23715
    final String[] protectedSubLogDirs =
      new String[] { HConstants.HREGION_LOGDIR_NAME, HConstants.HREGION_OLDLOGDIR_NAME,
        HConstants.CORRUPT_DIR_NAME, ReplicationUtils.REMOTE_WAL_DIR_NAME };
    // check if the root directory exists
    checkRootDir(this.rootdir, conf, this.fs);

    // Check the directories under rootdir.
    checkTempDir(this.tempdir, conf, this.fs);
    for (String subDir : protectedSubDirs) {
      checkSubDir(new Path(this.rootdir, subDir), HBASE_DIR_PERMS);
    }

    final String perms;
    if (!this.walRootDir.equals(this.rootdir)) {
      perms = HBASE_WAL_DIR_PERMS;
    } else {
      perms = HBASE_DIR_PERMS;
    }
    for (String subDir : protectedSubLogDirs) {
      checkSubDir(new Path(this.walRootDir, subDir), perms);
    }

    checkStagingDir();

    // Handle the last few special files and set the final rootDir permissions
    // rootDir needs 'x' for all to support bulk load staging dir
    if (isSecurityEnabled) {
      fs.setPermission(new Path(rootdir, HConstants.VERSION_FILE_NAME), secureRootFilePerms);
      fs.setPermission(new Path(rootdir, HConstants.CLUSTER_ID_FILE_NAME), secureRootFilePerms);
    }
    FsPermission currentRootPerms = fs.getFileStatus(this.rootdir).getPermission();
    if (
      !currentRootPerms.getUserAction().implies(FsAction.EXECUTE)
        || !currentRootPerms.getGroupAction().implies(FsAction.EXECUTE)
        || !currentRootPerms.getOtherAction().implies(FsAction.EXECUTE)
    ) {
      LOG.warn("rootdir permissions do not contain 'excute' for user, group or other. "
        + "Automatically adding 'excute' permission for all");
      fs.setPermission(this.rootdir,
        new FsPermission(currentRootPerms.getUserAction().or(FsAction.EXECUTE),
          currentRootPerms.getGroupAction().or(FsAction.EXECUTE),
          currentRootPerms.getOtherAction().or(FsAction.EXECUTE)));
    }
  }
Create initial layout in filesystem.
<ol>
<li>Check if the meta region exists and is readable, if not create it. Create hbase.version and
the hbase:meta directory if not one.</li>
</ol>
Idempotent.
hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterFileSystem.java