Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 17 May 2024 15:52:56 -0400
From:      mike tancsa <mike@sentex.net>
To:        Warner Losh <imp@bsdimp.com>
Cc:        FreeBSD-STABLE Mailing List <freebsd-stable@freebsd.org>
Subject:   Re: Open ZFS vs FreeBSD ZFS boot issues (resolved sort of)
Message-ID:  <a299d531-f382-47c2-8441-8598001edd31@sentex.net>
In-Reply-To: <CANCZdfpAXg_farsT3iypx8NGhOcuOWFUZnwbYG8sYAZoEzSmAw@mail.gmail.com>
References:  <4c331e4f-75c0-4124-bb11-84568e91ca61@sentex.net> <CANCZdfpAXg_farsT3iypx8NGhOcuOWFUZnwbYG8sYAZoEzSmAw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------C7Xe0TBA9gZyQsY8DA0B9eaz
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

On 5/16/2024 10:38 AM, Warner Losh wrote:
>
>
> On Thu, May 16, 2024 at 8:14 AM mike tancsa <mike@sentex.net> wrote:
>
>     I have a strange edge case I am trying to work around.  I have a
>     customer's legacy VM which is RELENG_11 on ZFS.  There is some
>     corruption that wont clear on a bunch of directories, so I want to
>     re-create it from backups. I have done this many times in the past
>     but
>     this one is giving me grief. Normally I do something like this on my
>     backup server (RELENG_13)
>
>     truncate -s 100G file.raw
>     mdconfig -f file.raw
>     gpart create -s gpt md0
>     gpart add -t freebsd-boot -s 512k md0
>     gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 md0
>     gpart add -t freebsd-swap -s 2G md0
>     gpart add -t freebsd-zfs md0
>     zpool create -d -f -o altroot=/mnt2 -o
>     feature@lz4_compress=enabled -o
>     cachefile=/var/tmp/zpool.cache myZFSPool /dev/md0p3
>
>
> I'm surprised you don't specifically create compatibility with some older
> standard and then maybe add compression. But I'd start there: create
> one that doesn't use lz4_compress (it's not read-only compatible,
> meaning the old boot loader has to 100% implement it faithfully).

Hi Warner,

     I though -d would make the LCD. But looking at the updated man 
pages for zpool create, I didnt realize there are these handy-dandy 
files with all the supported features!

Trying with

     zpool create -o 
compatibility=/usr/share/zfs/compatibility.d/freebsd-11.2 -o 
altroot=/mnt2  -o cachefile=/var/tmp/zpool.cache myZFSPool /dev/md0p3

and the pmbr and gptzfsboot from RELENG_12 still gives the same error

However, if I copy over from RELENG_12 /boot/loader and /boot/zfsloader 
and /boot/lua I am able to boot.   No idea why that is the case, but.... 
I think this is "solved enough" for me and hopefully if someone else 
finds themselves in this strange edge case, this is enough for the LLM 
to scrape and give a solution :)

Thanks for the hints Warner.  Not sure why it didnt "just work" but it 
works with this added step.

     ---Mike


>     FreeBSD/x86 ZFS enabled bootstrap loader, Revision 1.1
>
>     (Tues Oct 10:24:17 EDT 2018 user@hostname)
>     panic: free: guard2 fail @ 0xbf153040 + 2061 from unknown:0
>     --> Press a key on the console to reboot <--
>
>
> This is a memory corruption bug. You'll need to find what's corrupting
> memory and make it stop.
>
> I imagine this might be a small incompatibility with OpenZFS or just
> a bug in what openZFS is generating on the releng13 server.
>
> What version is the boot loader? There's been like 6 years of fixes and
> churn since the date above? Maybe the latest on RELENG_11 for it
> if you are still running 11.2-stable.
>
> Any chance you can use the stable/13 or stable/14 loaders? 11 is really
> not supported anymore and hasn't been for quite some time. I have no
> time for it beyond this quick peek.
>

--------------C7Xe0TBA9gZyQsY8DA0B9eaz
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit

<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <div class="moz-cite-prefix">On 5/16/2024 10:38 AM, Warner Losh
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CANCZdfpAXg_farsT3iypx8NGhOcuOWFUZnwbYG8sYAZoEzSmAw@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">
        <div dir="ltr"><br>
        </div>
        <br>
        <div class="gmail_quote">
          <div dir="ltr" class="gmail_attr">On Thu, May 16, 2024 at
            8:14 AM mike tancsa &lt;<a href="mailto:mike@sentex.net"
              moz-do-not-send="true" class="moz-txt-link-freetext">mike@sentex.net</a>&gt;
            wrote:<br>
          </div>
          <blockquote class="gmail_quote"
