For the benefit of anyone reading this bug report, I'll CC the reply and patch I sent to the upstream bugzilla entry:
http://bugzilla.kernel.org/show_bug.cgi?id=6394

............

I think the reason the workaround didn't work was that not both detection routines (block 0 and 1) were moved down in the table. I've attached a patch which moves both of them and updates the comments, I'll forward it to the Debian bug report as well.

Regards,
David

BTW, if a partition has previously been used as lvm and is going to be used for a new purpose, one should run "pvremove" on it to remove all traces of lvm signatures.

Index: klibc-1.3.5/usr/kinit/fstype/fstype.c
===================================================================
--- klibc-1.3.5.orig/usr/kinit/fstype/fstype.c  2006-04-09 04:46:59.000000000 
+0200
+++ klibc-1.3.5/usr/kinit/fstype/fstype.c       2006-04-16 11:15:37.000000000 
+0200
@@ -6,8 +6,8 @@
  *  FSTYPE - filesystem type
  *  FSSIZE - filesystem size (if known)
  *
- * We currently detect (in order):
- *  gzip, cramfs, romfs, xfs, luks, lvm2, minix, ext3, ext2, reiserfs, jfs, 
swap
+ * We currently detect the filesystems listed below in the struct
+ * "imagetype images" (in the order they are listed).
  *
  * MINIX, ext3 and Reiserfs bits are currently untested.
  */
@@ -231,8 +231,13 @@
 
 /*
  * Note:
+ * 
  * Minix test needs to come after ext3/ext2, since it's possible for
  * ext3/ext2 to look like minix by pure random chance.
+ * 
+ * LVM comes after all other filesystems since it's possible
+ * that an old lvm signature is left on the disk if pvremove
+ * is not used before creating the new fs.
  */
 static struct imagetype images[] = {
        { 0,            "gzip",         gzip_image      },
@@ -240,14 +245,14 @@
        { 0,            "romfs",        romfs_image     },
        { 0,            "xfs",          xfs_image       },
        { 0,            "luks",         luks_image      },
-       { 0,            "lvm2",         lvm2_image      },
-       { 1,            "lvm2",         lvm2_image      },
        { 1,            "ext3",         ext3_image      },
        { 1,            "ext2",         ext2_image      },
        { 1,            "minix",        minix_image     },
        { 8,            "reiserfs",     reiserfs_image  },
        { 64,           "reiserfs",     reiserfs_image  },
        { 32,           "jfs",          jfs_image       },
+       { 0,            "lvm2",         lvm2_image      },
+       { 1,            "lvm2",         lvm2_image      },
        { -1,           "swap",         swap_image      },
        { 0,            "",             NULL            }
 };

Reply via email to