The following patches add more meaningsful GEOM error messages (indicating the name of what was not found) and fixes the "Geom not found" and "magically introduced offset 63" problem when running "bsdlabel /dev/mirror/xxx" instead of (the workaround solution) "bsdlabel mirror/xxx". Index: bsdlabel.c =================================================================== RCS file: /v/freebsd/cvs/src/sbin/bsdlabel/bsdlabel.c,v retrieving revision 1.109 diff -u -d -r1.109 bsdlabel.c --- bsdlabel.c 9 Sep 2004 07:46:53 -0000 1.109 +++ bsdlabel.c 5 Jan 2005 20:17:17 -0000 @@ -223,8 +223,12 @@ dkname = argv[0]; asprintf(&specname, "%s%s", _PATH_DEV, argv[0]); } else { - dkname = strrchr(argv[0], '/'); - dkname++; + if (strncmp(argv[0], _PATH_DEV, strlen(_PATH_DEV)) == 0) + dkname = argv[0] + strlen(_PATH_DEV); + else { + dkname = strrchr(argv[0], '/'); + dkname++; + } specname = argv[0]; } Index: geom_ctl.c =================================================================== RCS file: /v/freebsd/cvs/src/sys/geom/geom_ctl.c,v retrieving revision 1.33 diff -u -d -r1.33 geom_ctl.c --- geom_ctl.c 23 Oct 2004 20:51:20 -0000 1.33 +++ geom_ctl.c 5 Jan 2005 20:58:38 -0000 @@ -378,7 +378,7 @@ if (!strcmp(p, cp->name)) return (cp); } - gctl_error(req, "Class not found"); + gctl_error(req, "Class not found: \"%s\"", p); return (NULL); } @@ -400,7 +400,7 @@ } } } - gctl_error(req, "Geom not found"); + gctl_error(req, "Geom not found: \"%s\"", p); return (NULL); } @@ -416,7 +416,7 @@ pp = g_provider_by_name(p); if (pp != NULL) return (pp); - gctl_error(req, "Provider not found"); + gctl_error(req, "Provider not found: \"%s\"", p); return (NULL); }