From owner-freebsd-stable@freebsd.org Thu Apr 16 17:44:50 2020 Return-Path: Delivered-To: freebsd-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A7AA02C2FD8 for ; Thu, 16 Apr 2020 17:44:50 +0000 (UTC) (envelope-from freebsd@omnilan.de) Received: from mx0.gentlemail.de (mx0.gentlemail.de [IPv6:2a00:e10:2800::a130]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4936746k3Gz3LHc for ; Thu, 16 Apr 2020 17:44:48 +0000 (UTC) (envelope-from freebsd@omnilan.de) Received: from mh0.gentlemail.de (ezra.dcm1.omnilan.net [IPv6:2a00:e10:2800::a135]) by mx0.gentlemail.de (8.14.5/8.14.5) with ESMTP id 03GHiaUv049319; Thu, 16 Apr 2020 19:44:36 +0200 (CEST) (envelope-from freebsd@omnilan.de) Received: from titan.inop.mo1.omnilan.net (s1.omnilan.de [217.91.127.234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mh0.gentlemail.de (Postfix) with ESMTPSA id 384BADF8; Thu, 16 Apr 2020 19:44:36 +0200 (CEST) Subject: Re: Issue with gpart "Device Busy" To: ian@dijix.com, "freebsd-stable@freebsd.org >> freebsd-stable" References: <3BF9F702-81FD-4156-B6A2-E32C549ACA90@dijix.com> From: Harry Schmalzbauer Organization: OmniLAN Message-ID: <2a7532fd-6fee-deb6-c133-6150aaf1b8c2@omnilan.de> Date: Thu, 16 Apr 2020 19:44:35 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <3BF9F702-81FD-4156-B6A2-E32C549ACA90@dijix.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (mx0.gentlemail.de [IPv6:2a00:e10:2800::a130]); Thu, 16 Apr 2020 19:44:36 +0200 (CEST) X-Milter: Spamilter (Reciever: mx0.gentlemail.de; Sender-ip: ; Sender-helo: mh0.gentlemail.de; ) X-Rspamd-Queue-Id: 4936746k3Gz3LHc X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of freebsd@omnilan.de designates 2a00:e10:2800::a130 as permitted sender) smtp.mailfrom=freebsd@omnilan.de X-Spamd-Result: default: False [-4.69 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[omnilan.de]; HAS_ORG_HEADER(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; IP_SCORE(-2.39)[ip: (-9.21), ipnet: 2a00:e10:2800::/38(-4.58), asn: 61157(1.87), country: DE(-0.02)]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:61157, ipnet:2a00:e10:2800::/38, country:DE]; MID_RHS_MATCH_FROM(0.00)[] X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Apr 2020 17:44:50 -0000 Am 15.04.2020 um 20:35 schrieb ian@dijix.com: > I have an issue with gpart, it will not let me delete partition ada0p2 responding with “Device Busy” > The man page gpart(8) says this may be shown if a partition exists but I cannot seem to delete partition 2 in my case via gpart delete or gpart destroy > > This is a used disk but new to the machine, I can modify the partition type and create partitions before and after partition 2 but I cannot delete it. > > Here’s what I have tried so far: > > > root@beastie:~ # gpart show > => 34 1250263661 ada0 GPT (596G) > 34 409606 - free - (200M) > 409640 1249591904 2 freebsd-ufs (596G) > 1250001544 262151 - free - (128M) > > => 40 976773088 ada1 GPT (466G) > 40 1024 1 freebsd-boot (512K) > 1064 984 - free - (492K) > 2048 4194304 2 freebsd-swap (2.0G) > 4196352 972576768 3 freebsd-zfs (464G) > 976773120 8 - free - (4.0K) > > root@beastie:~ # gpart delete -i2 ada0 > gpart: Device busy : : > : > root@beastie:~ # gpart destroy -F ada0 > gpart: Device busy There might still be situations where 'sysctl kern.geom.debugflags=16' helps, but I never needed it in the last years (since 7.x I guess). Are you sure p2 (-i2) of ada0, most likely home for a ufs filesystem, isn't mounted anymore? Was it a mountpoint inside a jail?  Stopping the jail might leave network related active sockets blocking the filesystem (reboot without starting the jail before deleteing the partition should work in that case). -harry