Index: disk/lvm.c
===================================================================
RCS file: /sources/grub/grub2/disk/lvm.c,v
retrieving revision 1.3
diff -u -r1.3 lvm.c
--- disk/lvm.c	18 Oct 2006 21:42:42 -0000	1.3
+++ disk/lvm.c	22 Oct 2006 17:58:21 -0000
@@ -24,6 +24,7 @@
 #include <grub/err.h>
 #include <grub/misc.h>
 #include <grub/lvm.h>
+#include <grub/partition.h>
 
 static struct grub_lvm_vg *vg_list;
 static int lv_count;
@@ -369,7 +370,7 @@
 	  if (*p == '}')
 	    break;
 
-	  lv = grub_malloc (sizeof (lv));
+	  lv = grub_malloc (sizeof (*lv));
 
 	  q = p;
 	  while (*q != ' ')
@@ -471,6 +472,34 @@
   return 0;
 }
 
+static int
+iterate_partitions(grub_disk_t disk, 
+ const grub_partition_t p __attribute__ ((unused)))
+{
+	grub_lvm_scan_device(disk->name);
+	return 1;
+}
+
+static int
+grub_lvm_scan (const char *name)
+{
+	grub_disk_t disk;
+
+	disk = grub_disk_open (name);
+
+	if (!disk)
+		return 0;
+
+	grub_partition_iterate(disk,iterate_partitions); 
+
+	grub_disk_close (disk);
+
+	grub_lvm_scan_device(name);
+	
+	return 0;
+}
+
+
 static struct grub_disk_dev grub_lvm_dev =
   {
     .name = "lvm",
@@ -486,7 +515,7 @@
 
 GRUB_MOD_INIT(lvm)
 {
-  grub_device_iterate (&grub_lvm_scan_device);
+  grub_device_iterate (&grub_lvm_scan);
   grub_disk_dev_register (&grub_lvm_dev);
 }
 
