diff options
author | NeilBrown <neilb@suse.de> | 2008-11-04 20:50:39 +1100 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2008-11-04 20:50:39 +1100 |
commit | f069dd29f0e647a77bdc01c42fcf9e2787d76b79 (patch) | |
tree | 56ec541c1e76c677874ee6f6b80fa6c47b4b11ad /Detail.c | |
parent | a04d576343fcdc3da6dee3a198a4534daddbe96e (diff) | |
download | mdadm-f069dd29f0e647a77bdc01c42fcf9e2787d76b79.tar.gz |
detail: --export also provided MD_DEVNAME
MD_NAME is the name of the array extracted directly from the metadata.
MD_DEVNAME is the current working name of the array. It should appear
in /dev/md. It is possibly what the user gave when creating the
array.
We extract it from /var/run/mdadm/map.
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'Detail.c')
-rw-r--r-- | Detail.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -173,9 +173,14 @@ int Detail(char *dev, int brief, int export, int test, char *homehost) if (st && st->sb) { struct mdinfo info; char nbuf[64]; + struct map_ent *mp, *map = NULL; st->ss->getinfo_super(st, &info); fname_from_uuid(st, &info, nbuf, ':'); printf("MD_UUID=%s\n", nbuf+5); + mp = map_by_uuid(&map, info.uuid); + if (mp && mp->path && + strncmp(mp->path, "/dev/md/", 8) == 0) + printf("MD_DEVNAME=%s\n", mp->path+8); if (st->ss->export_detail_super) st->ss->export_detail_super(st); |