Solved How to boot when bootloader is gone

It is the case that we have lost drives and reshuffled spindles and now lost power and upon power-up the boot loader is missing.

It appears that the replacement zfs spindle is now mounting as da3 and da0 has become another part of the file system. We are still running 10.2 [sigh] and we have successfully booted with the FreeBSD 10.2 LiveCD and we can mount the zfs root.

Is there a way to specify the zfs pool's kernel and continue to boot using the USB LiveCD's bootloader?

We have attempted to load the kernel and opensolaris.ko and zfs.ko from the USB stick but the command lszfs is not available and if I attempt to run:
boot zfs:zroot/ROOT/default/boot/kernel the error is "cannot find kernel"

We want to try and boot the beast manually before we try and fix the boot mechanism.
 
Thanks for that (and we managed to reboot the beast finally), but for the record I'm asking how one would boot directly from the LiveCD's bootloader command prompt.

Similar to GRUB, I'm thinking there is a way to invoke a zfs kernel via the LiveCD? (e.g. boot zfs:zroot/ROOT/default/boot/kernel)

Why? Because this was (is) a production machine built and maintained by someone else and I wanted to perform a non-invasive proof-of-concept boot before we started writing things to disk.

Documented in loader(8) there is listed a bunch of useful commands ( lszfs, etc.), but I couldn't get any of them to work. Presumably I needed to load the zfs.ko module (we did that); but I still could not successfully invoke any zfs commands.
 
Documented in loader(8) there is listed a bunch of useful commands ( lszfs, etc.), but I couldn't get any of them to work.
You’re looking at the wrong manual page, I’m afraid. You’re using FreeBSD 10.2, so please have a look at the manual page of loader(8) in FreeBSD 10.2. You’ll notice that it does not mention ZFS at all.

It’s been five years, but if I remember correctly, FreeBSD’s boot strap did not support ZFS at that time. You needed to have a small UFS boot partition that contained the loader and the kernel, along with any kernel modules required for booting (including the ZFS module).

Note that FreeBSD 10.2 went EOL (End-Of-Life) in 2016. In other words, it did not receive security updates for four years. You may want to take a look at the list of security advisories that have been published in these four years, but please sit down when you do so, or otherwise you might fall over. It’s probably a good idea to update that machine to a supported release before doing anything else with it, especially before connecting it to a network.
Presumably I needed to load the zfs.ko module (we did that); but I still could not successfully invoke any zfs commands.
That’s a kernel module. It does not change the feature set of the loader.
 
That makes sense, thank you.

I tried many times to convince folks to upgrade; but it's a production mail server and everyone was too timid (mostly a Linux house). At this stage the machine is being replaced; so it still won't be upgraded.

But I'm correct in understanding that if we had used a 12.3 LiveCD, we would have been able to boot it directly?
 
But I'm correct in understanding that if we had used a 12.3 LiveCD, we would have been able to boot it directly?
I’m not sure. Maybe, maybe not. It depends on the kind of damage that happened to your machine, and how it was installed. If the UFS boot partition is unavailable, then there is no kernel to boot, unless you have a copy of the kernel on the ZFS root file system. In this case you could try booting it, using the LiveCD’s loader. But it’s probably not a trivial task.

Another thing that comes to my mind – You could try booting the 12.x kernel from the LiveCD and using the root file system from your machine. That won’t be trivial either, and I’m not sure if it really can work. I don’t know if the LiveCD’s kernel includes the “compatX” features, so the 12.x kernel might not be able to run binaries from a 10.2 system.
 
Back
Top