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/>
index | next in thread | previous in thread | raw e-mail
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=226714 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 slice 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 open() call in stable/11. It returns -1 if detects "DISKMAGIC ((u_int32_t)0x82564557) /* 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 example: 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 => 0x801621000 [1] In fact, disk0s2 contains ZFS boot pool and DISKMAGIC in the second sector. Easiest fix would be to replace "dd if=/boot/zfsboot of=/dev/ada0s1 count=1" with "dd if=/boot/zfsboot of=/dev/ada0s1 count=2" in the docs to make sure that second sector has no traces of BSD label. -- You are receiving this mail because: You are the assignee for the bug.help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-226714-9-6AlqCS5Wy0>
