Last Sunday I had a problem with my TrueNAS pool, I was transferring a VM from my Proxmox server to a shared folder in the pool (composed of 2 4tb mirrored HD’s in an external case connected to the PC via USB-C), but I don’t know what happened that TrueNAS restarted in the middle of the transfer and since then I can’t boot with the HD’s plugged in, without the HD’s the TrueNAS system comes up without problems, but after the system comes up I plug them in again and they appear so that the pool can be imported, but when I try to import the pool again it gives a Kernel Panic error and reboots (image attached). Has anyone experienced this problem? Any ideas on how to solve it? Or will I have to format and start from scratch by making a new pool?
Short answer, based on the panic I’d say data should be okay for the most part, this is an issue that has been hit a couple of times here. Seems to be a fair bit more common on systems with Non-ECC memory.
See: ZFS Pool 'Data' Causes Kernel Panic for a much more in-depth discussion on this.
First try importing the pool readonly. If that fails then you are probably out of luck.
zpool import tank -R /mnt -o readonly=on (you can try again adding -F if it fails the first time around).
If it’s able to import you should be able to try importing after setting sudo echo 1 > /sys/module/zfs/parameters/zfs_recover and let it run for a day or two. Then reboot and hopefully it should be able to import normally without zfs_recover enabled.
If you haven’t already, I’d proritize making sure you have proper backups in place for sensitive data.
Thank you for your help… I ran the first command and it recovered the dataset, but in the storage tab it is empty and there is no longer an option to import the pool, accessing via ssh/terminal the folders appear, but as soon as I reboot the dataset is not fixed and all the data disappears… Is there any other command to fix the data in the storage?
Update… After importing, I ran the zpool scrub [pool name] command and got the kernel panic error… I tried the second command, but it only ran under “sudo su” and didn’t give an error, but it ran in miniseconds and didn’t make any difference, because I repeated the whole process I mentioned earlier and got the same results, after the reboot everything disappears… I have the screenshots to illustrate, but I can’t attach the forum message.
Because you are importing it readonly, and middleware is not fully aware of the pool as it’s been imported via CLI.
As you’ve confirmed it is importing readonly, run sudo echo 1 > /sys/module/zfs/parameters/zfs_recover then attempt to import via the WebUI. If that works okay, then leave it imported like that for a day or two and then after that, give it a reboot and see if all is okay.
I ran the commands as you said, but unfortunately it didn’t work, when I try to import the pool I get the same screen… With the end…
Call Trace:
126.447995] dumo_stack_1v1+0x47/0x60
126.448223 panic+0x345/0x360
126.4485391 spl_panic+0xfb/0x120 [sol]
126.448878] metaslab_load_impl+0x381/0x8c0 [zfs]
126.449658] metaslab_load+0xa9/0x1b0 [zfs]
126.450393] metaslab_preload+0x7f/0x150 [zfs]
126.451117] taskq_thread+0x281/0x5b0 [spl]
126.4514781 ? __pfx_default_wake_funct ion+0x10/0x10
126.451821] ? __pfx_taskg_thread+0x10/0x10 [spl]
126.452224] kthread+0xe8/0x120
126.452604] ? __pfx_kthread+0x10/0x10
126.452984] ret_from_fork+0x34/0x50
126.453332] ? __pfx_kthread+0x10/0x10
126.453670 ret_from_fork_asm+0x1b/0x30
126 .454014]
Kernel Offset: disable
pstore: backend (efi_pstore) writing error (-5)
Rebooting in 10 seconds…
I’ve almost given up! ![]()
That shouldn’t be possible, zfs_recover should suppress ZFS panics and output them as warnings. To my knowledge the WebUI shouldn’t do anything to this on import attempt, but we can try purely via CLI.
Can you run sudo echo 1 > /sys/module/zfs/parameters/zfs_recover, then cat /sys/module/zfs/parameters/zfs_recover just to confirm it is set.
Then try importing via CLI, sudo zpool import tank -R /mnt - middleware should pick it up, but if it doesn’t try giving it a restart with sudo systemctl restart middlewared
I ran the commands…
truenas_admin@truenas[~]$ cd /mnt
truenas_admin@truenas[/mnt]$ ls
truenas_admin@truenas[/mnt]$ sudo su
root@truenas[/mnt]# ls
root@truenas[/mnt]# sudo echo 1 > /sys/module/zfs/parameters/zfs_recover
root@truenas[/mnt]# cat /sys/module/zfs/parameters/zfs_recover
1
root@truenas[/mnt]# sudo systemctl restart middlewared
root@truenas[/mnt]# sudo zpool import TrueNAS-Lima -R /mnt
After this last command, Putty crashed and the TrueNAS screen displayed the same error.
Call Trace:
126.447995] dumo_stack_1v1+0x47/0x60
126.448223 panic+0x345/0x360
126.4485391 spl_panic+0xfb/0x120 [sol]
126.448878] metaslab_load_impl+0x381/0x8c0 [zfs]
126.449658] metaslab_load+0xa9/0x1b0 [zfs]
126.450393] metaslab_preload+0x7f/0x150 [zfs]
126.451117] taskq_thread+0x281/0x5b0 [spl]
126.4514781 ? __pfx_default_wake_funct ion+0x10/0x10
126.451821] ? __pfx_taskg_thread+0x10/0x10 [spl]
126.452224] kthread+0xe8/0x120
126.452604] ? __pfx_kthread+0x10/0x10
126.452984] ret_from_fork+0x34/0x50
126.453332] ? __pfx_kthread+0x10/0x10
126.453670 ret_from_fork_asm+0x1b/0x30
126 .454014]
Kernel Offset: disable
pstore: backend (efi_pstore) writing error (-5)
Rebooting in 10 seconds…
I think that’s it for today, come tomorrow with a fresh head we’ll think of something new or I’ll throw this pc against the wall and start from scratch.
Where you able to resolve this?
