In UEFI mode switch partition

My point being: are you sure that gptboot works on a disk drive that is not gpt partitioned? From gptboot(8) man page:
"gptboot is used on BIOS-based computers to boot from a UFS partition on a GPT-partitioned disk. gptboot is installed in a freebsd-boot partition with gpart(8).".
Disks with slices (old, very old style) doesn't have freebsd-boot partition type...
 
My point being: are you sure that gptboot works on a disk drive that is not gpt partitioned? From gptboot(8) man page:
"gptboot is used on BIOS-based computers to boot from a UFS partition on a GPT-partitioned disk. gptboot is installed in a freebsd-boot partition with gpart(8).".
Disks with slices (old, very old style) doesn't have freebsd-boot partition type...
No tingo, I meant in BIOS mode gpart set -a bootme -i3 da0 worked to switch partition.

We are seeing problems in UEFI mode for UFS GPT based , I have a efi partition and which has
/efi/EFI/BOOT/BOOTX64.EFI

and rootfs exists in partition 3 and partition 5.

I want to use boot.config to update currdev of loader to switch partition from 3 to 5, But setting the
cat /efi/boot.config

0:ad(0p5)/boot/loader

is not working

I tried setting /efi/freebsd/loader.env , this also is not updating the currdev
cat /efi/freebsd/loader.env

"rootdev=disk0p5:"

Like eg: https://nofu.jp/wiki/en/blog/2021/2021-01-09
 
Did you remove the old "rootfs" label from partition 3? I understand, you want to move your root partition from 3 to 5. If you have more than one gpt label named "rootfs", the boot process will likely not work out in the end.

Just use gpart modify to set a different label or remove the one on partition 3.
 
Did you remove the old "rootfs" label from partition 3? I understand, you want to move your root partition from 3 to 5. If you have more than one gpt label named "rootfs", the boot process will likely not work out in the end.

Just use gpart modify to set a different label or remove the one on partition 3.
gpart show -l

=> 40 1048575920 da0 GPT (500G)

40 2008 - free - (1.0M)

2048 128 1 (null) (64K)

2176 1920 - free - (960K)

4096 2097152 2 (null) (1.0G)

2101248 8388608 3 (null) (4.0G)

10489856 16777216 4 (null) (8.0G)

27267072 8388608 5 (null) (4.0G)

still not working
 
currdev=disk0p5:
T-Daemon I tried this not working ..
Indeed, I've checked in a VirtualBox VM, 13.0-RELEASE-p11 seems not to read the disk environment from loader.env.

"currdev=" works as expected when set at the loader prompt (Boot menu -> Escape to loader prompt).

On 13.1-RELEASE however it works fine:

currdev-13.1.png

I suggest you upgrade the system to 13.1-RELEASE as 13.0-RELEASE will be EoL August 31, 2022 anyway and chances of the error to be corrected in 13.0 are not likely.
 
Indeed, I've checked in a VirtualBox VM, 13.0-RELEASE-p11 seems not to read the disk environment from loader.env.

"currdev=" works as expected when set at the loader prompt (Boot menu -> Escape to loader prompt).

On 13.1-RELEASE however it works fine:

View attachment 14261

I suggest you upgrade the system to 13.1-RELEASE as 13.0-RELEASE will be EoL August 31, 2022 anyway and chances of the error to be corrected in 13.0 are not likely.
Yes setting from loader prompt is working but from the loader.env it is not.
Will check in FreeBSD 13.1. Thanks
 
Indeed, I've checked in a VirtualBox VM, 13.0-RELEASE-p11 seems not to read the disk environment from loader.env.

"currdev=" works as expected when set at the loader prompt (Boot menu -> Escape to loader prompt).

On 13.1-RELEASE however it works fine:

View attachment 14261

I suggest you upgrade the system to 13.1-RELEASE as 13.0-RELEASE will be EoL August 31, 2022 anyway and chances of the error to be corrected in 13.0 are not likely.
T-Daemon Like you said works well in 13.1-RELEASE, I did copy the loader from 13.1-RELEASE to 13.0-RELEASE but I dont see currdev /rootdev being respected. Ideally the changes should have gone in loader, why it is still not working ? Any suggestions what all to copy to make it work
 
I did copy the loader from 13.1-RELEASE to 13.0-RELEASE ...
I assume you copied the loader to efi/boot/bootx64.efi. Is there a efi/freebsd/loader.efi UEFI kernel loader?

If there is, change the loader there to v13.1 as well.

Also, are there UEFI boot entries? If there are, check the FreeBSD entries kernel loader path ( efibootmgr -v), it should point to /efi/boot/bootx64.efi. If that's not the case, delete the entry, create a new one.
 
If somebody stumbles over this thread looking for a solution to a same or similar case, there is a better solution than discussed above, set currdev= in /boot/loader.conf, no matter if BIOS or UEFI.

loader(8):
Code:
     currdev   Selects the default device to loader the kernel from.  The
               syntax is:
                     loader_device:
               or
                     zfs:dataset:
               Examples:
                     disk0p2:
                     zfs:zroot/ROOT/default:
(loader_device -> UFS2)

See also post on thread setting root filesystem in kernel .
 
Back
Top