diff -u -r e2fsprogs-1.25/misc/fsck.c e2fsprogs-1.25-ross/misc/fsck.c
--- e2fsprogs-1.25/misc/fsck.c	Wed Sep 19 18:24:15 2001
+++ e2fsprogs-1.25-ross/misc/fsck.c	Tue Jan 22 16:05:55 2002
@@ -251,6 +251,15 @@
 			fprintf(stderr, _("Could not determine "
 					  "filesystem type for %s\n"),
 				fs->device);
+	} else if (strchr(fs->type, ',')) {
+		type = identify_fs_from_list(fs->device,fs->type);
+		if (type) {
+			free(fs->type);
+			fs->type = string_copy(type);
+		} else
+			fprintf(stderr, _("Could not match "
+					  "filesystem type for %s\n"),
+				fs->device);
 	}
 }
 
diff -u -r e2fsprogs-1.25/misc/fsck.h e2fsprogs-1.25-ross/misc/fsck.h
--- e2fsprogs-1.25/misc/fsck.h	Wed Sep 19 18:24:15 2001
+++ e2fsprogs-1.25-ross/misc/fsck.h	Tue Jan 22 16:03:38 2002
@@ -62,3 +62,4 @@
 extern char *base_device(char *device);
 extern char *string_copy(const char *s);
 extern const char *identify_fs(const char *fs_name);
+extern const char *identify_fs_from_list(const char *fs_name, const char *fs_types);
diff -u -r e2fsprogs-1.25/misc/fstype.c e2fsprogs-1.25-ross/misc/fstype.c
--- e2fsprogs-1.25/misc/fstype.c	Wed Sep 19 18:24:15 2001
+++ e2fsprogs-1.25-ross/misc/fstype.c	Tue Jan 22 16:10:43 2002
@@ -10,11 +10,19 @@
  */
 
 #include <stdio.h>
+#include <string.h>
 #if HAVE_UNISTD_H
 #include <unistd.h>
 #endif
 #include <fcntl.h>
 #include <sys/types.h>
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_ERRNO_H
+#include <errno.h>
+#endif
+#include "get_device_by_label.h" /* for string_copy() */
 
 struct fs_magic {
 	const char *fs_name;
@@ -25,6 +33,12 @@
 
 struct fs_magic type_array[] = {
 	{ "ext2", 1024+56, 2, "\123\357" },
+	{ "ext3", 1024+56, 2, "\123\357" },
+	/*
+	 * The ext3 magic is the same as ext2, but is placed
+	 * later in the table so "auto" finds ext2 first but
+	 * ext3 can still be matched from a list.
+	 */
 	{ "minix", 1040, 2, "\177\023" },
 	{ "minix", 1040, 2, "\217\023" },
 	{ "minix", 1040, 2, "\150\044" },
@@ -40,8 +54,11 @@
 	int	fd;
 
 	fd = open(fs_name, O_RDONLY);
-	if (fd < 0)
+	if (fd < 0) {
+		fprintf(stderr, "Couldn't open %s: %s\n",
+		        fs_name, strerror(errno));
 		return NULL;
+	}
 	if (lseek(fd, 0, SEEK_SET) < 0)
 		return NULL;
 	if (read(fd, buf, sizeof(buf)) != sizeof(buf))
@@ -53,20 +70,55 @@
 	return NULL;
 }
 
+const char *identify_fs_from_list(const char *fs_name, const char *fs_types)
+{
+	char	buf[2048];
+	struct fs_magic	*p;
+	int	fd;
+	char *	fs_copy;
+	const char *	t;
+
+	fd = open(fs_name, O_RDONLY);
+	if (fd < 0) {
+		fprintf(stderr, "Couldn't open %s: %s\n",
+		        fs_name, strerror(errno));
+		return NULL;
+	}
+	if (lseek(fd, 0, SEEK_SET) < 0)
+		return NULL;
+	if (read(fd, buf, sizeof(buf)) != sizeof(buf))
+		return NULL;
+	fs_copy = string_copy(fs_types);
+	for(t = strtok(fs_copy, ","); t; t = strtok(NULL, ",")) {
+		for (p = type_array; p->fs_name; p++) {
+			if (strcmp(p->fs_name, t) == 0 &&
+			    memcmp(p->magic, buf+p->offset, p->len) == 0) {
+				free(fs_copy);
+				return p->fs_name;
+			}
+		}
+	}
+	free(fs_copy);
+	return NULL;
+}
+
 #ifdef TEST_PROGRAM
 int main(int argc, char **argv)
 {
 	const char	*type;
 	
-	if (argc != 2) {
-		fprintf(stderr, "Usage: %s device\n", argv[0]);
+	if (argc < 2 || argc > 3) {
+		fprintf(stderr, "Usage: %s [type list] device\n", argv[0]);
 		exit(1);
 	}
-	type = identify_fs(argv[1]);
-	printf("%s is a %s filesystem\n", argv[1], type);
+	if (argc == 2) {
+		type = identify_fs(argv[1]);
+		printf("%s is a %s filesystem\n", argv[1], type);
+	} else {
+		type = identify_fs_from_list(argv[2],argv[1]);
+		printf("%s is a %s filesystem\n", argv[2], type);
+	}
 	return (0);
 }
 #endif
 
-	
-	
