From owner-freebsd-geom@freebsd.org Wed Jul 11 20:56:38 2018 Return-Path: Delivered-To: freebsd-geom@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 AEE251044412 for ; Wed, 11 Jul 2018 20:56:38 +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 464AC86FE6 for ; Wed, 11 Jul 2018 20:56:38 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.ysv.freebsd.org (Postfix) id 0349E104440D; Wed, 11 Jul 2018 20:56:38 +0000 (UTC) Delivered-To: geom@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 BB210104440C for ; Wed, 11 Jul 2018 20:56:37 +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 5668286FE3 for ; Wed, 11 Jul 2018 20:56:37 +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 997B01F853 for ; Wed, 11 Jul 2018 20:56:36 +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 w6BKua2L008879 for ; Wed, 11 Jul 2018 20:56:36 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id w6BKuaQm008878 for geom@FreeBSD.org; Wed, 11 Jul 2018 20:56:36 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: geom@FreeBSD.org Subject: [Bug 229594] Incorrect "No such geom" error when executing gpart with invalid or incorrect gpt partition number Date: Wed, 11 Jul 2018 20:56:36 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed 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: ae@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: geom@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: 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-geom@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jul 2018 20:56:38 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D229594 --- Comment #6 from Andrey V. Elsukov --- (In reply to Mahmoud Al-Qudsi from comment #5) > I just realized that while gpart may not work on DISK objects, it *does* > know about their existence, at the very least. `gpart create -s mbr aoneu= h` > returns an error while `gpart create -s mbr nvd0` (where `nvd0` is a valid > DISK object and not (yet) the name of a valid PART object) will succeed. gpart(8) has several sub-commands that require different objects to work wi= th. When you are creating PART object, it assumes that the name in argument is = GEOM provider. Many geom classes have providers, not only the DISK class. > That means that when `gpart bootcode -b ... -p ... -i $N $DISK` is execut= ed, > gpart _could_ distinguish between $DISK not existing at all (which the > current error message could be taken to assert universally) vs $DISK bein= g a > valid disk but not a valid PART object. The "bootcode" command works with objects of class PART, since it requires = some knowledge about partition table. The -b argument assumes that the bootcode should be written to the special area of partition table, that is specific = for different partitioning schemes. The -p argument assumes that bootcode shoul= d be written to specified by -i partition, this means that PART object should ex= ists to be able find the name of GEOM provider, that will be open like open("/dev/%s", provider_name).=20=20 > My proposal is for the permutation of $N and $DISK to determine which of = the > following messages is displayed: >=20 > * $DISK is not a valid disk > * $DISK is not partitioned for use with gpart > * $N is not a valid partition on $DISK (if $N is too big) >=20 > (text is obviously just a first stab at clarifying the situation and can = use > refinement) As you may see in the SYNOPSIS of gpart(8) manual page, there is only one command, that accepts provider - it is "create", any other commands require geom object of class PART. So, I'm not sure your suggestion fits to this requirements. --=20 You are receiving this mail because: You are the assignee for the bug.=