Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 01 Oct 2014 17:19:37 -0500
From:      Karl Denninger <karl@denninger.net>
To:        freebsd-stable@freebsd.org
Subject:   Re: Encrypted (GELI) root on ZFS troubles
Message-ID:  <542C7DF9.3060404@denninger.net>
In-Reply-To: <542C7903.3010906@denninger.net>
References:  <542C71C9.1050907@denninger.net> <542C7794.8040502@FreeBSD.org> <542C7903.3010906@denninger.net>

next in thread | previous in thread | raw e-mail | index | archive | help
This is a cryptographically signed message in MIME format.

--------------ms000604020102010809020707
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: quoted-printable

On 10/1/2014 4:58 PM, Karl Denninger wrote:
> On 10/1/2014 4:52 PM, Andriy Gapon wrote:
>> On 02/10/2014 00:27, Karl Denninger wrote:
>>> So here's the fun part of what I'm trying to do (and getting frustrat=
ed
>>> with)
>>>
>>> I have set up a GPT disk with the following setup:
>>>
>>> =3D>       34  625142381  da2  GPT  (298G)
>>>          34          6       - free -  (3.0K)
>>>          40       1024    1  freebsd-boot  (512K)
>>>        1064    4194304    2  freebsd-zfs  [bootme]  (2.0G)
>>>     4195368  134217728    3  freebsd-swap  (64G)
>>>   138413096  486729312    4  freebsd-zfs  (232G)
>>>   625142408          7       - free -  (3.5K)
>>>
>>> Then on freebsd-boot I have written the bootloaders.
>>>
>>> The "bootme" filesystem has *only* the /boot directory copied over fr=
om
>>> the rest of the system's root directory (that is, the kernel, loadabl=
es,
>>> /boot/loader.conf, etc); that pool is called "zboot"
>>>
>>> Partition 4 has the label "root0" on it, and thus shows up in /dev/gp=
t.=20
>>> I have initialized that with geli, set the boot option flag (that is,=

>>> prompt on boot) and created a pool called "root" on the resulting .el=
i
>>> device and then put the system on that.  That's all ok.
>>>
>>> Finally, I set the bootfs on that latter pool.  There is no bootfs se=
t
>>> on /zboot:
>>>
>>> # zpool get bootfs zboot
>>> NAME   PROPERTY  VALUE   SOURCE
>>> zboot  bootfs    -       default
>>>
>>> It is set on the root pool to the proper filesystem:
>>>
>>> # zpool get bootfs root
>>> NAME  PROPERTY  VALUE              SOURCE
>>> root  bootfs    root/R/10.1-CLEAN  local
>>>
>>> The problem is that when the system boots geli "finds" the raw device=

>>> (in this case /dev/da0p4), prompts for the password and attaches ther=
e
>>> instead of in /dev/gpt.  The gpt label is missing --- and equally bad=

>>> the "root" pool does not appear to import at boot time either.
>>>
>>> As a result the system tries to mount root from /zboot (even though i=
t's
>>> not been told to, and HAS been told where to mount off the root pool)=
,
>> As far as *I* can see, you have not told the kernel what your root fs =
should be,
>> so it is using a default root filesystem which the same filesystem fro=
m where
>> the kernel itself was loaded.
>>
>>> but there's no init in there (or anything else other than the boot
>>> filesystem itself) and as a result I get an immediate panic.
>>>
> Various wikis on setting this up have strongly suggested that
> /boot/loader.conf no longer needs to have the root filesystem declared
> explicitly as it is able to locate it via looking in the pool metadata.=
=20
> Is this wrong in this specific case?
>
> (Not a huge deal if so, but it's not at all clear that's true -- and it=

> doesn't do anything for the issue of geli grabbing the base device
> rather than the /dev/gpt one.)
>
Ah, the kernel will not cross a zpool to look for bootfs; if it's not
set on the pool it comes from it will not look further.  Setting it
explicitly in /boot/loader.conf worked.

--=20
Karl Denninger
karl@denninger.net <mailto:karl@denninger.net>
/The Market Ticker/

--------------ms000604020102010809020707
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIFTzCC
BUswggQzoAMCAQICAQgwDQYJKoZIhvcNAQEFBQAwgZ0xCzAJBgNVBAYTAlVTMRAwDgYDVQQI
EwdGbG9yaWRhMRIwEAYDVQQHEwlOaWNldmlsbGUxGTAXBgNVBAoTEEN1ZGEgU3lzdGVtcyBM
TEMxHDAaBgNVBAMTE0N1ZGEgU3lzdGVtcyBMTEMgQ0ExLzAtBgkqhkiG9w0BCQ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J6YnOoRjDLt99LVmlM1I6PjmUEOJNCOsm6U1YhfPqdWNU+RCgj1NvF5R
VmePiiQqBb1VDAFJT7V184fPeSg/ZJU3OTuobPaiBnzZMpg8nmQtYIGtN5tJUSTvgAPCWKtF
geMELdEie1Bwx+sAIYou//dqEaUFTpTWns+nj9MvRmL48ExKgzmnaNXLVqbpy4vnJzL25+uo
PNzWxjMAAAAAAAA=
--------------ms000604020102010809020707--





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