Reinstalling OPNsense 25.7 on a ZFS Disk? ("No Disks Present" / "Device Busy")

Started by vivekmauli14, September 19, 2025, 07:22:52 AM

Previous topic - Next topic
On a previosuly installed opnsense 25.7 when I booted into the 25.7 installer for reinstalling, it would fail with errors like "No disks present". When I dropped into the live shell to wipe the disk manually, I hit a wall of errors:

gpart destroy failed with Device busy

zpool destroy -f zroot failed with pool or dataset is busy

Even the low-level dd command failed with Operation not permitted

I was completely locked out from touching the internal hard drive, even as root. This was new to me; I've reinstalled older versions like 24.7 on many devices before without ever seeing this kind of stubborn lock.

How do I smoothly reinstall the machine without needing of another bootables of Gpart for drive cleaning ?

Thanks

What does zpool status say in the live shell?
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

Hi Patrick,

My zpool status returns this :

root@Marge:~ # zpool status
  pool: zroot
 state: ONLINE
config:

        NAME        STATE     READ WRITE CKSUM
        zroot       ONLINE       0     0     0
          ada0p4    ONLINE       0     0     0

errors: No known data errors
root@opnsense:~ #


Also am I the only one facing this issue while reinstalling?

Then type "mount" please and post the output.
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)


Please post the output here, I am not clicking on obscure external links. You can attach images right in the forum. Also I block so called "image hosting" services.
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

Oh alright:

Here it is:



root@Marge:~ # mount
/dev/iso9660/OPNSENSE_INSTALL on / (cd9660, local, read-only)
devfs on /dev (devfs)
tmpfs on /tmp (tmpfs, local)
zroot/tmp on /tmp (zfs, local, noatime, nosuid, nfsv4acls)
zroot/usr/src on /usr/src (zfs, local, noatime, nfsv4acls)
zroot/var/mail on /var/mail (zfs, local, nfsv4acls)
zroot/home on /home (zfs, local, noatime, nfsv4acls)
zroot/var/audit on /var/audit (zfs, local, noatime, noexec, nosuid, nfsv4acls)
zroot/var/crash on /var/crash (zfs, local, noatime, noexec, nosuid, nfsv4acls)
zroot/var/log on /var/log (zfs, local, noatime, noexec, nosuid, nfsv4acls)
zroot/var/tmp on /var/tmp (zfs, local, noatime, nosuid, nfsv4acls)
<above>:/tmp/.cdrom/boot on /boot (unionfs, local, noatime, nosuid, nfsv4acls)
<above>:/tmp/.cdrom/conf on /conf (unionfs, local, noatime, nosuid, nfsv4acls)
<above>:/tmp/.cdrom/etc on /etc (unionfs, local, noatime, nosuid, nfsv4acls)
<above>:/tmp/.cdrom/home on /home (unionfs, local, noatime, nosuid, nfsv4acls)
<above>:/tmp/.cdrom/root on /root (unionfs, local, noatime, nosuid, nfsv4acls)
<above>:/tmp/.cdrom/usr on /usr (unionfs, local, noatime, nosuid, nfsv4acls)
<above>:/tmp/.cdrom/var on /var (unionfs, local, noatime, nosuid, nfsv4acls)
devfs on /var/dhcpd/dev (devfs)
devfs on /var/unbound/dev (devfs)
/usr/local/lib/python3.11 on /var/unbound/usr/local/lib/python3.11 (nullfs, local, read-only)
/lib on /var/unbound/lib (nullfs, local, read-only)
root@Marge:~ #



The zpool is imported/mounted as I suspected. That is why you cannot overwrite it.

Try

zpool export zroot
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

It says:

root@OPNsense:~ # zpool export zroot
cannot unmount '/var/log': pool or dataset is busy
root@OPNsense:~ #

and for every try got this device busy error.

Do I need to rename the default dataset for this from zroot to something else?

I would boot into something different from the OPNsense installer - plain FreeBSD or Linux - and wipe the disk with dd at this stage.

I don't know why the installer would import an existing pool.
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)