summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--daemon/blkid.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/daemon/blkid.c b/daemon/blkid.c
index 7cc7889d..32168a36 100644
--- a/daemon/blkid.c
+++ b/daemon/blkid.c
@@ -51,6 +51,26 @@ get_blkid_tag (const char *device, const char *tag)
free (err);
if (r == 2) { /* means UUID etc not found */
+ if (STREQ (tag, "TYPE") && STREQ (out, "")) {
+ /* RHEL 5 blkid doesn't return "LVM2_member" for PVs. Instead we
+ * get to this point. Detect if the device is really a PV and return
+ * the right thing instead.
+ */
+ free (out);
+ if (command (&out, &err, "file", "-bsL", device, NULL) == -1) {
+ reply_with_error ("file: %s", err);
+ free (out);
+ free (err);
+ return NULL;
+ }
+ free (err);
+ if (STRPREFIX (out, "LVM2 (Linux Logical Volume Manager)")) {
+ strcpy (out, "LVM2_member");
+ return out;
+ }
+ /*FALLTHROUGH*/
+ }
+
free (out);
out = strdup ("");
if (out == NULL)