Index: uspace/app/mkexfat/mkexfat.c
===================================================================
--- uspace/app/mkexfat/mkexfat.c	(revision 69f9cf5a88707116e18be597ca03b55bb3bc6d5f)
+++ uspace/app/mkexfat/mkexfat.c	(revision 557e5b13486a9739bd9342a51481d04e8d7448db)
@@ -84,4 +84,5 @@
 	unsigned long data_start_sector;
 	unsigned long rootdir_cluster;
+	unsigned long upcase_table_cluster;
 	unsigned long total_clusters;
 	unsigned long allocated_clusters;
@@ -216,5 +217,5 @@
 	    div_round_up(cfg->data_start_sector, cfg->cluster_size));
 
-	mbs->rootdir_cluster = 0;
+	mbs->rootdir_cluster = host2uint32_t_le(cfg->rootdir_cluster);
 	mbs->volume_serial = 0;
 	mbs->version.major = 1;
@@ -573,20 +574,7 @@
 	cfg_print_info(&cfg);
 
-	rc = bootsec_write(service_id, &cfg);
-	if (rc != EOK) {
-		printf(NAME ": Error, failed to write the VBR to disk\n");
-		return 2;
-	}
-
 	rc = fat_initialize(service_id, &cfg);
 	if (rc != EOK) {
 		printf(NAME ": Error, failed to write the FAT to disk\n");
-		return 2;
-	}
-
-	rc = bitmap_write(service_id, &cfg);
-	if (rc != EOK) {
-		printf(NAME ": Error, failed to write the allocation" \
-		    " bitmap to disk.\n");
 		return 2;
 	}
@@ -602,4 +590,5 @@
 	next_cls = FIRST_FREE_CLUSTER +
 	    div_round_up(cfg.bitmap_size, cfg.cluster_size);
+	cfg.upcase_table_cluster = next_cls;
 
 	/* Allocate clusters for the upcase table */
@@ -621,4 +610,17 @@
 	}
 
+	rc = bitmap_write(service_id, &cfg);
+	if (rc != EOK) {
+		printf(NAME ": Error, failed to write the allocation" \
+		    " bitmap to disk.\n");
+		return 2;
+	}
+
+	rc = bootsec_write(service_id, &cfg);
+	if (rc != EOK) {
+		printf(NAME ": Error, failed to write the VBR to disk\n");
+		return 2;
+	}
+
 	return 0;
 }
