OPNsense doesn't boot due to possible disk failure¶
zio_read error: 5
zfs: i/o error all block copies available
zfs can't read mos of pool zroot
can't find /boot/zfsloader
can't find /boot/loader
can't find /boot/kernel/kernel
Download the OPNsense vga image, write to usb and boot from it¶
{{< ref "docs/opnsense/install-opnsense.md#download-the-image-and-write-to-usb-device" >}}
zfs¶
Initially should be no pools available before importing
zpool status
no pools available
List the pools available
zpool import
pool: zroot
id: 15907498437198183935
state: ONLINE
action: The pool can be imported using its name or numeric identifier.
config:
zroot ONLINE
ada0p4 ONLINE
Check gpart shows the disk
gpart show # get a list of disks
gpart show ada0
=> 40 7814037088 ada0 GPT (3.6T)
40 532480 1 efi (260M)
532520 1024 2 freebsd-boot (512K)
533544 984 - free - (492K)
534528 16777216 3 freebsd-swap (8.0G)
17311744 7796723712 4 freebsd-zfs (3.6T)
7814035456 1672 - free - (836K)
Import the pool listed above read-only
zpool import -o readonly=on -f zroot
cannot mount '/zroot': failed to create mountpoint: Read-only file system
Import was successful, but unable to mount some datasets
Listing pools should now show the pool
zpool list
NAME SIZE ALLOC FREE CKPOINT EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT
zroot 3.62T 0 3.62T - - 0% 0% 1.00x ONLINE -
List available datasets
zfs list -r zroot
NAME USED AVAIL REFER MOUNTPOINT
zroot 3.37G 3.51T 96K /zroot
zroot/ROOT 1.18G 3.51T 96K none
zroot/ROOT/default 1.18G 3.51T 1.18G /
zroot/home 144K 3.51T 144K /home
zroot/tmp 1.12M 3.51T 1.12M /tmp
zroot/usr 1.71G 3.51T 96K /usr
zroot/usr/ports 892M 3.51T 892M /usr/ports
zroot/usr/src 858M 3.51T 858M /usr/src
zroot/var 465M 3.51T 96K /var
zroot/var/audit 96K 3.51T 96K /var/audit
zroot/var/crash 132K 3.51T 132K /var/crash
zroot/var/log 464M 3.51T 464M /var/log
zroot/var/mail 96K 3.51T 96K /var/mail
zroot/var/tmp 104K 3.51T 104K /var/tmp
mkdir /tmp/zroot
ls -la /tmp/zroot/
total 9
drwxr-xr-x 2 root wheel 2 Nov 12 18:04 .
drwxrwxrwt 6 root wheel 21 Nov 12 19:42 ..
At this point in the process I found out that the ZFS pool metadata on the disk is probably completely unreadable and I re-installed and restored from backup.