1
Description: Handle probing striped DM-RAID devices
2
Author: Robert Collins <robertc@robertcollins.net>
3
Bug-Ubuntu: https://bugs.launchpad.net/bugs/803658
5
Last-Update: 2011-09-14
7
Index: b/grub-core/kern/emu/hostdisk.c
8
===================================================================
9
--- a/grub-core/kern/emu/hostdisk.c
10
+++ b/grub-core/kern/emu/hostdisk.c
12
grub_dprintf ("hostdisk", "no dm target\n");
15
- if (strcmp (target_type, "linear") != 0)
16
+ if (strcmp (target_type, "striped") == 0)
18
- grub_dprintf ("hostdisk", "ignoring dm target %s (not linear)\n",
19
+ grub_dprintf ("hostdisk", "treating dm target %s (striped) as real disk\n", dev);
22
+ if (strcmp (target_type, "linear") != 0 &&
23
+ strcmp (target_type, "striped") != 0 )
25
+ grub_dprintf ("hostdisk", "ignoring dm target %s (not linear/striped)\n",
29
@@ -1469,6 +1475,11 @@
30
grub_dprintf ("hostdisk", "%s child has no DM name\n", path);
33
+ if (strstr (child_name, "-") != 0)
35
+ grub_dprintf ("hostdisk", "%s child %s looks like a sub-layer\n", path, child_name);
38
mapper_name = child_name;
41
@@ -1575,6 +1586,16 @@
43
if (os_dev[len - 1] < '0' || os_dev[len - 1] > '9')
45
+ /* dmraid devices are enumerated - e.g. /dev/mapper/isw_myuuidNAME0 but
46
+ still whole disk. An initial heuristic follows:
47
+ They are a whole disk device if and only if:
48
+ - the name starts with /dev/mapper/
49
+ - the name does not contain '-' (so "NAME0-0") will not count
50
+ - we ignore partitions ("NAME0p1") because they return non-zero
51
+ partition offsets and device_is_wholedisk is not called. */
52
+ if (strncmp (os_dev, "/dev/mapper/", sizeof ("/dev/mapper/") - 1) == 0 &&
53
+ strstr (os_dev + sizeof ("/dev/mapper/") - 1, "-") == 0)