Issue with gpart "Device Busy"
Harry Schmalzbauer
freebsd at omnilan.de
Thu Apr 16 17:44:50 UTC 2020
Am 15.04.2020 um 20:35 schrieb ian at 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 at 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 at beastie:~ # gpart delete -i2 ada0
> gpart: Device busy
:
:
> :
> root at 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
More information about the freebsd-stable
mailing list