From nobody Wed Jun 23 21:24:00 2021 X-Original-To: freebsd-stable@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 7685511D9805 for ; Wed, 23 Jun 2021 21:24:12 +0000 (UTC) (envelope-from mrrooster@gmail.com) Received: from mail-vs1-xe36.google.com (mail-vs1-xe36.google.com [IPv6:2607:f8b0:4864:20::e36]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G9GVM65Jjz4RRk for ; Wed, 23 Jun 2021 21:24:11 +0000 (UTC) (envelope-from mrrooster@gmail.com) Received: by mail-vs1-xe36.google.com with SMTP id 68so2240116vsu.6 for ; Wed, 23 Jun 2021 14:24:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=E8JlO5XT8EdjiticX93bLgc+7U58Wd4hR3Zxqr3vFcA=; b=nDBIfFSDLRD4/wKN1Q5haPX5cjwo7HWv/axZfc5zuzZPz2IDSwOpbH2jMKfYxRcoVb z6mGbl1nGW4bo3UbWj2aUc3gK9MfzAI8Xm63JX5i6cZ86Rz4AIrQlGBnVxjnZyNmixAQ QzE3u9LchwORGrl9m9WcSeyYGd2Vt67zt/DtvaUIjBfrbcqGhzY0TyvuE8hR+90fDgY/ RG2bKP+OnvmrGr7s6dSUrG6koxS7q3XqHI6sR7XilW3NoUN0nUs6BKN02zW/JQVKpUJM Rfwdsm1iuMRn+0GwO+Q42xFi+tIMghToNU5+VcuwT+cEgzVxewtm7ZkFWDUY30oV3Laf WEMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=E8JlO5XT8EdjiticX93bLgc+7U58Wd4hR3Zxqr3vFcA=; b=LuB8mvJKEToLuc1wC8KVBPZpkrFHRdCKZRzTESgX3irnRXoByx4mVYxBWmwAoJCBRr 5Fi8az1VSfXnicBCIXtNAL9/UKui5TU2TsmQgsYj5FvnX86SHgu5rKaHETl9L2j4ZjUz H7JDWInHSxEL4nrATPZJqmJxbo/rwqwdPR3ZpxcPD/SZbpfmtiuVPByturGTHD+Y/y6T TSqhx7E6X7GlK05eYYfTsyJf8ASotvwusJOv7Fn0Wf5XOWPHKMz8PfTq4APBgA4euNYp RvXN79+cAry72gsfLkdF2K+ylnPJg+r1gOOAmDbllD1MYo5Ds3oMIZzfy+tDlRBHjnDo RU1A== X-Gm-Message-State: AOAM532gQVJ9fHPk6LmCK6wF5yPP8k1c2wiTHQd/Cp+Nd20Rh57lJxDJ vOmqk8CS+yuhLFGvfT7bmH6p6TmdwGTTp6Bem2Mja7q59H0= X-Google-Smtp-Source: ABdhPJzJ7qbLWoAshZ/6JZWv9bVQTdf+lOGOVpp16IOML4VW2Ds3GEHx4zP4I2ziFvhw6uik6/VoMIjuOEpVoIvTgaU= X-Received: by 2002:a67:67c1:: with SMTP id b184mr59478vsc.28.1624483450928; Wed, 23 Jun 2021 14:24:10 -0700 (PDT) List-Id: Production branch of FreeBSD source code List-Archive: https://lists.freebsd.org/archives/freebsd-stable List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-stable@freebsd.org X-BeenThere: freebsd-stable@freebsd.org MIME-Version: 1.0 From: Mr Roooster Date: Wed, 23 Jun 2021 22:24:00 +0100 Message-ID: Subject: Crash on boot after moving root zpool To: freebsd-stable@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4G9GVM65Jjz4RRk X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=nDBIfFSD; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of mrrooster@gmail.com designates 2607:f8b0:4864:20::e36 as permitted sender) smtp.mailfrom=mrrooster@gmail.com X-Spamd-Result: default: False [-3.00 / 15.00]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; TO_DN_NONE(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RBL_DBL_DONT_QUERY_IPS(0.00)[2607:f8b0:4864:20::e36:from]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-stable@freebsd.org]; RCPT_COUNT_ONE(0.00)[1]; SPAMHAUS_ZRD(0.00)[2607:f8b0:4864:20::e36:from:127.0.2.255]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::e36:from]; FROM_NAME_HAS_TITLE(1.00)[mr]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[freebsd-stable] X-ThisMailContainsUnwantedMimeParts: N Hi All, I appreciate the below is a bit 'odd', so not sure if it's worth raising a bug for. I have my home server running FreeBSD 13-stable (amd64), specifically 'FreeBSD 13.0-STABLE #5 stable/13-n246071-659f77766031'. It's an AMD Ryzen 8 core on an Asus X-370 Pro. I have root on a SATA attached SSD, a 1TB samsung evo, this was installed from the FreeBSD install media. It boots via EFI. I decided to move the root to a 2TB NVMe, so I installed the NVMe, duplicated the partition layouty (apart from a larger freebsd-zfs partition) and used dd to copy the efi and freebsd-boot partitions over. I then rebooted and selected the new drive as boot to check the EFI partition and bootloader worked as expected, the system rebooted fine. Next step was to 'zpool add' the zfs parttion on the new drive to the zroot pool, then 'zpool remove' the existing partition located on the SATA SSD. (ada7p4 IIRC) This all appeared to work, and I got a message telling me the data had been migrated and an amount of memory had been used. The data seemed okay and the machine remained operational. Then I rebooted. At this point I got stuck in an endless reboot loop, a video of the incident suggets it's somewhere around spa_import_rootpool, but it's so quick I didn't get a full stacktrace. I was able to boot off a USB and import the pool, the data looked okay, so I then used zfs send to dump the data to a file. I have since sucesfully zfs receive'd this onto a new zroot pool and all is well again. But I am a little curious why it didn't work. The pool appearead to be importable and the data was fully retrievable via zfs send. I have also managed to re-create this in a VM. Using Hyper-V, I created a new VM for FreeBSD, with EFI, 4 CPU, and 4G of memory. The default size HD. Installed from FreeBSD-13.0-RELEASE-amd64-disc1.iso I then added another virtual SCSI disk (da1) and did the following: <----------------------------------------------------------------------------------------------CUT [root@vm ~]# gpart show da0 => 40 266338224 da0 GPT (127G) 40 532480 1 efi (260M) 532520 1024 2 freebsd-boot (512K) 533544 984 - free - (492K) 534528 4194304 3 freebsd-swap (2.0G) 4728832 261607424 4 freebsd-zfs (125G) 266336256 2008 - free - (1.0M) [root@vm ~]# gpart create -s gpt da1 da1 created [root@vm ~]# gpart add -t efi -b 40 -s 532480 -i 1 da1 da1p1 added [root@vm ~]# gpart add -t freebsd-boot -b 532520 -s 1024 -i 2 da1 da1p2 added [root@vm ~]# gpart add -t freebsd-swap -b 534528 -s 4194304 -i 3 da1 da1p3 added [root@vm ~]# gpart add -t freebsd-zfs -b 4728832 -s 261607424 -i 4 da1 da1p4 added [root@vm ~]# gpart show da1 => 40 266338224 da1 GPT (127G) 40 532480 1 efi (260M) 532520 1024 2 freebsd-boot (512K) 533544 984 - free - (492K) 534528 4194304 3 freebsd-swap (2.0G) 4728832 261607424 4 freebsd-zfs (125G) 266336256 2008 - free - (1.0M) [root@vm ~]# dd if=/dev/da0p1 of=/dev/da1p1 bs=1m 260+0 records in 260+0 records out 272629760 bytes transferred in 0.124740 secs (2185582343 bytes/sec) [root@vm ~]# dd if=/dev/da0p2 of=/dev/da1p2 1024+0 records in 1024+0 records out 524288 bytes transferred in 0.343932 secs (1524395 bytes/sec) [root@vm ~]# zpool status zroot pool: zroot state: ONLINE config: NAME STATE READ WRITE CKSUM zroot ONLINE 0 0 0 da0p4 ONLINE 0 0 0 errors: No known data errors [root@vm ~]# zpool add zroot da1p4 [root@vm ~]# zpool remove zroot da0p4 [root@vm ~]# zpool status zroot pool: zroot state: ONLINE remove: Removal of vdev 0 copied 1013M in 0h0m, completed on Wed Jun 23 20:43:46 2021 11.8K memory used for removed device mappings config: NAME STATE READ WRITE CKSUM zroot ONLINE 0 0 0 da1p4 ONLINE 0 0 0 errors: No known data errors <----------------------------------------------------------------------------------------------CUT If at this point I shut down the VM, remove what was da0, and set da1 to be the only (and first) scsi device I get exactly the same reboot loop. Booting the VM of the install DVD allows me to zpool import the root pool just fine. (Rebooting still fails after doing this though). Worth a PR? Cheers, Ian