Skip to content

Commit

Permalink
Provide an articulate example of how to properly delete partitions and
Browse files Browse the repository at this point in the history
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
  • Loading branch information
danfe authored and danfe committed Sep 19, 2017
1 parent 7e36a33 commit 942443f
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion sbin/geom/class/part/gpart.8
Expand Up @@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd July 25, 2016
.Dd September 19, 2017
.Dt GPART 8
.Os
.Sh NAME
Expand Down Expand Up @@ -1325,6 +1325,29 @@ 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
Create a backup of the partition table from
Expand Down

0 comments on commit 942443f

Please sign in to comment.