USB boot disk

Apologies if this has been asked before. I couldn't find a whole lot of information.

Moving some disk arounds on a system. I believe it's BIOS boot running GPT layout with a UFS root disk.

I'd like to move the root onto an nvme disk. Now, the board cannot boot this directly. But is usable once you get into the system. I'm considering sticking a boot volume onto a USB flash drive and effectively handing off to the nvme drive which would have the rest of the system installation and swap.

What might be a good approach for something like that?
 
In theory you would only need a working freebsd-boot partition on the USB stick. Once gptboot(8) is active it might be able to pick up the NVMe drive and continue booting (loading the kernel and root filesystem).
 
In theory you would only need a working freebsd-boot partition on the USB stick. Once gptboot(8) is active it might be able to pick up the NVMe drive and continue booting (loading the kernel and root filesystem).
So I could clone the freebsd-boot partition onto a flash drive. And it'll just sort of figure it out? I'm assuming it searches for a good install then. I'll check it out.
 
gptboot(8) scans the disk looking for freebsd-ufs partitions. I'm not entirely sure it would scan all disks or just the one it booted from. And I'm not entirely sure gptboot(8) will recognize the NVMe drives if the BIOS doesn't detect them. But this is all easy enough to try. And even if you need more, you're still going to need this partition to be able to boot at all.

You don't need to 'clone' the partition, you can create a new freebsd-boot partition. Keep in mind that it has a size limit and cannot be larger than 540? KB; the installer typically creates a 512K sized partition, that should more than suffice. Then simply dd(1) the contents of gptboot(8) to the partition ( dd if=/boot/gptboot of=/dev/daXp1). Or use gpart(8); gpart bootcode -b /boot/pmbr -p /boot/gptboot -i 1 daX. The partition is simply read and copied to memory as-is, then executed.
 
You don't need to 'clone' the partition, you can create a new freebsd-boot partition. Keep in mind that it has a size limit and cannot be larger than 540? KB; the installer typically creates a 512K sized partition, that should more than suffice. Then simply dd(1) the contents of gptboot(8) to the partition ( dd if=/boot/gptboot of=/dev/daXp1). Or use gpart(8); gpart bootcode -b /boot/pmbr -p /boot/gptboot -i 1 daX. The partition is simply read and copied to memory as-is, then executed.
That's good to know.

I found after following that setup that it still can't see and boot into my nvme drive. Which make sense. Thinking about it, it's not far enough into the startup process to load the necessary drivers for the nvme drive (if the BIOS can't see it). It needs a kernel and so on.
 
Back
Top