From nobody Mon Oct 17 20:01:44 2022 X-Original-To: freebsd-arm@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 4MrnvL217kz4fKt4 for ; Mon, 17 Oct 2022 20:01:50 +0000 (UTC) (envelope-from gjb@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4MrnvL1W3Vz42g2; Mon, 17 Oct 2022 20:01:50 +0000 (UTC) (envelope-from gjb@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1666036910; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=SYFOYCsYHZ9gq8uFqLDqpnSm0zgGG0e+iN0HQODG/uc=; b=yY4w4x1sZuzPdT98ppo2Cg8iCWCOk47SY2/JC58pcdK3FjZgyIAF0dVFD6nmg7xLIX4R7I X5NTsHw2iTAat5xpmpTjJ0yn0QMR4ujlNpwGYFW0wUbAyl7tNKRkc16kd0jUw6nThVMPW8 cwuO36DlTc7c7hFfRpiFDAnBJjiMQjAuIx/7Vp7oiUaDns9L36Kdp3UhN/DpbgwwjBlVFr K0zUEMXz7ie1xxWNcn38c1hhcIRiWRPCHpDz++1IcMFnTaWGHGINp/tiMdLPPjkoKq5qr+ eUohnkkDs4bQhWiMYwe/e9X+SoSOi8c/3AJJqR1nlr5mcUxI6kw2kUud++hd3A== Received: from FreeBSD.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id CAB211093C; Mon, 17 Oct 2022 20:01:49 +0000 (UTC) (envelope-from gjb@freebsd.org) Date: Mon, 17 Oct 2022 20:01:44 +0000 From: Glen Barber To: Mark Millard Cc: freebsd-arm , Warner Losh Subject: Re: Snapshot stable/13-n252734-56533712694 first boot "gpart: arg0 'ufs/rootfs': Invalid argument"; also, an alignment question . . . Message-ID: <20221017200144.GK30607@FreeBSD.org> References: <3DA3BC90-D234-4B37-9125-E7A70F16DD08.ref@yahoo.com> <3DA3BC90-D234-4B37-9125-E7A70F16DD08@yahoo.com> List-Id: Porting FreeBSD to ARM processors List-Archive: https://lists.freebsd.org/archives/freebsd-arm List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-arm@freebsd.org MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="94oXV8jP6EZ84voN" Content-Disposition: inline In-Reply-To: <3DA3BC90-D234-4B37-9125-E7A70F16DD08@yahoo.com> ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1666036910; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=SYFOYCsYHZ9gq8uFqLDqpnSm0zgGG0e+iN0HQODG/uc=; b=Rsc/odqpq+MMyDMDQ8H60u+Nd9bF3W/c8q0DiutSRF5f3676WBCIkEgrV8CJzjiV1Yd/Vm RRqKbRBolTqHKxTYmzJVgMZRG+Rq4v5sh4HQjzmPFV9LvHg+r+a9XK3IhwlQgLisfnTO/C 42YSpkFBfBF7vr91pcr+zfC6yJQlqnbgsUn/rTMgSd1TNM/fqCAbLq7c1cmJmQZ4NkF5UT JKud/iIHYBjx3cb8iOOFseWet3fWmK4+P5anrucJQkN+PYol/JxfM1WyP0lNK0vgAQfnby j7CPy5fZlmvaPgxZIeBXFdK90Ei3UUhK1pBLdwfpMgbURKI6XonIQcMwUHudmg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1666036910; a=rsa-sha256; cv=none; b=jyQyqpgRSDgbL4DwUfcIQbXAI2X89FNtJNl9ojBrDveUY0zX2uDOOS7trLxnn5TMgC+xry Df/KIS8nZzwnGjfrdOmnTNomgPQG+XerDNLEhuM4+iyB9fdMEtXX+t1CLwytRm5yb4mT9n duivd+BpTHx21+UkywTxqqYtCxdEYR8KnINgoQV1VniG2+4EB6OSrgeXjob703aBL3i5ds eoupLH2x8vig1UGKlxLpTr7m1jkAuvqTG9+O/3dXvqkKb+Sk9YsOTgzJR5YcogtrIsP8QK 6SacAp0ZpK18zN5FmTCKfTKxTrH33T4dr3XB/Hvd5yJ/FNMLakXEmUQILG29bQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N --94oXV8jP6EZ84voN Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Oct 17, 2022 at 12:30:40PM -0700, Mark Millard wrote: > [While the example is an aarch64 context, the issue should be > more general.] >=20 >=20 > Issue #0: >=20 > After dd'ing: >=20 > FreeBSD-13.1-STABLE-arm64-aarch64-RPI-20221014-56533712694-252734.img >=20 > to the USB3 media booting got a notice: >=20 > gpart: arg0 'ufs/rootfs': Invalid argument >=20 > Showing some context: >=20 > . . . > Setting hostuuid: 30303031-3030-3030-3265-373238346338. > Setting hostid: 0xd2f9b0de. > Starting file system checks: > /dev/ufs/rootfs: FILE SYSTEM CLEAN; SKIPPING CHECKS > /dev/ufs/rootfs: clean, 498385 free (1281 frags, 62138 blocks, 0.1% fragm= entation) > Growing root partition to fill device > random: randomdev_wait_until_seeded unblock wait > random: randomdev_wait_until_seeded unblock wait > random: unblocking device. > GEOM_PART: da0s2 was automatically resized. > Use `gpart commit da0s2` to save changes or `gpart undo da0s2` to rever= t them. > da0s2 resized > da0s2a resized > gpart: arg0 'ufs/rootfs': Invalid argument > super-block backups (for fsck_ffs -b #) at: > . . .=20 >=20 > It looks like the line in question in /etc/rc.d/growfs is: >=20 > gpart commit "$rootdev" >=20 > where the prior code: >=20 > FSTYPE=3D$(mount -p | awk '{ if ( $2 =3D=3D "/") { print $3 }}') > FSDEV=3D$(mount -p | awk '{ if ( $2 =3D=3D "/") { print $1 }}') > case "$FSTYPE" in > ufs) > rootdev=3D${FSDEV#/dev/} > ;; >=20 > assigned rootdev based on: >=20 > For FSTYPE: > # mount -p | awk '{ if ( $2 =3D=3D "/") { print $3 }}' > ufs >=20 > For FSDEV: > # mount -p | awk '{ if ( $2 =3D=3D "/") { print $1 }}' > /dev/ufs/rootfs >=20 > So: ufs/rootfs >=20 > I'd guess that the problem is that after the gpart resize -i . . . > activities the label ufs/rootfs is no longer effective for > gpart (until the growfs -y completes?). >=20 > Whatever the cause, gpart is rejecting the ufs/rootfs > notation. >=20 >=20 >=20 > Issue #1 (unsure of the intent, so checking): >=20 > # gpart show > =3D> 63 468862065 da0 MBR (224G) > 63 1985 - free - (993K) > 2048 102400 1 fat32lba [active] (50M) > 104448 468757680 2 freebsd (224G) >=20 > =3D> 0 468757680 da0s2 BSD (224G) > 0 128 - free - (64K) > 128 468757552 1 freebsd-ufs (224G) >=20 > Reviewing the alignments (one is differently > aligned than the others): >=20 > The first is good: >=20 > 2048 102400 1 fat32lba [active] (50M) >=20 > aligns to 512*2048 =3D=3D 1 MiByte. >=20 > The second is likely good: >=20 > 104448 468757680 2 freebsd (224G) >=20 > aligns to 512*104448 =3D=3D 51 MiByte, so a 1 MiByte multiple > as the alignment. >=20 > But the 3rd is less aligned (the freebsd-ufs line): >=20 > 104448 468757680 2 freebsd (224G) >=20 > =3D> 0 468757680 da0s2 BSD (224G) > 0 128 - free - (64K) > 128 468757552 1 freebsd-ufs (224G) >=20 > aligns to 512*104448 + 512*128 but 512*128 is a > 64 KiByte offset, so: 51 MiByte + 64 KiByte. >=20 > This is not 1 MiByte aligned but is 64 KiByte aligned. > Is that the intended alignment for the freebsd-ufs > area? >=20 I am going to have to defer to our resident experts on this, to be honest. Glen --94oXV8jP6EZ84voN Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEjRJAPC5sqwhs9k2jAxRYpUeP4pMFAmNNtKEACgkQAxRYpUeP 4pNyuA//Yi4U4DaanQ+Cy0bjokWq4bTuWiElYWemOVE99ybgI7rF5s4mfwHc9Ut6 IN5t/WygnZqn6bUYzR/J2JBcbvFPmHeHxKEWZhcXj87OlOmnd1BVRgnKRoOlzgc/ zzmiL/LS1BjZ5VL1fQtUH21SaI5A+LDbW5t7PiwfGTDisROXo+N66mIM8XZeV3jM QP7mOC4fkOKXBQIVz7wgCK99jti8RCWZn+Vw6/nks/OJmP/AzYXOKagYZug4bjBa QUPZBRb6XHyIXmDT/m+A6hD3C9niPtfcqpvrGePf73MylMj7UCmKNhF+xc6Xm9Wa Ox4Qu3WcxmCFBrQ55xsdOn2BVD+QwGPH0yLVwEvGoof1oSWy2R0VpjGz5G/76iYD YN+CPC18wr/mxwnYegqH4qHeNY4KMcI62TxgT0VpRyuvw0wJkTPam/s5kW57MthF hATlf0guQAnhiXUfy7gOHado8BRvizVHDbB+sn8JK9chGJstg5moUXs2Q8RjyMPb Fpt/N4fPeg/cYzsrs3DC8U58D/vXNR5Cz0/TjuFxlJqR8ltGFXUA/XorEB6ogcZE RC5nv+ZSN6W6zOn1grTY/5aqBufZLxSqDeTvo89DVpzEFvDhUozfpZCJm4MLbqaG r11L9FThWGEoCH8yQwaQktmyffb8RETW+ddoMxPZsFnBzzeTTGw= =wX0q -----END PGP SIGNATURE----- --94oXV8jP6EZ84voN--