Index: uspace/app/mkfat/mkfat.c
===================================================================
--- uspace/app/mkfat/mkfat.c	(revision dccf72146c31b468c546d35ed8f671e5e26cda76)
+++ uspace/app/mkfat/mkfat.c	(revision 08232eec7477aa13695d471714768b19b5d6d270)
@@ -93,4 +93,5 @@
 	size_t block_size;
 	char *endptr;
+	bn_t dev_nblocks;
 
 	cfg.total_sectors = 0;
@@ -144,4 +145,12 @@
 		printf(NAME ": Error determining device block size.\n");
 		return 2;
+	}
+
+	rc = block_get_nblocks(handle, &dev_nblocks);
+	if (rc != EOK) {
+		printf(NAME ": Warning, failed to obtain block device size.\n");
+	} else {
+		printf(NAME ": Block device has %llu blocks.\n", dev_nblocks);
+		cfg.total_sectors = dev_nblocks;
 	}
 
@@ -240,5 +249,4 @@
 	}
 
-	printf("fat_sectors=%d\n", par->fat_sectors);
 	/* File allocation tables */
 	for (i = 0; i < fat_count; ++i) {
