diff --git a/sys/geom/geom_bsd.c b/sys/geom/geom_bsd.c index 26252aba9c6c..1a0bf2034176 100644 --- a/sys/geom/geom_bsd.c +++ b/sys/geom/geom_bsd.c @@ -55,6 +55,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include @@ -461,6 +463,8 @@ g_bsd_dumpconf(struct sbuf *sb, const char *indent, struct g_geom *gp, struct g_ * not implemented here. */ +static struct uuid freebsd_slice = GPT_ENT_TYPE_FREEBSD; + static struct g_geom * g_bsd_taste(struct g_class *mp, struct g_provider *pp, int flags) { @@ -472,6 +476,7 @@ g_bsd_taste(struct g_class *mp, struct g_provider *pp, int flags) struct g_slicer *gsp; u_char hash[16]; MD5_CTX md5sum; + struct uuid uuid; g_trace(G_T_TOPOLOGY, "bsd_taste(%s,%s)", mp->name, pp->name); g_topology_assert(); @@ -527,6 +532,14 @@ g_bsd_taste(struct g_class *mp, struct g_provider *pp, int flags) break; } + /* Same thing if we are inside a GPT */ + error = g_getattr("GPT::type", cp, &uuid); + if (!error) { + if (memcmp(&uuid, &freebsd_slice, sizeof(uuid)) != 0 && + flags == G_TF_NORMAL) + break; + } + /* Get sector size, we need it to read data. */ secsize = cp->provider->sectorsize; if (secsize < 512)