From owner-freebsd-current@FreeBSD.ORG Mon May 14 15:25:42 2012 Return-Path: Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C89F9106564A; Mon, 14 May 2012 15:25:42 +0000 (UTC) (envelope-from freebsd-listen@fabiankeil.de) Received: from smtprelay02.ispgateway.de (smtprelay02.ispgateway.de [80.67.18.14]) by mx1.freebsd.org (Postfix) with ESMTP id 570668FC17; Mon, 14 May 2012 15:25:42 +0000 (UTC) Received: from [78.35.145.73] (helo=fabiankeil.de) by smtprelay02.ispgateway.de with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.68) (envelope-from ) id 1STx9Y-00072i-62; Mon, 14 May 2012 17:25:40 +0200 Date: Mon, 14 May 2012 17:19:14 +0200 From: Fabian Keil To: Andriy Gapon Message-ID: <20120514171914.7a1e9d10@fabiankeil.de> In-Reply-To: <4FB0ED96.6010100@FreeBSD.org> References: <4FAF767C.8030500@cran.org.uk> <4FB0ED96.6010100@FreeBSD.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/kHJMmgyrRv=HxoPDst7oJDj"; protocol="application/pgp-signature" X-Df-Sender: Nzc1MDY3 Cc: Bruce Cran , freebsd-current Subject: Re: Default directory used for 'zpool import' broken (/dev/dsk)? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 May 2012 15:25:42 -0000 --Sig_/kHJMmgyrRv=HxoPDst7oJDj Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Andriy Gapon 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 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--