Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 14 May 2012 17:19:14 +0200
From:      Fabian Keil <freebsd-listen@fabiankeil.de>
To:        Andriy Gapon <avg@FreeBSD.org>
Cc:        Bruce Cran <bruce@cran.org.uk>, freebsd-current <freebsd-current@FreeBSD.org>
Subject:   Re: Default directory used for 'zpool import' broken (/dev/dsk)?
Message-ID:  <20120514171914.7a1e9d10@fabiankeil.de>
In-Reply-To: <4FB0ED96.6010100@FreeBSD.org>
References:  <4FAF767C.8030500@cran.org.uk> <4FB0ED96.6010100@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
--Sig_/kHJMmgyrRv=HxoPDst7oJDj
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable

Andriy Gapon <avg@FreeBSD.org> wrote:

> on 13/05/2012 11:53 Bruce Cran said the following:
> > When running 'zpool import' without -d I get the error:
> > "cannot open '/dev/dsk': must be an absolute path"
> >=20
> > zpool(8) suggests the default should have been updated for FreeBSD:
> > "If the -d option is not specified, this command searches for devices
> > in "/dev""
> >=20
> > Was this broken recently?

> Not sure, but maybe /dev/dsk is recorded somewhere in the pool metadata
> or in zpool.cache.  It could have happened with the older version of the
> code. I think that you could check that with zdb.  I think that a fresh
> import should fix it, though.

The following patch seems to work for me:

####
commit 7ec69700f2d6944a61f5c7a826e67f46fa160221
Author: Fabian Keil <fk@fabiankeil.de>
Date:   Mon May 12 16:53:56 2012 +0200

    Default to searching vdevs in /dev. /dev/dsk doesn't exist on FreeBSD.
   =20
    Fixes import issues if no cachefile exists and -d isn't used:
   =20
    fk@r500 ~ $sudo zpool import wde2
    cannot open '/dev/dsk': must be an absolute path

diff --git a/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c b/cddl/contrib=
/opensolaris/cmd/zpool/zpool_main.c
index fe76250..5d1e454 100644
--- a/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c
+++ b/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c
@@ -1909,7 +1909,7 @@ zpool_do_import(int argc, char **argv)
=20
 	if (searchdirs =3D=3D NULL) {
 		searchdirs =3D safe_malloc(sizeof (char *));
-		searchdirs[0] =3D "/dev/dsk";
+		searchdirs[0] =3D "/dev";
 		nsearch =3D 1;
 	}
####

The cachefile part is speculation ...

Fabian

--Sig_/kHJMmgyrRv=HxoPDst7oJDj
Content-Type: application/pgp-signature; name=signature.asc
Content-Disposition: attachment; filename=signature.asc

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (FreeBSD)

iEYEARECAAYFAk+xInUACgkQBYqIVf93VJ3rVgCfUWL4pmXd2OmAGuJ6fhyupY+7
KiYAoI5TmuQ4iEt7wREROjFAdF4U1lOm
=INd4
-----END PGP SIGNATURE-----

--Sig_/kHJMmgyrRv=HxoPDst7oJDj--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120514171914.7a1e9d10>