diff -rup grub2-1.99~rc1.orig/grub-core/kern//emu/hostdisk.c grub2-1.99~rc1/grub-core/kern//emu/hostdisk.c --- grub2-1.99~rc1.orig/grub-core/kern//emu/hostdisk.c 2011-06-30 11:38:10.825408016 +1200 +++ grub2-1.99~rc1/grub-core/kern//emu/hostdisk.c 2011-06-30 11:32:41.455407974 +1200 @@ -454,9 +454,15 @@ find_partition_start (const char *dev) grub_dprintf ("hostdisk", "no dm target\n"); goto devmapper_fail; } - if (strcmp (target_type, "linear") != 0) + if (strcmp (target_type, "striped") == 0) { - grub_dprintf ("hostdisk", "ignoring dm target %s (not linear)\n", + grub_dprintf ("hostdisk", "treating dm target %s (striped) as real disk\n", dev); + return 0; + } + if (strcmp (target_type, "linear") != 0 && + strcmp (target_type, "striped") != 0 ) + { + grub_dprintf ("hostdisk", "ignoring dm target %s (not linear/striped)\n", target_type); goto devmapper_fail; } @@ -1533,9 +1539,21 @@ static int device_is_wholedisk (const char *os_dev) { int len = strlen (os_dev); + const char *working; if (os_dev[len - 1] < '0' || os_dev[len - 1] > '9') return 1; +/* dmraid devices are enumerated - e.g. /dev/mapper/isw_myuuidNAME0 but still + whole disk. An initial heuristic follows: + They are a whole disk device IFF: + - the name contains /dev/mapper/ + - the name does not contain - (so NAME0-0) will not count + - we ignore partitions (NAME0p1) because they return non-zero partition + offsets and device_is_wholedisk is not called. + */ + working = strstr(os_dev, "/dev/mapper/"); + if (working != 0 && strstr(working + 12, "-") == 0) + return 1; return 0; } #endif Only in grub2-1.99~rc1/grub-core/kern//emu: .hostdisk.c.swp