Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 19 Mar 2018 09:44:12 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-doc@FreeBSD.org
Subject:   [Bug 226714] zfsboot(8) erroneously suggests creating a BSD label
Message-ID:  <bug-226714-9-6AlqCS5Wy0@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-226714-9@https.bugs.freebsd.org/bugzilla/>
References:  <bug-226714-9@https.bugs.freebsd.org/bugzilla/>

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

Eugene Grosbein <eugen@freebsd.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |avg@FreeBSD.org,
                   |                            |eugen@freebsd.org,
                   |                            |imp@FreeBSD.org
             Status|New                         |Open

--- Comment #1 from Eugene Grosbein <eugen@freebsd.org> ---
This is what happens inside: zfsboot normally reads zfsloader from active s=
lice
containing ZFS boot pool and starts it.

zfsloader tastes all slices using zfs_probe_partition() function from
sys/boot/zfs/zfs.c that calls open(devname, O_RDONLY).

open(devname, O_RDONLY) returns -1/ENOENT for a slice that has traces of BSD
label, so zfsloader fails to find bootable ZFS pool. This is libstand's ope=
n()
call in stable/11. It returns -1 if detects "DISKMAGIC ((u_int32_t)0x825645=
57)
/* The disk magic number */" in the second sector of a slice.

One can use tools/tools/bootparttest to see if that is the case, for exampl=
e:

disk0s2: FreeBSD                2047MB
read 512 bytes from the block 0 [+16777720]
read 512 bytes from the block 1 [+16777720]
ptable_bsdread: BSD detected
disk_close: disk0: closed =3D> 0x801621000 [1]

In fact, disk0s2 contains ZFS boot pool and DISKMAGIC in the second sector.

Easiest fix would be to replace "dd if=3D/boot/zfsboot of=3D/dev/ada0s1 cou=
nt=3D1"
with "dd if=3D/boot/zfsboot of=3D/dev/ada0s1 count=3D2" in the docs to make=
 sure that
second sector has no traces of BSD label.

--=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-226714-9-6AlqCS5Wy0>