Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 05 May 2023 16:29:05 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 271262] bsdinstaller in AutoZFS + MBR mode always wipes disklabel - rendering system non-bootable
Message-ID:  <bug-271262-227@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D271262

            Bug ID: 271262
           Summary: bsdinstaller in AutoZFS + MBR mode always wipes
                    disklabel - rendering system non-bootable
           Product: Base System
           Version: 13.2-RELEASE
          Hardware: amd64
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: bin
          Assignee: bugs@FreeBSD.org
          Reporter: hpaluch@seznam.cz

Created attachment 241996
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D241996&action=
=3Dedit
Installation log for AutoZFS on MBR layout that will destroy disklabel

While trying several time this installation:
- FreeBSD-13.2-RELEASE-amd64-disc1.iso

When I select this layout:
- AutoZFS
- MBR

It always ends up in broken - Non-bootable system (famous error "Missing
operating system"

Analysis of such system (booting CD in Shell mode) has shown that somehow w=
hole
disklabel is missing.
Only primary FreeBSD partition exists.

I traced down the problem that this command (from bsdinstall_log):

# this works
disklabel da0s1
# this command wipes 1st 4KB of da0s1a thus destroying disklabel!
zpool create -o altroot=3D/mnt  -m "/bootpool" -f "bootpool"   da0s1a
# the command below will now end with error!
disklabel da0s1

Tracing above "zpool create" command I have found that it really wipes
1st 4KB of "da0s1a" thus destroying disklabel that occupies offset from 512=
 to
1024 bytes.

Here is relevant excerpt from truss tracing:

  702: fstatat(AT_FDCWD,"/dev/da0s1a",{ mode=3Dcrw-r-----
,inode=3D104,size=3D0,blksize=3D4096 },0x0) =3D 0 (0x0)
  702: openat(AT_FDCWD,"/dev/da0s1a",O_WRONLY|O_EXCL,00) =3D 6 (0x6)
  702: write(6,"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"...,4096) =3D 4096 (0x1000)
  702: fdatasync(6)                              =3D 0 (0x0)
  702: close(6)                                  =3D 0 (0x0)
  702: open("/mnt/bootpool",O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC,015)
ERR#2 'No such file or directory'

You can clearly see that device da0s1a is opened and immediately wiped with
4096 bytes of zeroes thus liquidating disklabel (!).

--=20
You are receiving this mail because:
You are the assignee for the bug.=



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