Solved destroying old zroot device - device is busy

I had proxmox on my WS, moved to FreeBSD as hypervisor and now i have a pickle.
Code:
# zpool status
  pool: zroot
 state: ONLINE
config:

        NAME        STATE     READ WRITE CKSUM
        zroot       ONLINE       0     0     0
          mirror-0  ONLINE       0     0     0
            ada2p3  ONLINE       0     0     0
            ada3p3  ONLINE       0     0     0
            nda4p3  ONLINE       0     0     0

errors: No known data errors
Device i want to destroy to make a new pool:
Code:
# lsblk
DEVICE         MAJ:MIN SIZE TYPE                                          LABEL MOUNT
ada0             0:190 447G GPT                                               - -
  ada0p1         0:191 260M efi                                    gpt/efiboot0 /boot/efi
  <FREE>         -:-   1.0M -                                                 - -
  ada0p2         0:192  12G freebsd-swap                              gpt/swap0 -
  ada0p3         0:193 435G freebsd-zfs                                gpt/zfs0 <ZFS>
  <FREE>         -:-   836K -                                                 - -
ada1             0:197 466G -                                                 - -
gpart destory -F ada0 gives me error: Device is busy.
fstab
Code:
/dev/gpt/efiboot0 /boot/efi msdosfs rw 2 2
/dev/ada2p2 none swap sw 0 0
/dev/ada3p2 none swap sw 0 0
/dev/nda4p2 none swap sw 0 0
gpart show ada0
Code:
# gpart show ada0
=>       40  937703008  ada0  GPT  (447G)
         40     532480     1  efi  (260M)
     532520       2008        - free -  (1.0M)
     534528   25165824     2  freebsd-swap  (12G)
   25700352  912001024     3  freebsd-zfs  (435G)
  937701376       1672        - free -  (836K)
Im guessing my ada0 device is being used ?
P.s. My ada0 device was direct pcie passtrough to Proxmox VM so i used my 2 devices ada0 and ada1 as physical devices in FreeBSD VM and created zfs mirror.
ada1 got destroyed by gpart command but ada0 - not.
 
Maybe /dev/ada0p1 is the one with the efiboot gpt label and gets mounted by fstab?

Check it with: % gpart show -l ada0
 
Last edited:
Maybe ada0p1 is the one with the efiboot got label and gets mounted by fstab?

Check it with: gpart show -l ada0
Looking at LSBLK command i provided - it is used/mounted
Code:
gpart show -l ada0
=>       40  937703008  ada0  GPT  (447G)
         40     532480     1  efiboot0  (260M)
     532520       2008        - free -  (1.0M)
     534528   25165824     2  swap0  (12G)
   25700352  912001024     3  zfs0  (435G)
  937701376       1672        - free -  (836K)
full LSBLK
Code:
lsblk
DEVICE         MAJ:MIN SIZE TYPE                                          LABEL MOUNT
ada0             0:190 447G GPT                                               - -
  ada0p1         0:191 260M efi                                    gpt/efiboot0 /boot/efi
  <FREE>         -:-   1.0M -                                                 - -
  ada0p2         0:192  12G freebsd-swap                              gpt/swap0 -
  ada0p3         0:193 435G freebsd-zfs                                gpt/zfs0 <ZFS>
  <FREE>         -:-   836K -                                                 - -
ada1             0:197 466G -                                                 - -
ada2             0:198 233G GPT                                               - -
  ada2p1         0:199 260M efi                                    gpt/efiboot0 -
  <FREE>         -:-   1.0M -                                                 - -
  ada2p2         0:200  12G freebsd-swap                              gpt/swap0 SWAP
  ada2p3         0:201 221G freebsd-zfs                                gpt/zfs0 <ZFS>
  <FREE>         -:-   164K -                                                 - -
ada3             0:214 233G GPT                                               - -
  ada3p1         0:215 260M efi                                    gpt/efiboot1 -
  <FREE>         -:-   1.0M -                                                 - -
  ada3p2         0:216  12G freebsd-swap                              gpt/swap1 SWAP
  ada3p3         0:217 221G freebsd-zfs                                gpt/zfs1 <ZFS>
  <FREE>         -:-   164K -                                                 - -
da0              1:12  3.6T zfs                                               - -
nda0             0:151 466G -                                                 - -
nda1             0:158 466G -                                                 - -
nda2             0:165 466G -                                                 - -
nda3             0:172 466G -                                                 - -
nda4             0:179 233G GPT                                               - -
  nda4p1         0:181 260M efi                                    gpt/efiboot2 -
  <FREE>         -:-   1.0M -                                                 - -
  nda4p2         0:183  12G freebsd-swap                              gpt/swap2 SWAP
  nda4p3         0:185 221G freebsd-zfs                                gpt/zfs2 <ZFS>
  <FREE>         -:-   164K -                                                 - -
I think i need somehow to make sure other drives are mounted.
I know i can just wipe all the drives and re-install OS but i want to experience without re-install.
 
And that's why you're unable to destroy the partition. Make sure that you have recovery media or additional efi partition, then unmount the mounted efi partition and try destroying the disk again

Was there a particular reason why did loader used ada0 ?
because it had FreeBSD or because it was the first drive or i missed something during the install ?
 
Was there a particular reason why did loader used ada0 ?
because it had FreeBSD or because it was the first drive or i missed something during the install ?
I think that there were a FreeBSD installation done on ada0. Installer should install an efi partition to the drive you are going to install FreeBSD.
 
Back
Top