Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 17 Apr 2020 00:00:27 +0100
From:      ian@dijix.com
To:        freebsd-stable@freebsd.org
Subject:   Re: Issue with gpart "Device Busy"
Message-ID:  <49390CCC-7687-41C8-BACD-C24D103EFFFF@dijix.com>
In-Reply-To: <2a7532fd-6fee-deb6-c133-6150aaf1b8c2@omnilan.de>
References:  <3BF9F702-81FD-4156-B6A2-E32C549ACA90@dijix.com> <2a7532fd-6fee-deb6-c133-6150aaf1b8c2@omnilan.de>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <freebsd@omnilan.de =
<mailto:freebsd@omnilan.de>> wrote:
>=20
> Am 15.04.2020 um 20:35 schrieb ian@dijix.com <mailto: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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?49390CCC-7687-41C8-BACD-C24D103EFFFF>