From owner-svn-src-all@freebsd.org Tue Sep 19 15:08:32 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8BE59E17D0A; Tue, 19 Sep 2017 15:08:32 +0000 (UTC) (envelope-from danfe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5871E8353E; Tue, 19 Sep 2017 15:08:32 +0000 (UTC) (envelope-from danfe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8JF8V2a001741; Tue, 19 Sep 2017 15:08:31 GMT (envelope-from danfe@FreeBSD.org) Received: (from danfe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8JF8V3P001740; Tue, 19 Sep 2017 15:08:31 GMT (envelope-from danfe@FreeBSD.org) Message-Id: <201709191508.v8JF8V3P001740@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: danfe set sender to danfe@FreeBSD.org using -f From: Alexey Dokuchaev Date: Tue, 19 Sep 2017 15:08:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323764 - head/sbin/geom/class/part X-SVN-Group: head X-SVN-Commit-Author: danfe X-SVN-Commit-Paths: head/sbin/geom/class/part X-SVN-Commit-Revision: 323764 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Sep 2017 15:08:32 -0000 Author: danfe (ports committer) Date: Tue Sep 19 15:08:31 2017 New Revision: 323764 URL: https://svnweb.freebsd.org/changeset/base/323764 Log: Provide an articulate example of how to properly delete partitions and partitioning scheme. Users often get confused and frustrated when trying to delete partition table and getting ``Device busy'' error because they forgot (or did not ever know that they have) to delete all its partitions first, and while the manual page mentions this briefly, it does not stress it out enough. Approved by: ae, manpages (bjk) PR (as inspiration): 196102 Differential Revision: https://reviews.freebsd.org/D12336 Modified: head/sbin/geom/class/part/gpart.8 Modified: head/sbin/geom/class/part/gpart.8 ============================================================================== --- head/sbin/geom/class/part/gpart.8 Tue Sep 19 15:00:19 2017 (r323763) +++ head/sbin/geom/class/part/gpart.8 Tue Sep 19 15:08:31 2017 (r323764) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 25, 2016 +.Dd September 19, 2017 .Dt GPART 8 .Os .Sh NAME @@ -1324,6 +1324,29 @@ partition to contain a UFS filesystem and aligned on 4 After creating all required partitions, embed bootstrap code into them: .Bd -literal -offset indent /sbin/gpart bootcode -p /boot/boot1 da0 +.Ed +.Ss Deleting partitions and partitioning scheme +If you get a +.Em "Device busy" +error when trying to destroy a partition table, remember that you must +delete all its partitions first with the +.Cm delete +action. +In this example, assume we have +.Pa da0 +with three partitions: +.Bd -literal -offset indent +/sbin/gpart delete -i 3 da0 +/sbin/gpart delete -i 2 da0 +/sbin/gpart delete -i 1 da0 +/sbin/gpart destroy da0 +.Ed +.Pp +Alternatively, you can invoke the +.Cm destroy +action with the +.Fl F +flag. .Ed .Ss Backup and Restore .Pp