How to Switch drives during Bootstrap

I do have an old HP Microserver Gen8. The Standard is, to boot from the first disk (drive C) in the 4 Drive Cage. So i Build in an additional ssd - which is disk5 - and Boot from an installed sd-card. In the past I used GRUB to switch to the disk5 (zfs). Now the sd-card is broken (no backup :( ) and I need to setup the boot process again. This time I want to use the full BSD bootstrap.
But it is challenging: I thought I only need boot0 and could interrupt the boot process to select a different disk.
Seems that is not working as only the sd-card is searched for the next boot steps. I’m not sure if I could switch the disks before the loader ?
I reviewed boot0cfg(), but seems that here I also can’t config boot0 to use a different disk. Also /boot.config seems to need a root fs , which is currently only available on disk5 (ada4) . So the example in boot.config() will write on ada4 and not on the boot drive (da0).
Is there any other possibility ? Or do I need to boot until the loader is coming up ?
 
I do have an old HP Microserver Gen8. The Standard is, to boot from the first disk (drive C) in the 4 Drive Cage. So i Build in an additional ssd - which is disk5 - and Boot from an installed sd-card. In the past I used GRUB to switch to the disk5 (zfs). Now the sd-card is broken (no backup :( ) and I need to setup the boot process again. This time I want to use the full BSD bootstrap.
But it is challenging: I thought I only need boot0 and could interrupt the boot process to select a different disk.
Seems that is not working as only the sd-card is searched for the next boot steps. I’m not sure if I could switch the disks before the loader ?
I reviewed boot0cfg(), but seems that here I also can’t config boot0 to use a different disk. Also /boot.config seems to need a root fs , which is currently only available on disk5 (ada4) . So the example in boot.config() will write on ada4 and not on the boot drive (da0).
Is there any other possibility ? Or do I need to boot until the loader is coming up ?
You could delete or rename /etc/fstab and then you should get a 'mountroot' prompt when you boot and then specfify the device, ie /dev/ada3s2 for example.

Just a suggestion.
 
You could delete or rename /etc/fstab and then you should get a 'mountroot' prompt when you boot and then specfify the device, ie /dev/ada3s2 for example.

Just a suggestion.
Hmm, that would be after or within the loader stage. I think there I just could advice the loader to mount a different disk as root.
I thought I could step in during one of the boot blocks and only need boot0 on the sd-card ( and not a full boot system )
Maybe I need a full boot system on the sd-card, but write /boot.config also on it. That might switch from the boot blocks on sd-card to the right disk and then execute the loader from that disk. Will give it a try….
 
Does the machine have BIOS or UEFI?

Doesn't the server have a "Boot Menu" to choose the boot disk (to call, press F9 on HP, if I'm not mistaken )? Or set the BIOS/UEFI boot order to disk5 first in the list.
It has a BIOS
Yes, it has a boot menu, but doesn’t allow to select the disk. It allows USB, Px, CD, or the first disk, which is always the first drive in the cage. I use the four drives in the cage for a Z-RAID and gave installed an addition SSD as CD ROM replacement. But there is no direct possibility to boot from the SSD.
 
It's a great little server. Why not just re-install it on new disks and migrate data to these?
I don’t have a problem with the installed disks. It worked fine to use a small Linux on the sd-card together with GRUB. Grub then started FreeBSD from the 5th disk. Worked all very well until ILo smashed the sd-card with logs.
As I don’t remember how I had setup GRUB 10 years ago, I thought would be easier to use now boot0 as boot manager .
 
BIOS → boot0 → boot1 → boot2 → loader → kernel
Yepp, now how it should work:
BIOS -> sd-card / boot0 -> disk5 / boot1 til kernel

It looks like the understanding of a boot manager is a bit different inside FreeBSD: boot0 can only handle over to boot blocks on the same device. At least I have not seen a cmd or better configuration that allow to call boot1 or boot2 on a different device.
This may only work with a /boot.config on the root filesystem if the sd-card - which means you will need a min-memstick img on the sd-card.

PS: the boot-only image is on a CD9660 FS and only read-only. Therefore you can’t put a
/boot.config on it
 
PS: the boot-only image is on a CD9660 FS and only read-only. Therefore you can’t put a
/boot.config on it
Putting a file on a iso wouldn't be a problem, just extract the image, add /boot.config, recreate the iso:

bsdinstall(8)
Rich (BB code):
   BUILDING AUTOMATIC INSTALL MEDIA
     If building automatic install media, use tar to extract a release ISO:
           mkdir release-media
           tar -C release-media -xvf FreeBSD-13.0-RELEASE-amd64-disc1.iso

     Then place a script as above in etc/installerconfig

     This directory can then be used directly as an NFS root for diskless(8)
     installations or it can be rebuilt into an ISO image using the release
     scripts in /usr/src/release.  For example, on amd64:
           sh /usr/src/release/amd64/mkisoimages.sh -b '13_0_RELEASE_AMD64_CD'
           output.iso release-media
Populated /usr/src is required.
 
It’s now partial solved. I have booted a live system to access the sd-card and be able to make changes
The sd-card is under /dev/da0 accessible. My additional SSD as disk 5 (/ada4 with ada4p1(freebsd-boot), ada4p2(freebsd-swap), ada4p3 (freebsd-zfs). The zfs root pool is zroot and managed with bectl.
Bash:
gpart destroy /dev/da0
gpart create -s GPT /dev/da0
gpart add -a 1m -s 500kb -t freebsd-boot /dev/da0
gpart bootcode -b /boot/pmbr -d /boot/gptzfsboot -i 1 /dev/da0
Booting the server will stop at the boot2 phase with:

>> FreeBSD/i386 BOOT
Default: disk-1:/boot/loader not found
boot:

Entering:
zfs:zroot/ROOT/default: will continue the boot process with the loader. So the server is up and running again.

Now I need to automate this -> which was a bit easier in legacy GRUB. I have read that /boot.config is written into an ‘a’ slice , which is not available on a GPT partition.
 
It's a great little server…..
BTW: I would not recommend that server again: the build in ILO4 is crab. It needs regular multiple patches for security and it writes on the sd-card regardless of the setup. It is impossible to disable ILO, even when you do so in the setup (F8). It will enable itself again. In a former Gen7 server you could remove the ipmi card and get rid of this backdoor - ok, you need to walk to the server-cellar to restart. But a bit sports is always welcome
 
Booting the server will stop at the boot2 phase with:
Code:
>> FreeBSD/i386 BOOT
Default: disk-1:/boot/loader not found
boot:

Entering:
zfs:zroot/ROOT/default: will continue the boot process with the loader. So the server is up and running again.
This behavior looks like a bug. According to gptzfsboot(8)
Rich (BB code):
BOOTING
     gptzfsboot tries to find all ZFS pools that are composed of BIOS-visible
     hard disks or partitions on them.  gptzfsboot looks for ZFS device labels
     on all visible disks and in discovered supported partitions for all
     supported partition scheme types.  The search starts with the disk from
     which gptzfsboot itself was loaded.  Other disks are probed in BIOS
     defined order.  After a disk is probed and gptzfsboot determines that the
     whole disk is not a ZFS pool member, the individual partitions are probed
     in their partition table order.  Currently GPT and MBR partition schemes
     are supported.  With the GPT scheme, only partitions of type freebsd-zfs
     are probed.  The first pool seen during probing is used as a default boot
     pool.

I've tested in a VM, gptzfsboot(8) doesn't find the loader in a Z file system on other disks as described in the manual. All tested gptzfsboot(8) bootcode from 14.3R, 15,0R and 16-CURRENT show the same behavior.

In the test cases, I had to define the loader from a ZFS as zfs:zroot/ROOT/default:/boot/loader at the boot prompt.
 
Back
Top