]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - Detail.c
Detail: export MD_UUID from mapfile
[thirdparty/mdadm.git] / Detail.c
index 001012a211cb38e85c8499222a0a0756f8f880ee..1598a4252cd5d50698b327acb89feb3bc2333788 100644 (file)
--- a/Detail.c
+++ b/Detail.c
@@ -194,7 +194,12 @@ int Detail(char *dev, int brief, int export, int test, char *homehost)
                                st->ss->export_detail_super(st);
                } else {
                        struct map_ent *mp, *map = NULL;
+                       char nbuf[64];
                        mp = map_by_devnum(&map, fd2devnum(fd));
+                       if (mp) {
+                               __fname_from_uuid(mp->uuid, 0, nbuf, ':');
+                               printf("MD_UUID=%s\n", nbuf+5);
+                       }
                        if (mp && mp->path &&
                            strncmp(mp->path, "/dev/md/", 8) == 0)
                                printf("MD_DEVNAME=%s\n", mp->path+8);