From owner-freebsd-stable@freebsd.org Thu Apr 16 23:00:37 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 6FA972CAB3C for ; Thu, 16 Apr 2020 23:00:37 +0000 (UTC) (envelope-from ian@dijix.com) Received: from relay1.stackmail.com (relay1.stackmail.com [185.151.28.65]) (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 493F7R5nBBz4FNJ for ; Thu, 16 Apr 2020 23:00:35 +0000 (UTC) (envelope-from ian@dijix.com) Received: from smtp1.mail.stackcp.net ([10.4.72.75] helo=smtp1.n4.stackcp.net) by relay1.stackmail.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.3) (envelope-from ) id 1jPDUi-0007OW-0W for freebsd-stable@freebsd.org; Fri, 17 Apr 2020 00:00:28 +0100 Received: from 156.91.90.146.dyn.plus.net ([146.90.91.156] helo=[10.0.1.33]) by smtp1.n4.stackcp.net with esmtpa (Exim 4.92.3) (envelope-from ) id 1jPDUh-0005tB-Ng for freebsd-stable@freebsd.org; Fri, 17 Apr 2020 00:00:27 +0100 From: ian@dijix.com Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.14\)) Subject: Re: Issue with gpart "Device Busy" Date: Fri, 17 Apr 2020 00:00:27 +0100 References: <3BF9F702-81FD-4156-B6A2-E32C549ACA90@dijix.com> <2a7532fd-6fee-deb6-c133-6150aaf1b8c2@omnilan.de> To: freebsd-stable@freebsd.org In-Reply-To: <2a7532fd-6fee-deb6-c133-6150aaf1b8c2@omnilan.de> Message-Id: <49390CCC-7687-41C8-BACD-C24D103EFFFF@dijix.com> X-Mailer: Apple Mail (2.3445.104.14) X-Authenticated-Sender: ian@dijix.com X-Scan-Signature: 7bde076138f319ff309658b0ab0f67c9 X-Rspamd-Queue-Id: 493F7R5nBBz4FNJ X-Spamd-Bar: +++ Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of ian@dijix.com has no SPF policy when checking 185.151.28.65) smtp.mailfrom=ian@dijix.com X-Spamd-Result: default: False [3.57 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_LAST(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MV_CASE(0.50)[]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[dijix.com]; AUTH_NA(1.00)[]; RCPT_COUNT_ONE(0.00)[1]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(0.76)[ipnet: 185.151.28.0/24(1.74), asn: 31727(2.13), country: GB(-0.07)]; NEURAL_SPAM_MEDIUM(0.43)[0.431,0]; NEURAL_SPAM_LONG(0.98)[0.981,0]; FROM_NO_DN(0.00)[]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:31727, ipnet:185.151.28.0/24, country:GB]; MID_RHS_MATCH_FROM(0.00)[]; HAS_X_AS(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[156.91.90.146.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.10] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 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 23:00:37 -0000 Thank you for the advices, however it turns out it was user error.. I = swapped the drive in from an apple machine, the new drive took ada0 and = my existing drive moved to ada1. I=E2=80=99m just playing with ZFS at the moment and what I didn=E2=80=99t = realise is that the system swap was still assigned to ada0p2 but of = course instead of being on my new ZFS drive was instead pointing to an = apple-hfs data partition on the freshly added drive. For some reason I assumed it was something to do with HFSFUSE and gpart = when in actual fact it was just me not paying attention to the basics! > On 16 Apr 2020, at 18:44, Harry Schmalzbauer > wrote: >=20 > 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 =E2=80=9CDevice Busy=E2=80=9D >> 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 >>=20 >> 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. >>=20 >> Here=E2=80=99s what I have tried so far: >>=20 >>=20 >> root@beastie:~ # gpart show >> =3D> 34 1250263661 ada0 GPT (596G) >> 34 409606 - free - (200M) >> 409640 1249591904 2 freebsd-ufs (596G) >> 1250001544 262151 - free - (128M) >>=20 >> =3D> 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) >>=20 >> root@beastie:~ # gpart delete -i2 ada0 >> gpart: Device busy > : > : >> : >> root@beastie:~ # gpart destroy -F ada0 >> gpart: Device busy >=20 > There might still be situations where 'sysctl kern.geom.debugflags=3D16'= 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). >=20 > -harry