From nobody Mon May 12 16:50:18 2025 X-Original-To: bugs@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 4Zx5FQ48B9z5wG8k for ; Mon, 12 May 2025 16:50:18 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Zx5FQ3fplz4N23 for ; Mon, 12 May 2025 16:50:18 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1747068618; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dyJV2Xvq23CBeunMDdulQTxA2Y/Cpb8+XdMTip1wqzM=; b=TiDprAxmcRAwlkgez7K+q1xVv58U2lSVPagtV4Igquv0gubYVTpovng5QEfDlzBitAbkOP H5o3193nDymIPWDAIpdG4VN9OXjLIjNHWJFMJuQj1rCMo0W2LEMrzJXpVi12jQ37eGFbpl wc4Mv+uk2YMxxgmdUtmfmy+k3f8ifBF4hTpPhb4j0kv8Nj3I51b7opSV0iseGHwujWvVVk bA3pkIyorABEDbgCv10lYKUca9vWCetRM6DWVQL2WSQAydNckDX31DcLobUPiyAzuAnp4E 1LaKmVs2WTmYnCkB0OkI/KfZ6tHbKS61gQodBXeirMVORv0bz5pM69nmgliMhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1747068618; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dyJV2Xvq23CBeunMDdulQTxA2Y/Cpb8+XdMTip1wqzM=; b=e4/qx+GSzXG7IwXeFUe7niJByUCXGh5HP13Sh3buJVwngmf8fkdSOjraqGXCLO8BkMGp8P MeFTXmfYpszMG7K0/Snd1TrmT83Sqab0O/SDm8w+hVAT38NvlUHIeCctM4CzZ0IPAIycVQ k36gSEZHxzfzTqIjoBENLzNFIHPtKtAcwR/iv8/wng+k6Iy/5//zVeBrdbj21y1BkkybjP pJ9lVuZat07TLdNJgFApt1RPqb+HJlP0T+nIwGLsYHG5h3Kiia763pIUZ1kJjFWZXT2tn5 Q3gJ4MeC5k1Qg8TvRAc4dhAvvWUjYdaBDjEBCPuugde0P6ySiqWwFZTE3qAwgA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1747068618; a=rsa-sha256; cv=none; b=YHzA0efdeGqR7O1YiMmL3gcoYdCi+xaJc50uXqjIsZLh1+zFntOA6W/8as911R15y4dyUi jxvurXmwPSLRfJChsZ0Ip1Bp5opvXf6WEu78ma4yG8p8UfHASp8trkpumptPlfAF9Oj5qN wnp3haaXBoXeU4MF4DRjNpyskY46PEqvI1gEwB5n6J0Nz5isrzJnEAh9TwWCckX0RDYlbX 4FMRUkzwm4FTu7Ln4O1h4wEdstqIxp4KvHRItgiGai1jgb79KtgXp5pEm5cwJl7cV+w+eJ mAnIMaZ7lXT255Mxl1Wn+TSmbYMa9FuC5O6jXurXrx0Hz2l5ORi0hf4bisr22A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Zx5FQ2z0sz1N9W for ; Mon, 12 May 2025 16:50:18 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 54CGoIaw032195 for ; Mon, 12 May 2025 16:50:18 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 54CGoIYH032194 for bugs@FreeBSD.org; Mon, 12 May 2025 16:50:18 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 286746] "gpart add" with the "-a" and "-s" flags specified behaves unexpectedly Date: Mon, 12 May 2025 16:50:18 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: 14.3-STABLE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: karl@denninger.net X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@FreeBSD.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D286746 Bug ID: 286746 Summary: "gpart add" with the "-a" and "-s" flags specified behaves unexpectedly Product: Base System Version: 14.3-STABLE Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: bin Assignee: bugs@FreeBSD.org Reporter: karl@denninger.net The documentation for gpart's "-a" flag to the "add" command says: -a alignment If specified, then the gpart utility tries to align start offset and partition size to be multiple of alignment value. It does indeed do this, including by changing the "-s" flag's size -- often= by reducing it. That is, if you pass a "not-exactly an alignment boundary" si= ze to "-s" gpart may create a smaller partition than you specified in order to= end on said alignment boundary. This usually doesn't matter but in in a few cases it does, such as when nan= obsd builds a "code slice" and then wants to "dd" it into the correct place. If gpart has reduced the "-s" size specified by even one block the copy fails. Alignment is extremely useful on modern storage devices, particularly SSDs = and thus it would be nice to be able to specify this option in embedded builds where copying in a pre-built filesystem of known size to a target partition= is used. Gpart will leave a "hole" in the partition table if necessary to meet align= ment (e.g. the previous partition is not aligned on the requested boundary) whic= h is expected behavior and does not cause trouble. However, shrinking the passed size argument unannounced, while harmless most of the time, definitely is n= ot harmless when the created partition is a target of a copy-in, whether via d= d or simply by filling the filesystem with files after it has been formatted. W= hile the latter is an extreme corner case since you'd have to have a literally-f= ull source filesystem the former, when building or updating embedded system ima= ges, is not. IMHO it should be considered to change gpart so it if a specified size is n= ot on an alignment boundary it rounds up the specified size to the next bounda= ry, but never down to the prior one. --=20 You are receiving this mail because: You are the assignee for the bug.=