Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 15 Apr 2020 19:35:30 +0100
From:      ian@dijix.com
To:        freebsd-stable@freebsd.org
Subject:   Issue with gpart "Device Busy"
Message-ID:  <3BF9F702-81FD-4156-B6A2-E32C549ACA90@dijix.com>

next in thread | raw e-mail | index | archive | help
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?





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3BF9F702-81FD-4156-B6A2-E32C549ACA90>