Index: uspace/app/mkexfat/mkexfat.c
===================================================================
--- uspace/app/mkexfat/mkexfat.c	(revision e89a06a6551f1dacee7bb5fa05a9eaa8901612d6)
+++ uspace/app/mkexfat/mkexfat.c	(revision 87337dc52aa5f13830c6e760d834e32ad660f9e8)
@@ -46,4 +46,5 @@
 #include <byteorder.h>
 #include <align.h>
+#include <rndgen.h>
 #include <str.h>
 #include <getopt.h>
@@ -243,9 +244,28 @@
  * @param mbs Pointer to the Main Boot Sector structure.
  * @param cfg Pointer to the exFAT configuration structure.
- * @return    Initial checksum value.
+ * @param chksum Place to store initial checksum value.
+ * @return EOK on success or error code
  */
 static uint32_t
-vbr_initialize(exfat_bs_t *mbs, exfat_cfg_t *cfg)
-{
+vbr_initialize(exfat_bs_t *mbs, exfat_cfg_t *cfg, uint32_t *chksum)
+{
+	rndgen_t *rndgen;
+	errno_t rc;
+	uint32_t vsn;
+
+	/* Generate volume serial number */
+
+	rc = rndgen_create(&rndgen);
+	if (rc != EOK)
+		return rc;
+
+	rc = rndgen_uint32(rndgen, &vsn);
+	if (rc != EOK) {
+		rndgen_destroy(rndgen);
+		return rc;
+	}
+
+	rndgen_destroy(rndgen);
+
 	/* Fill the structure with zeroes */
 	memset(mbs, 0, sizeof(exfat_bs_t));
@@ -268,5 +288,5 @@
 
 	mbs->rootdir_cluster = host2uint32_t_le(cfg->rootdir_cluster);
-	mbs->volume_serial = host2uint32_t_le(0xe1028172);
+	mbs->volume_serial = host2uint32_t_le(vsn);
 	mbs->version.major = 1;
 	mbs->version.minor = 0;
@@ -283,5 +303,6 @@
 	mbs->signature = host2uint16_t_le(0xAA55);
 
-	return vbr_checksum_start(mbs, sizeof(exfat_bs_t));
+	*chksum = vbr_checksum_start(mbs, sizeof(exfat_bs_t));
+	return EOK;
 }
 
@@ -299,5 +320,7 @@
 		return ENOMEM;
 
-	vbr_checksum = vbr_initialize(&mbs, cfg);
+	rc = vbr_initialize(&mbs, cfg, &vbr_checksum);
+	if (rc != EOK)
+		goto exit;
 
 	/* Write the Main Boot Sector to disk */
Index: uspace/app/mkfat/mkfat.c
===================================================================
--- uspace/app/mkfat/mkfat.c	(revision e89a06a6551f1dacee7bb5fa05a9eaa8901612d6)
+++ uspace/app/mkfat/mkfat.c	(revision 87337dc52aa5f13830c6e760d834e32ad660f9e8)
@@ -48,4 +48,5 @@
 #include <inttypes.h>
 #include <errno.h>
+#include <rndgen.h>
 #include <str.h>
 #include "fat.h"
@@ -89,5 +90,5 @@
 static errno_t fat_params_compute(struct fat_cfg *cfg);
 static errno_t fat_blocks_write(struct fat_cfg const *cfg, service_id_t service_id);
-static void fat_bootsec_create(struct fat_cfg const *cfg, struct fat_bs *bs);
+static errno_t fat_bootsec_create(struct fat_cfg const *cfg, struct fat_bs *bs);
 
 int main(int argc, char **argv)
@@ -376,5 +377,7 @@
 	fat_dentry_t *de;
 
-	fat_bootsec_create(cfg, &bs);
+	rc = fat_bootsec_create(cfg, &bs);
+	if (rc != EOK)
+		return rc;
 
 	rc = block_write_direct(service_id, BS_BLOCK, 1, &bs);
@@ -442,6 +445,6 @@
 			(void) fat_label_encode(&de->name, cfg->label);
 			de->attr = FAT_ATTR_VOLLABEL;
-			de->mtime = 0x1234;
-			de->mdate = 0x1234;
+			de->mtime = 0x1234; // XXX Proper time
+			de->mdate = 0x1234; // XXX Proper date
 		} else if (idx == 1) {
 			/* Clear volume label entry */
@@ -462,7 +465,23 @@
 
 /** Construct boot sector with the given parameters. */
-static void fat_bootsec_create(struct fat_cfg const *cfg, struct fat_bs *bs)
+static errno_t fat_bootsec_create(struct fat_cfg const *cfg, struct fat_bs *bs)
 {
 	const char *bs_label;
+	rndgen_t *rndgen;
+	uint32_t vsn;
+	errno_t rc;
+
+	/* Generate a volume serial number */
+	rc = rndgen_create(&rndgen);
+	if (rc != EOK)
+		return rc;
+
+	rc = rndgen_uint32(rndgen, &vsn);
+	if (rc != EOK) {
+		rndgen_destroy(rndgen);
+		return rc;
+	}
+
+	rndgen_destroy(rndgen);
 
 	/*
@@ -503,4 +522,5 @@
 	bs->hidden_sec = host2uint32_t_le(0);
 
+
 	if (cfg->fat_type == FAT32) {
 		bs->sec_per_fat = 0;
@@ -509,5 +529,5 @@
 		bs->fat32.pdn = 0x80;
 		bs->fat32.ebs = 0x29;
-		bs->fat32.id = host2uint32_t_be(0x12345678);
+		bs->fat32.id = host2uint32_t_be(vsn);
 		bs->fat32.root_cluster = 2;
 
@@ -518,5 +538,5 @@
 		bs->pdn = 0x80;
 		bs->ebs = 0x29;
-		bs->id = host2uint32_t_be(0x12345678);
+		bs->id = host2uint32_t_be(vsn);
 
 		(void) fat_label_encode(&bs->label, bs_label);
@@ -526,4 +546,6 @@
 			memcpy(bs->type, "FAT16   ", 8);
 	}
+
+	return EOK;
 }
 
