Index: uspace/srv/fs/fat/fat_fat.c
===================================================================
--- uspace/srv/fs/fat/fat_fat.c	(revision ccce242372aca2c29042948b947afb9cb1fc3631)
+++ uspace/srv/fs/fat/fat_fat.c	(revision 711e1f32ff29817726bcac1317d5d28bdaabac90)
@@ -247,10 +247,11 @@
  */
 int
-fat_get_cluster(fat_bs_t *bs, dev_handle_t dev_handle, fat_cluster_t clst,
-    fat_cluster_t *value)
+fat_get_cluster(fat_bs_t *bs, dev_handle_t dev_handle, unsigned fatno,
+    fat_cluster_t clst, fat_cluster_t *value)
 {
 	block_t *b;
 	uint16_t bps;
 	uint16_t rscnt;
+	uint16_t sf;
 	fat_cluster_t *cp;
 	int rc;
@@ -258,6 +259,7 @@
 	bps = uint16_t_le2host(bs->bps);
 	rscnt = uint16_t_le2host(bs->rscnt);
-
-	rc = block_get(&b, dev_handle, rscnt +
+	sf = uint16_t_le2host(bs->sec_per_fat);
+
+	rc = block_get(&b, dev_handle, rscnt + sf * fatno +
 	    (clst * sizeof(fat_cluster_t)) / bps, BLOCK_FLAGS_NONE);
 	if (rc != EOK)
@@ -480,5 +482,5 @@
 	while (firstc < FAT_CLST_LAST1) {
 		assert(firstc >= FAT_CLST_FIRST && firstc < FAT_CLST_BAD);
-		rc = fat_get_cluster(bs, dev_handle, firstc, &nextc);
+		rc = fat_get_cluster(bs, dev_handle, FAT1, firstc, &nextc);
 		if (rc != EOK)
 			return rc;
@@ -560,5 +562,5 @@
 		unsigned fatno;
 
-		rc = fat_get_cluster(bs, dev_handle, lastc, &nextc);
+		rc = fat_get_cluster(bs, dev_handle, FAT1, lastc, &nextc);
 		if (rc != EOK)
 			return rc;
Index: uspace/srv/fs/fat/fat_fat.h
===================================================================
--- uspace/srv/fs/fat/fat_fat.h	(revision ccce242372aca2c29042948b947afb9cb1fc3631)
+++ uspace/srv/fs/fat/fat_fat.h	(revision 711e1f32ff29817726bcac1317d5d28bdaabac90)
@@ -80,6 +80,6 @@
 extern int fat_alloc_shadow_clusters(struct fat_bs *, dev_handle_t,
     fat_cluster_t *, unsigned);
-extern int fat_get_cluster(struct fat_bs *, dev_handle_t, fat_cluster_t,
-    fat_cluster_t *);
+extern int fat_get_cluster(struct fat_bs *, dev_handle_t, unsigned,
+    fat_cluster_t, fat_cluster_t *);
 extern int fat_set_cluster(struct fat_bs *, dev_handle_t, unsigned,
     fat_cluster_t, fat_cluster_t);
Index: uspace/srv/fs/fat/fat_ops.c
===================================================================
--- uspace/srv/fs/fat/fat_ops.c	(revision ccce242372aca2c29042948b947afb9cb1fc3631)
+++ uspace/srv/fs/fat/fat_ops.c	(revision 711e1f32ff29817726bcac1317d5d28bdaabac90)
@@ -290,4 +290,70 @@
 
 	*nodepp = nodep;
+	return EOK;
+}
+
+/** Perform basic sanity checks on the file system.
+ *
+ * Verify if values of boot sector fields are sane. Also verify media
+ * descriptor. This is used to rule out cases when a device obviously
+ * does not contain a fat file system.
+ */
+static int fat_sanity_check(fat_bs_t *bs, dev_handle_t dev_handle)
+{
+	fat_cluster_t e0, e1;
+	unsigned fat_no;
+	int rc;
+
+	printf("fatcnt\n");
+	/* Check number of FATs. */
+	if (bs->fatcnt == 0)
+		return ENOTSUP;
+
+	/* Check total number of sectors. */
+
+	printf("totsec\n");
+	if (bs->totsec16 == 0 && bs->totsec32 == 0)
+		return ENOTSUP;
+
+	if (bs->totsec16 != 0 && bs->totsec32 != 0 &&
+	    bs->totsec16 != bs->totsec32) 
+		return ENOTSUP;
+
+	printf("mdesc\n");
+	/* Check media descriptor. Must be between 0xf0 and 0xff. */
+	if ((bs->mdesc & 0xf0) != 0xf0)
+		return ENOTSUP;
+
+	printf("sec_per_fat\n");
+	/* Check number of sectors per FAT. */
+	if (bs->sec_per_fat == 0)
+		return ENOTSUP;
+
+	/* Check signature of each FAT. */
+
+	for (fat_no = 0; fat_no < bs->fatcnt; fat_no++) {
+		printf("clst-read\n");
+		rc = fat_get_cluster(bs, dev_handle, fat_no, 0, &e0);
+		if (rc != EOK)
+			return EIO;
+
+		rc = fat_get_cluster(bs, dev_handle, fat_no, 1, &e1);
+		if (rc != EOK)
+			return EIO;
+
+		printf("mdesc-fat\n");
+		/* Check that first byte of FAT contains the media descriptor. */
+		if ((e0 & 0xff) != bs->mdesc)
+			return ENOTSUP;
+
+		printf("fat-signat\n");
+		/*
+		 * Check that remaining bits of the first two entries are
+		 * set to one.
+		 */
+		if ((e0 >> 8) != 0xff || e1 != 0xffff)
+			return ENOTSUP;
+	}
+
 	return EOK;
 }
@@ -981,4 +1047,12 @@
 	}
 
+	/* Do some simple sanity checks on the boot blocks. */
+	rc = fat_sanity_check(bs, dev_handle);
+	if (rc != EOK) {
+		block_fini(dev_handle);
+		ipc_answer_0(rid, rc);
+		return;
+	}
+
 	rc = fat_idx_init_by_dev_handle(dev_handle);
 	if (rc != EOK) {
