ZFS Cannot destroy geom using gpart

Hello everyone, I'm having trouble destroying the partitioning scheme of a drive I have just plugged into my home server setup, in order to increase the redundancy of a zpool containing a vdev of currently 2 mirrors.

From reading what I can find on this forum, I looked into /etc/fstab to make sure no partitions were listed in there, as well as verified whether a partition was somehow mounted and could not find anything.

The disk I am trying to destroy the partitioning scheme for is `/dev/da2`.



Code:
sysadmin@dagger:~ $ cat /etc/fstab
# Device                Mountpoint      FStype  Options         Dump    Pass#
/dev/gpt/efiboot0               /boot/efi       msdosfs rw              2       2
/dev/ada0p2.eli         none    swap    sw              0       0

sysadmin@dagger:~ $ zpool status
  pool: pylon
 state: ONLINE
config:

        NAME           STATE     READ WRITE CKSUM
        pylon          ONLINE       0     0     0
          mirror-0     ONLINE       0     0     0
            da0p1.eli  ONLINE       0     0     0
            da1p1.eli  ONLINE       0     0     0

errors: No known data errors

  pool: zroot
 state: ONLINE
config:

        NAME          STATE     READ WRITE CKSUM
        zroot         ONLINE       0     0     0
          ada0p3.eli  ONLINE       0     0     0

errors: No known data errors

sysadmin@dagger:~ $ dmesg
da2 at umass-sim2 bus 2 scbus9 target 0 lun 0
da2: <Seagate One Touch HDD 1708> Fixed Direct Access SPC-4 SCSI device
da2: Serial Number 00000000NABM68YL
da2: 400.000MB/s transfers
da2: 1907729MB (3907029167 512 byte sectors)
da2: quirks=0x2<NO_6_BYTE>
sysadmin@dagger:~ $ doas gpart destroy /dev/da2
gpart: Device busy
sysadmin@dagger:~ $

I'm pretty sure that passing the `-f` flag would do what I want, but I would like to understand what is holding up the destroy operation beforehand.


Any pointers would be appreciated,

Thanks in advance for your time :)
 
Code:
sysadmin@dagger:~ $ doas gpart show da2
=>        34  3907029100  da2  GPT  (1.8T)
          34           6       - free -  (3.0K)
          40      409600    1  efi  (200M)
      409640  3906619488    2  apple-apfs  (1.8T)
  3907029128           6       - free -  (3.0K)
 
Are you doing this from within a GUI environment? A lot of the DEs have an automount process that will try to mount removable devices for you. Maybe output of "mount | grep -i da0" will tell you.
 
Are you doing this from within a GUI environment? A lot of the DEs have an automount process that will try to mount removable devices for you. Maybe output of "mount | grep -i da0" will tell you.
No, I am logged in via ssh, and there is not even xorg or wayland on this machine.
Code:
sysadmin@dagger:~ $ mount | grep da2
sysadmin@dagger:~ $
 
gpart show -l da2
mount -p

Code:
sysadmin@dagger:~ $ gpart show -l da2
=>        34  3907029100  da2  GPT  (1.8T)
          34           6       - free -  (3.0K)
          40      409600    1  EFI System Partition  (200M)
      409640  3906619488    2  (null)  (1.8T)
  3907029128           6       - free -  (3.0K)

sysadmin@dagger:~ $ mount -p
zroot/ROOT/default      /                       zfs     rw,noatime,nfsv4acls    0 0
devfs                   /dev                    devfs   rw              0 0
/dev/gpt/efiboot0       /boot/efi               msdosfs rw              2 2
zroot                   /zroot                  zfs     rw,noatime,nfsv4acls    0 0
zroot/home              /home                   zfs     rw,noatime,nfsv4acls    0 0
zroot/tmp               /tmp                    zfs     rw,nosuid,noatime,nfsv4acls     0 0
zroot/var/audit         /var/audit              zfs     rw,noexec,nosuid,noatime,nfsv4acls      0 0
zroot/var/crash         /var/crash              zfs     rw,noexec,nosuid,noatime,nfsv4acls      0 0
zroot/usr/src           /usr/src                zfs     rw,noatime,nfsv4acls    0 0
zroot/var/log           /var/log                zfs     rw,noexec,nosuid,noatime,nfsv4acls      0 0
zroot/home/rcomeau      /home/rcomeau           zfs     rw,noatime,nfsv4acls    0 0
zroot/usr/ports         /usr/ports              zfs     rw,nosuid,noatime,nfsv4acls     0 0
zroot/var/mail          /var/mail               zfs     rw,nfsv4acls    0 0
zroot/var/tmp           /var/tmp                zfs     rw,nosuid,noatime,nfsv4acls     0 0
zroot/home/sysadmin     /home/sysadmin          zfs     rw,noatime,nfsv4acls    0 0
pylon                   /pylon                  zfs     rw,nfsv4acls    0 0
pylon/backups           /pylon/backups          zfs     rw,nfsv4acls    0 0
pylon/backups/dagger/home /pylon/backups/dagger/home zfs        rw,nfsv4acls    0 0
pylon/backups/dagger/home/rcomeau /pylon/backups/dagger/home/rcomeau zfs        ro,noatime,nfsv4acls    0 0
pylon/backup            /pylon/backup           zfs     rw,nfsv4acls    0 0
sysadmin@dagger:~ $
 
Back
Top