From owner-freebsd-fs@freebsd.org Tue Jul 24 08:33:52 2018 Return-Path: Delivered-To: freebsd-fs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C153D1044E25 for ; Tue, 24 Jul 2018 08:33:52 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-wm0-f42.google.com (mail-wm0-f42.google.com [74.125.82.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 40D89853FD for ; Tue, 24 Jul 2018 08:33:52 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-wm0-f42.google.com with SMTP id y2-v6so1029302wma.1 for ; Tue, 24 Jul 2018 01:33:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=crdp/XoHPp2qWCN4dSfG6Xz5rRfPSasLUwvRbQ1YqnY=; b=qsWtQz9PGw6UT5T2N/6asrpTabUmoSqaMzE51lSL7JeqkC8JTrpsNpV93t3GLUXV4T 5IplADtmX788Xli/YtuoC9V0zOG9qaVWicp/eza2GnuPOsmsogXxtmaeOnjEO8gocyaj SnMyqpN9iZgMCws73Fty9PfnaP489tblmeQ4Bp+hv1y7dr/ZcX6lyHYcsnjrLQLNVCU8 8IaXpRDWDyX14gRiYy6mie95i4U06+BR17MCB1wmmWE3mVu12wh8yLNzUZFvphj1kaZO 51EuG78IwkdGWPr7CsGMc+z/gJKT7l5bsywHcow8kOpIspZcP+Bi/5PEb/X/1bnMJrUk zzfQ== X-Gm-Message-State: AOUpUlHejxaOQqqWNEI5ID3ZGdKTC1CpbAq29SWO6cdBhUuP67QeOZS+ PHms22C5jgQxOzIjegzDBFgZKwTi X-Google-Smtp-Source: AAOMgpfUoZZBRPSn3CW0EAuwosXTEM4UiFY5oA4EyGmLsCr2li2QjAXwHm4ia9jvzrWKksiSMgLHog== X-Received: by 2002:a7b:c016:: with SMTP id c22-v6mr1472316wmb.160.1532421230532; Tue, 24 Jul 2018 01:33:50 -0700 (PDT) Received: from [192.168.1.36] (broadband-82-140-206-85.atc.tvcom.ru. [82.140.206.85]) by smtp.googlemail.com with ESMTPSA id s124-v6sm1402320wmf.47.2018.07.24.01.33.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Jul 2018 01:33:49 -0700 (PDT) Subject: Re: CRC32Mounting from zfs:zroot/ROOT/default failed with error 2 To: John Kennedy , freebsd-fs@freebsd.org References: <20180724012745.GB75644@phouka1.phouka.net> From: Andriy Gapon Message-ID: <3596ef16-da50-b26c-b7fd-724ca020cba2@FreeBSD.org> Date: Tue, 24 Jul 2018 11:33:52 +0300 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180724012745.GB75644@phouka1.phouka.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jul 2018 08:33:53 -0000 On 24/07/2018 04:27, John Kennedy wrote: > I'm trying to get my RPI3B+ to boot up with a ZFS root. I've seeded the OS > with FreeBSD-12.0-CURRENT-arm64-aarch64-RPI3-20180719-r336479.img (and it's > predecessors 20180709-r336134 and 20180618-r335317). > > I've more or less copied the EFI/U-Boot partition over as-is, and that part > seems fine. The EFI loader iterates through my partitions, finds the ZFS root > (zfs:zroot/ROOT/default), clearly reads the /boot/defaults/loader.conf and > downloads the kernel, umodem.ko and zfs.ko so it's obviously able get the data > off of there. > > [/boot/loader.conf] > hw.usb.template=3 > umodem_load="YES" > > zfs_load="YES" > > The kernel boots. That parts looks relatively normal except for this message > during the boot: > > ... Instruction Set Attributes 0 = CRC32Mounting from zfs:zroot/ROOT/default failed with error 2> > : unknown file system. > ... > > (It's possible that the error is landing in the middle of the rest of the info > dump that after the CPU 0 processor feature dump.) > > It eventually fails and gives me a mountroot> prompt. It prints out a good- > looking vfs.root.mountfrom (=zfs:zroot/ROOT/default) variable. > > Trying devices like zfs:zoort (wrong) and zfs:zroot/ROOT/default (should be Ok) > results in this, much like the kernel startup error: > > Mounting from zfs:zroot/ROOT/default failed with error 2: unknown file system This seems like possibly the same problem as https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=229972 That bug report also describes getting error 2 (ENOENT). Your report adds an additional detail, "unknown file system". That means that vfs_byname() cannot find "zfs" filesystem type. As-if zfs module was not loaded. I wonder if there can be any conflict / confusion between the module declared via VFS_SET(zfs_vfsops, zfs, VFCF_JAIL | VFCF_DELEGADMIN); in zfs_vfsops.c and the module declared via DECLARE_MODULE(zfsctrl, zfs_mod, SI_SUB_VFS, SI_ORDER_ANY); in zfs_ioctl.c. Both define an object named 'zfs_mod' but the objects are static so should not conflict. But there can be quirks in the toolchain (linker) or in the kernel loader. Also, there have been some relatively recent changes related to VFS_SET and DECLARE_MODULE. But the problem is very strange. > At the mountroot prompt, I don't see the ZFS partition directly (but mmcsd0s2a > is shown). At the loader prompt, lsdev lists zfs:zroot as a zfs device, and > "lszfs zroot" shows ROOT (+$MOS, $FREE & $ORIGIN), "lszfs zroot/ROOT" shows > default, but I can't get below that. "ls" and "ls /boot" show what you'd > expect to see off of the root filetree from zroot/ROOT/default. > > I literally made the image by creating a UFS version to build the ZFS version, > same kernel, so you'd think there wouldn't be any incompatibilities. -- Andriy Gapon