From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1Qu61z-00047j-14 for mharc-grub-devel@gnu.org; Thu, 18 Aug 2011 13:05:23 -0400 Received: from eggs.gnu.org ([140.186.70.92]:43922) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qu61v-00043W-8u for grub-devel@gnu.org; Thu, 18 Aug 2011 13:05:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qu61u-000268-0i for grub-devel@gnu.org; Thu, 18 Aug 2011 13:05:19 -0400 Received: from mail-fx0-f41.google.com ([209.85.161.41]:59287) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qu61t-00025y-PQ for grub-devel@gnu.org; Thu, 18 Aug 2011 13:05:17 -0400 Received: by fxg9 with SMTP id 9so1781738fxg.0 for ; Thu, 18 Aug 2011 10:05:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:x-enigmail-version:content-type; bh=tzJT2OKVWFiCqy3yoV7Y7GyqJomXpuzkXN22jJ/oOro=; b=qivc8sUhmHBL5W0BUTvmnig3Ub4oZX0ZIaXIudUQGQI78dr/NRDCOppTaOdgw0fERn LwKAOwewfHttexu56ybRBBOlptl5N4wKPJRfCFHKPolZ8FW+DderwYukDCRxH6AmEhZs tQji3/4tyCeTT5BeSib1KQsY/WRUFE6tF94ho= Received: by 10.223.156.80 with SMTP id v16mr1428944faw.11.1313687116880; Thu, 18 Aug 2011 10:05:16 -0700 (PDT) Received: from debian.x201.phnet (39-92.62-81.cust.bluewin.ch [81.62.92.39]) by mx.google.com with ESMTPS id p3sm1879114faa.9.2011.08.18.10.05.14 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 18 Aug 2011 10:05:15 -0700 (PDT) Message-ID: <4E4D4648.1090102@gmail.com> Date: Thu, 18 Aug 2011 19:05:12 +0200 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.18) Gecko/20110626 Iceowl/1.0b2 Icedove/3.1.11 MIME-Version: 1.0 To: grub-devel@gnu.org Subject: Re: getroot for ZFS without libzfs? References: <624ACA48-86E4-4ECB-A975-A47B1FB7F7E6@gmail.com> <0C06B528-4EA9-48D4-820F-C6B408EC4CF0@gmail.com> In-Reply-To: <0C06B528-4EA9-48D4-820F-C6B408EC4CF0@gmail.com> X-Enigmail-Version: 1.1.2 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="------------enigDB1F47B3360D76A8C53D3FB5" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.161.41 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Aug 2011 17:05:20 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigDB1F47B3360D76A8C53D3FB5 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 11.08.2011 03:04, Zachary Bedell wrote: > On Aug 10, 2011, at 8:22 AM, Robert Millan wrote: >> 2011/8/9 Zachary Bedell : >>> You'd need to look at all the raw devices to begin with and see which= if any has a ZFS label >> Yes, but how do you know this is the label you wanted? Consider the >> case where there's more than one pool with this name. > The pool can be identified positively via the guid which is in the labe= ls and available via `zpool list -H -o guid `. It's not possi= ble to have two pools imported at once with the same name, If you can't import 2 pools with same name in the same time then it's a bug. It's like not being able to mount 2 disks with same label. And so as such I expect it to be fixed in future and so I don't rely on this. > (And probably keep scanning for all of the devices with that guid to in= stall Grub to all of them similar to the MD support, but I'm getting ahea= d of myself=E2=80=A6) > This would be inappropriate. Install is done to the disk, not to FS. So if user tells to install to one disk, you have to obey, not guess what user might have wanted. > It would also be possible to check the imported status of the pool sinc= e a conflicted name couldn't be imported normally (though multiple pools = available via SAN fabric would probably invalidate that). The status of the pool in on-disk structures may be "IMPORTED" even if the pool currently isn't. For instance FreeBSD keeps the state to "IMPORTED" on shutdown and so it would appear as imported if booted into another OS. > It may also be possible to compare the hostid of the host that has it= imported, though I'm not sure it's possible to get the hostid reliably w= ithout going to libzfs. There's logic in the Linux ZFS driver that diver= ges from both Solaris and FreeBSD a bit as far as how the hostid is calcu= lated from the live system, so that's probably a tough option. > and unreliable as well. > Is calling out to zpool as a helper kosher? English translation of "kosher" ("=D7=9B=D7=A9=D7=A8") is "appropriate". = Why not stick to English? > The -H flag to zpool pool is basically Sun's idea of a public API in = that it's intended to output only the requested fields with no header inf= ormation for automated parsing. But probably using unusual symbols in zpool names will make the parsing go haywire anyway. @Seth: any comment on what Sun considers a public API? >> >> Then I wouldn't use /dev/zfs. The less stable and standard is the ZFS= >> API GRUB uses, the more likely is that one can argue it doesn't fall >> under the "system library" exception. We don't need system library exception to read /dev/zfs. It's not a library but a way to speak with kernel which is definitely interprocess communication. >> Directly accessing on-disk structures is entirely different, since a >> data structure itself can't be copyrighted. > Right. And a bonus that the on-disk is well documented by Sun with the= explicitly stated purpose of interoperability. > > > Assuming calling out to zpool would be acceptable, I think I'm going to= dive in this week and see if I can get it running. The libzfs related a= utoconf stuff is the biggest area that Linux is "special" in, and it woul= d be nice to yank that all out. > > -Zac > > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > https://lists.gnu.org/mailman/listinfo/grub-devel > --=20 Regards Vladimir '=CF=86-coder/phcoder' Serbinenko --------------enigDB1F47B3360D76A8C53D3FB5 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iF4EAREKAAYFAk5NRkgACgkQNak7dOguQgn7YQEAlaiTkF1xdRTNqJQ79OVurbOI 7o++mcRkIqX2MhAyrUQA/0ib1VFDBWvi+8x3rcB4i+ysJwAMn5eCNF20Jzq9DySE =iKzS -----END PGP SIGNATURE----- --------------enigDB1F47B3360D76A8C53D3FB5--