From owner-freebsd-bugs@freebsd.org Sat Jul 7 23:57:21 2018 Return-Path: Delivered-To: freebsd-bugs@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 30815103D16D for ; Sat, 7 Jul 2018 23:57:21 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id BCB207309B for ; Sat, 7 Jul 2018 23:57:20 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.ysv.freebsd.org (Postfix) id 80BBD103D16C; Sat, 7 Jul 2018 23:57:20 +0000 (UTC) Delivered-To: bugs@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 5BD8D103D16B for ; Sat, 7 Jul 2018 23:57:20 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.ysv.freebsd.org (mxrelay.ysv.freebsd.org [IPv6:2001:1900:2254:206a::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.ysv.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E88547309A for ; Sat, 7 Jul 2018 23:57:19 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.ysv.freebsd.org (Postfix) with ESMTPS id 2D116EA39 for ; Sat, 7 Jul 2018 23:57:19 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id w67NvIdM034068 for ; Sat, 7 Jul 2018 23:57:18 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id w67NvIl3034067 for bugs@FreeBSD.org; Sat, 7 Jul 2018 23:57: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 229594] Incorrect "No such geom" error when executing gpart with invalid or incorrect gpt partition number Date: Sat, 07 Jul 2018 23:57:19 +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: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: mqudsi@neosmart.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-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jul 2018 23:57:21 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D229594 Bug ID: 229594 Summary: Incorrect "No such geom" error when executing gpart with invalid or incorrect gpt partition number Product: Base System Version: CURRENT Hardware: Any OS: Any Status: New Severity: Affects Many People Priority: --- Component: bin Assignee: bugs@FreeBSD.org Reporter: mqudsi@neosmart.net After upgrading a zpool, a message is displayed to execute something along = the lines of "sudo gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 da0" (= my quote is not along the lines, rather the instructions are to make substitut= ions to the quoted text as needed). I'm sure I'm not the only one that has executed that text as-is forgetting = to substitute `da0` with whatever device `zroot` is on. This is the output of `zpool status`: ``` ... NAME STATE READ WRITE CKSUM tank ONLINE 0 0 0 mirror-0 ONLINE 0 0 0 da0 ONLINE 0 0 0 da1 ONLINE 0 0 0 ... NAME STATE READ WRITE CKSUM zroot ONLINE 0 0= =20=20=20=20 0 gptid/c3ae7a7e-bc4c-11e3-ab8c-4437e6acfe08 ONLINE 0 0= =20=20=20=20 0 ``` Here, `gptid/c3ae7a7e-bc4c-11e3-ab8c-4437e6acfe08` is da2, and as such, I should have substituted `da0` for `da2` before executing `gpart` above. However, `da0`, `da1`, and `da2` are all valid devices: ``` mqudsi@freebsd ~> sysctl -a kern.disks kern.disks: da2 da1 da0 cd0 mqudsi@freebsd ~> geom disk list | grep "Geom name" Geom name: cd0 Geom name: da0 Geom name: da1 Geom name: da2 ``` However, the problem is that the error code is bubbled up from the actual target of the gpart command (after taking into account the `-i` parameter) = such that ultimately an operation was attempted on `/dev/da0p1` which is indeed = NOT a geom device (since the disk is consumed whole by zfs in this configuratio= n) but then the error code is munged into an error _message_ that drops the in= dex but keeps the drive, leading to a misleading error about `da0` not being a = geom device. Solution: The error message should by `sprintf("%sp%d", arg_geom_disk, arg_p_index)`. --=20 You are receiving this mail because: You are the assignee for the bug.=