style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I
            have a strange edge case I am trying to work around.  I have
            a <br>
            customer's legacy VM which is RELENG_11 on ZFS.  There is
            some <br>
            corruption that wont clear on a bunch of directories, so I
            want to <br>
            re-create it from backups. I have done this many times in
            the past but <br>
            this one is giving me grief. Normally I do something like
            this on my <br>
            backup server (RELENG_13)<br>
            <br>
            truncate -s 100G file.raw<br>
            mdconfig -f file.raw<br>
            gpart create -s gpt md0<br>
            gpart add -t freebsd-boot -s 512k md0<br>
            gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 md0<br>
            gpart add -t freebsd-swap -s 2G md0<br>
            gpart add -t freebsd-zfs md0<br>
            zpool create -d -f -o altroot=/mnt2 -o
            feature@lz4_compress=enabled -o <br>
            cachefile=/var/tmp/zpool.cache myZFSPool /dev/md0p3<br>
          </blockquote>
          <div><br>
          </div>
          <div>I'm surprised you don't specifically create compatibility
            with some older</div>
          <div>standard and then maybe add compression. But I'd start
            there: create</div>
          <div>one that doesn't use lz4_compress (it's not read-only
            compatible,</div>
          <div>meaning the old boot loader has to 100% implement it
            faithfully).</div>
        </div>
      </div>
    </blockquote>
    <p>Hi Warner,</p>
    <p>    I though -d would make the LCD. But looking at the updated
      man pages for zpool create, I didnt realize there are these
      handy-dandy files with all the supported features!</p>
    <p>Trying with </p>
    <p>    zpool create -o
      compatibility=/usr/share/zfs/compatibility.d/freebsd-11.2 -o
      altroot=/mnt2  -o cachefile=/var/tmp/zpool.cache myZFSPool
      /dev/md0p3</p>
    <p>and the pmbr and gptzfsboot from RELENG_12 still gives the same
      error</p>
    <p>However, if I copy over from RELENG_12 /boot/loader and
      /boot/zfsloader and /boot/lua I am able to boot.   No idea why
      that is the case, but.... I think this is "solved enough" for me
      and hopefully if someone else finds themselves in this strange
      edge case, this is enough for the LLM to scrape and give a
      solution :)  <br>
    </p>
    <p>Thanks for the hints Warner.  Not sure why it didnt "just work"
      but it works with this added step. <br>
    </p>
    <p>    ---Mike<br>
    </p>
    <br>
    <blockquote type="cite"
cite="mid:CANCZdfpAXg_farsT3iypx8NGhOcuOWFUZnwbYG8sYAZoEzSmAw@mail.gmail.com">
      <div dir="ltr">
        <div class="gmail_quote">
          <blockquote class="gmail_quote"
style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
            FreeBSD/x86 ZFS enabled bootstrap loader, Revision 1.1<br>
            <br>
            (Tues Oct 10:24:17 EDT 2018 user@hostname)<br>
            panic: free: guard2 fail @ 0xbf153040 + 2061 from unknown:0<br>
            --&gt; Press a key on the console to reboot &lt;--<br>
          </blockquote>
          <div><br>
          </div>
          <div>This is a memory corruption bug. You'll need to find
            what's corrupting</div>
          <div>memory and make it stop.</div>
          <div><br>
          </div>
          <div>I imagine this might be a small incompatibility with
            OpenZFS or just</div>
          <div>a bug in what openZFS is generating on the releng13
            server.<br>
          </div>
          <br>
          <div>What version is the boot loader? There's been like 6
            years of fixes and</div>
          <div>churn since the date above? Maybe the latest on RELENG_11
            for it</div>
          <div>if you are still running 11.2-stable.</div>
          <div><br>
          </div>
          <div>Any chance you can use the stable/13 or stable/14
            loaders? 11 is really</div>
          <div>not supported anymore and hasn't been for quite some
            time. I have no</div>
          <div>time for it beyond this quick peek.<br>
          </div>
          <br>
        </div>
      </div>
    </blockquote>
    <br>
  </body>
</html>

--------------C7Xe0TBA9gZyQsY8DA0B9eaz--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?a299d531-f382-47c2-8441-8598001edd31>