Index: uspace/app/mkext4/mkext4.c
===================================================================
--- uspace/app/mkext4/mkext4.c	(revision 174156fd1cf321a6363777352073d05829467b2f)
+++ uspace/app/mkext4/mkext4.c	(revision 21751785b96d50c71310a8d9b941dda5399bd88a)
@@ -45,4 +45,5 @@
 
 static void syntax_print(void);
+static errno_t ext4_version_parse(const char *, ext4_cfg_ver_t *);
 
 int main(int argc, char **argv)
@@ -51,7 +52,10 @@
 	char *dev_path;
 	service_id_t service_id;
+	ext4_cfg_ver_t ver;
 	char *endptr;
 	aoff64_t nblocks;
 	char *label;
+
+	ver = ext4_def_fs_version;
 
 	if (argc < 2) {
@@ -76,4 +80,24 @@
 			nblocks = strtol(*argv, &endptr, 10);
 			if (*endptr != '\0') {
+				printf(NAME ": Error, invalid argument.\n");
+				syntax_print();
+				return 1;
+			}
+
+			--argc;
+			++argv;
+		}
+
+		if (str_cmp(*argv, "--type") == 0) {
+			--argc;
+			++argv;
+			if (*argv == NULL) {
+				printf(NAME ": Error, argument missing.\n");
+				syntax_print();
+				return 1;
+			}
+
+			rc = ext4_version_parse(*argv, &ver);
+			if (rc != EOK) {
 				printf(NAME ": Error, invalid argument.\n");
 				syntax_print();
@@ -125,5 +149,5 @@
 	(void) nblocks;
 
-	rc = ext4_filesystem_create(service_id);
+	rc = ext4_filesystem_create(ver, service_id);
 	if (rc != EOK) {
 		printf(NAME ": Error initializing file system.\n");
@@ -141,5 +165,21 @@
 	printf("options:\n"
 	    "\t--size <sectors> Filesystem size, overrides device size\n"
-	    "\t--label <label>  Volume label\n");
+	    "\t--label <label>  Volume label\n"
+	    "\t--type <fstype>  Filesystem type (ext2, ext2old)\n");
+}
+
+static errno_t ext4_version_parse(const char *str, ext4_cfg_ver_t *ver)
+{
+	if (str_cmp(str, "ext2old") == 0) {
+		*ver = extver_ext2_old;
+		return EOK;
+	}
+
+	if (str_cmp(str, "ext2") == 0) {
+		*ver = extver_ext2;
+		return EOK;
+	}
+
+	return EINVAL;
 }
 
Index: uspace/lib/ext4/include/ext4/cfg.h
===================================================================
--- uspace/lib/ext4/include/ext4/cfg.h	(revision 21751785b96d50c71310a8d9b941dda5399bd88a)
+++ uspace/lib/ext4/include/ext4/cfg.h	(revision 21751785b96d50c71310a8d9b941dda5399bd88a)
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2018 Jiri Svoboda
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup libext4
+ * @{
+ */
+
+#ifndef LIBEXT4_CFG_H_
+#define LIBEXT4_CFG_H_
+
+/** Versions available to choose from when creating a new file system. */
+typedef enum {
+	/** Ext2 original */
+	extver_ext2_old,
+	/** Ext2 dynamic revision */
+	extver_ext2
+} ext4_cfg_ver_t;
+
+/** Default file system version */
+#define ext4_def_fs_version extver_ext2
+
+#endif
+
+/**
+ * @}
+ */
Index: uspace/lib/ext4/include/ext4/filesystem.h
===================================================================
--- uspace/lib/ext4/include/ext4/filesystem.h	(revision 174156fd1cf321a6363777352073d05829467b2f)
+++ uspace/lib/ext4/include/ext4/filesystem.h	(revision 21751785b96d50c71310a8d9b941dda5399bd88a)
@@ -37,9 +37,10 @@
 
 #include <block.h>
+#include "ext4/cfg.h"
 #include "ext4/fstypes.h"
 #include "ext4/types.h"
 
 extern errno_t ext4_filesystem_probe(service_id_t);
-extern errno_t ext4_filesystem_create(service_id_t);
+extern errno_t ext4_filesystem_create(ext4_cfg_ver_t, service_id_t);
 extern errno_t ext4_filesystem_open(ext4_instance_t *, service_id_t,
     enum cache_mode, aoff64_t *, ext4_filesystem_t **);
Index: uspace/lib/ext4/include/ext4/superblock.h
===================================================================
--- uspace/lib/ext4/include/ext4/superblock.h	(revision 174156fd1cf321a6363777352073d05829467b2f)
+++ uspace/lib/ext4/include/ext4/superblock.h	(revision 21751785b96d50c71310a8d9b941dda5399bd88a)
@@ -39,4 +39,5 @@
 #include <stdint.h>
 #include <uuid.h>
+#include "ext4/cfg.h"
 #include "ext4/types.h"
 
@@ -164,5 +165,6 @@
 extern uint32_t ext4_superblock_get_inodes_in_group(ext4_superblock_t *,
     uint32_t);
-extern errno_t ext4_superblock_create(size_t, uint64_t, ext4_superblock_t **);
+extern errno_t ext4_superblock_create(size_t, uint64_t, ext4_cfg_ver_t,
+    ext4_superblock_t **);
 extern uint32_t ext4_superblock_get_group_backup_blocks(ext4_superblock_t *,
     uint32_t);
Index: uspace/lib/ext4/src/directory.c
===================================================================
--- uspace/lib/ext4/src/directory.c	(revision 174156fd1cf321a6363777352073d05829467b2f)
+++ uspace/lib/ext4/src/directory.c	(revision 21751785b96d50c71310a8d9b941dda5399bd88a)
@@ -369,5 +369,8 @@
 
 	/* Set type of entry */
-	if (ext4_inode_is_type(sb, child->inode, EXT4_INODE_MODE_DIRECTORY))
+	if (!ext4_superblock_has_feature_incompatible(sb, EXT4_FEATURE_INCOMPAT_FILETYPE))
+		ext4_directory_entry_ll_set_inode_type(sb, entry,
+		    EXT4_DIRECTORY_FILETYPE_UNKNOWN);
+	else if (ext4_inode_is_type(sb, child->inode, EXT4_INODE_MODE_DIRECTORY))
 		ext4_directory_entry_ll_set_inode_type(sb, entry,
 		    EXT4_DIRECTORY_FILETYPE_DIR);
Index: uspace/lib/ext4/src/filesystem.c
===================================================================
--- uspace/lib/ext4/src/filesystem.c	(revision 174156fd1cf321a6363777352073d05829467b2f)
+++ uspace/lib/ext4/src/filesystem.c	(revision 21751785b96d50c71310a8d9b941dda5399bd88a)
@@ -48,4 +48,5 @@
 #include "ext4/bitmap.h"
 #include "ext4/block_group.h"
+#include "ext4/cfg.h"
 #include "ext4/directory.h"
 #include "ext4/extent.h"
@@ -248,7 +249,8 @@
 /** Create new filesystem.
  *
+ * @param ver Filesystem version
  * @param service_id Block device where to create new filesystem
  */
-errno_t ext4_filesystem_create(service_id_t service_id)
+errno_t ext4_filesystem_create(ext4_cfg_ver_t ver, service_id_t service_id)
 {
 	errno_t rc;
@@ -280,5 +282,5 @@
 
 	/* Create superblock */
-	rc = ext4_superblock_create(dev_bsize, dev_nblocks, &superblock);
+	rc = ext4_superblock_create(dev_bsize, dev_nblocks, ver, &superblock);
 	if (rc != EOK)
 		goto err;
Index: uspace/lib/ext4/src/superblock.c
===================================================================
--- uspace/lib/ext4/src/superblock.c	(revision 174156fd1cf321a6363777352073d05829467b2f)
+++ uspace/lib/ext4/src/superblock.c	(revision 21751785b96d50c71310a8d9b941dda5399bd88a)
@@ -45,4 +45,5 @@
 #include <stdlib.h>
 #include <time.h>
+#include "ext4/cfg.h"
 #include "ext4/superblock.h"
 
@@ -1454,9 +1455,10 @@
  * @param dev_bsize Device block size
  * @param dev_bcnt Device number of blocks
+ * @param ver Filesystem version
  * @param rsb Place to store pointer to newly allocated superblock
  * @return EOK on success or error code
  */
 errno_t ext4_superblock_create(size_t dev_bsize, uint64_t dev_bcnt,
-    ext4_superblock_t **rsb)
+    ext4_cfg_ver_t ver, ext4_superblock_t **rsb)
 {
 	ext4_superblock_t *sb;
@@ -1557,25 +1559,30 @@
 	ext4_superblock_set_check_interval(sb, 0);
 	ext4_superblock_set_creator_os(sb, EXT4_SUPERBLOCK_OS_LINUX);
-	ext4_superblock_set_rev_level(sb, EXT4_GOOD_OLD_REV);
+	if (ver >= extver_ext2)
+		ext4_superblock_set_rev_level(sb, EXT4_DYNAMIC_REV);
+	else
+		ext4_superblock_set_rev_level(sb, EXT4_GOOD_OLD_REV);
 	ext4_superblock_set_def_resuid(sb, 0);
 	ext4_superblock_set_def_resgid(sb, 0);
+
+	if (ver >= extver_ext2) {
+		/* Dynamic rev */
+		ext4_superblock_set_first_inode(sb, EXT4_REV0_FIRST_INO);
+		ext4_superblock_set_inode_size(sb, EXT4_REV0_INODE_SIZE);
+		ext4_superblock_set_block_group_index(sb, 0); // XXX
+		ext4_superblock_set_features_compatible(sb, 0);
+		ext4_superblock_set_features_incompatible(sb, 0);
+		ext4_superblock_set_features_read_only(sb, 0);
+
+		ext4_superblock_set_uuid(sb, &uuid);
+		/* 16-byte Latin-1 string padded with null characters */
+		ext4_superblock_set_volume_name(sb, "HelenOS-Ext4\0\0\0\0");
+		/* 64-byte Latin-1 string padded with null characters */
+		ext4_superblock_set_last_mounted(sb,
+		    "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+		    "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0");
+		sb->algorithm_usage_bitmap = 0;
+	}
 #if 0
-	/* Dynamic rev */
-	ext4_superblock_set_first_inode(sb, EXT4_REV0_FIRST_INO);
-	ext4_superblock_set_inode_size(sb, EXT4_REV0_INODE_SIZE);
-	ext4_superblock_set_block_group_index(sb, 0); // XXX
-	ext4_superblock_set_features_compatible(sb, 0);
-	ext4_superblock_set_features_incompatible(sb, 0);
-	ext4_superblock_set_features_read_only(sb, 0);
-
-	ext4_superblock_set_uuid(sb, &uuid);
-	/* 16-byte Latin-1 string padded with null characters */
-	ext4_superblock_set_volume_name(sb, "HelenOS-Ext4\0\0\0\0");
-	/* 64-byte Latin-1 string padded with null characters */
-	ext4_superblock_set_last_mounted(sb,
-	    "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
-	    "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0");
-	sb->algorithm_usage_bitmap = 0;
-
 	/* Journalling */
 	ext4_superblock_set_desc_size(sb, EXT4_MAX_BLOCK_GROUP_DESCRIPTOR_SIZE);
