From owner-freebsd-stable@freebsd.org Wed Apr 15 18:35:47 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 D0DB62BE6A9 for ; Wed, 15 Apr 2020 18:35:47 +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 492WJL67sGz4CvZ for ; Wed, 15 Apr 2020 18:35:46 +0000 (UTC) (envelope-from ian@dijix.com) Received: from smtp2.mail.stackcp.net ([10.4.72.76] helo=smtp2.n4.stackcp.net) by relay1.stackmail.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.3) (envelope-from ) id 1jOmst-0008Ac-BX for freebsd-stable@freebsd.org; Wed, 15 Apr 2020 19:35:39 +0100 Received: from 156.91.90.146.dyn.plus.net ([146.90.91.156] helo=[10.0.1.33]) by smtp2.n4.stackcp.net with esmtpa (Exim 4.92.3) (envelope-from ) id 1jOmss-0001f1-T5 for freebsd-stable@freebsd.org; Wed, 15 Apr 2020 19:35:39 +0100 From: ian@dijix.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.14\)) Subject: Issue with gpart "Device Busy" Message-Id: <3BF9F702-81FD-4156-B6A2-E32C549ACA90@dijix.com> Date: Wed, 15 Apr 2020 19:35:30 +0100 To: freebsd-stable@freebsd.org X-Mailer: Apple Mail (2.3445.104.14) X-Authenticated-Sender: ian@dijix.com X-Scan-Signature: 75756f6eedebadc553e53682dba89094 X-Rspamd-Queue-Id: 492WJL67sGz4CvZ 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 [4.05 / 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)[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.75), asn: 31727(2.14), country: GB(-0.07)]; NEURAL_SPAM_MEDIUM(0.91)[0.914,0]; NEURAL_SPAM_LONG(0.97)[0.968,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:+]; 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] 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: Wed, 15 Apr 2020 18:35:47 -0000 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. Here=E2=80=99s what I have tried so far: root@beastie:~ # gpart show =3D> 34 1250263661 ada0 GPT (596G) 34 409606 - free - (200M) 409640 1249591904 2 freebsd-ufs (596G) 1250001544 262151 - free - (128M) =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) root@beastie:~ # gpart delete -i2 ada0 gpart: Device busy root@beastie:~ # gpart add -t freebsd-boot ada0 ada0p1 added root@beastie:~ # gpart show =3D> 34 1250263661 ada0 GPT (596G) 34 409606 1 freebsd-boot (200M) 409640 1249591904 2 freebsd-ufs (596G) 1250001544 262151 - free - (128M) =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) root@beastie:~ # gpart delete -i2 ada0 gpart: Device busy root@beastie:~ # gpart delete -i1 ada0 ada0p1 deleted root@beastie:~ # gpart show =3D> 34 1250263661 ada0 GPT (596G) 34 409606 - free - (200M) 409640 1249591904 2 freebsd-ufs (596G) 1250001544 262151 - free - (128M) =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) root@beastie:~ # gpart destroy -F ada0 gpart: Device busy root@beastie:~ # gpart modify -i2 -t freebsd-boot ada0 ada0p2 modified root@beastie:~ # gpart show =3D> 34 1250263661 ada0 GPT (596G) 34 409606 - free - (200M) 409640 1249591904 2 freebsd-boot (596G) 1250001544 262151 - free - (128M) =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) I=E2=80=99m not sure where to go from here, I=E2=80=99m tempted to pull = the drive and reformat elsewhere I have all tried dd=E2=80=99ing the disk as root but dd /dev/ada0 errors = with unauthorised. Am I missing something obvious?