# "ZFS: zfs_alloc()/zfs_free() mismatch" Problem with 8.2 Stable



## zodias (Apr 8, 2012)

Hello everyone,

I had set up a raidz2 ZFS on ROOT system with 4 SATA disks. Every disk has 64k freebsd-boot, 30G freebsd-zfs and freebsd-ufs for the rest space. I did it with the gpart utility.

One of the disks failed and I offlined the the faulty 30G partition. The system worked with no known data errors. After reboot I see this message:


```
ZFS: zfs_alloc()/zfs_free() mismatch
```

and the system goes no further.

I booted with FreeBSD 9.0-RELEASE usb stick, imported the pool which did scrub by himself somehow. After the scrubbing finished all seemed ok, but after reboot I see the message again.

The system is FreeBSD 8.2-STABLE AMD64 with 4GB RAM.

Interesting to note is that this is my second issue with a faulted disk. However if I replace healthy HDD for upgrading purposes, everything passes fluently.

What can I do to bring the system up without reinstalling everything again?

Best Regards!


----------



## zodias (Apr 17, 2012)

I did a clean install.

Can anyone give an advice how to prevent such a malfunction in the future?

Best Regards!


----------



## zodias (May 10, 2012)

Today I replaced another failed HDD on another machine and everything is normal. This time I powered off the machine directly instead of offlining the partition first.


----------



## bjer (Oct 2, 2021)

Got the same issue when trying to upgrade from 13.0p2 -> p4. Solved by updating boot code https://stafwag.github.io/blog/blog/2021/05/09/update-bootloader-freebsd13/


----------

