Auto ZFS GPT/UEFI Hybrid Install (what settings does it use?)

Started by nVIceman, June 22, 2022, 10:14:09 PM

Previous topic - Next topic
I'm trying to figure out if its default settings are fine for any installs I do, but I couldn't find anywhere what they are. Compared to the Auto ZFS install option through Other Modes, is it using those default settings or something else?

On a sidenote, is there any reason to not have both BIOS/UEFI set so you can boot using UEFI or Legacy mode? I've normally just chosen UEFI, but is there some drawback if also allowing the legacy boot even if you weren't or didn't plan to use it?

Quote from: nVIceman on June 22, 2022, 10:14:09 PM
I'm trying to figure out if its default settings are fine for any installs I do, but I couldn't find anywhere what they are.
Settings with regard to what? There is nothing to tune in normal ZFS based installs. Just pick the number of disks, use a mirror if you can, that's it.

Quote from: nVIceman on June 22, 2022, 10:14:09 PM
On a sidenote, is there any reason to not have both BIOS/UEFI set so you can boot using UEFI or Legacy mode? I've normally just chosen UEFI, but is there some drawback if also allowing the legacy boot even if you weren't or didn't plan to use it?
If you ever update your ZFS pool you need to update the boot loader, too. If you have only the boot method you actively use (UEFI) installed, you don't need to update the legacy boot loader. Because, you know, one day after an unexpected power outage and an empty CMOS battery, the system might decide to try legacy first, just because it's there.

I prefer to have options as an admin at install time but not give the system any options if you get what I mean.

HTH,
Patrick
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

Quote from: pmhausen on June 22, 2022, 10:25:36 PM
Settings with regard to what? There is nothing to tune in normal ZFS based installs. Just pick the number of disks, use a mirror if you can, that's it.

Pool name, swap size, encryption, etc. When using hybrid mode, it's using settings defined by OPNsense team, but I wanted to know what those are.

Quote from: pmhausen on June 22, 2022, 10:25:36 PM
If you ever update your ZFS pool you need to update the boot loader, too. If you have only the boot method you actively use (UEFI) installed, you don't need to update the legacy boot loader. Because, you know, one day after an unexpected power outage and an empty CMOS battery, the system might decide to try legacy first, just because it's there.

I prefer to have options as an admin at install time but not give the system any options if you get what I mean.

Yea, so something like this is what I meant, so sounds like I just want to manually configure the ZFS install through Other Modes like I've been doing as I noticed Legacy boot mode works. Thanks.

I'm probably confusing the OPNsense installer with the FreeBSD installer. The latter shows and lets you pick all of these parameters in "Auto ZFS" mode. Which is more "Guided ZFS" than automatic.

I'll have to fire up an OPNsense install in a VM and have a look at it again.

My remarks about legacy and UEFI boot stiil hold.
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

The defaults are almost the same as the FreeBSD installer subroutines only that you can't modify them:

https://github.com/opnsense/installer/blob/master/src/opnsense-zfs.sh#L40-L126

We have increased the swap size to 8 GB as 2 was too small for any type of modern deployment and negligible in size with modern drives (even 128 gb).


Cheers,
Franco

Hi Franco,
does this statement also apply to mini installations like APU2 boards with a 16 GB or 32 GB SSD?
https://forum.opnsense.org/index.php?topic=28059.msg136292#msg136292

Is there anything against using only a 2 GB swap partition in such a setting? Or what do you recommend for this case?

Hmm, the swap dialog was hidden because it was decided to make auto-install as snappy as possible. seeing zfs being squeezed into tiny systems we might as well make the swap dialog get in the way of every zfs install, likely to the disadvantage of people avoiding the swap partition altogether.

While a swap file can be used, a swap file cannot hold a crash dump. This is what matters...


Cheers,
Franco

You can always install a stock FreeBSD in any layout you like and use the bootstrap method to install OPNsense.

Kind regards,
Patrick
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

The "other installs" option are exactly the FreeBSD installs so you can avoid the bootstrap.

Except... FreeBSD doesn't install in hybrid mode. UEFI installs only work in UEFI and BIOS only works in BIOS environments. With our installs you can swap discs without these boundaries between hardware.

I know it's just a bonus, but I want to avoid later complaints. ;)


Cheers,
Franco

FreeBSD does offer BIOS and UEFI.
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

I wasn't saying that.

Try installing BIOS and booting UEFI afterwards. Doesn't work. Try installing on UEFI and boot BIOS... doesn't work either. That's why we use hybrid approach. It's also better for testing. :)


Cheers,
Franco

FreeBSD supports installing legacy and UEFI simultaneously on the same boot drive. That's even the default.
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

That's almost correct. The devil is in the details, however:

For ZFS it doesn't preselect this when booting BIOS:

https://github.com/opnsense/installer/commit/3bd93a6b36ca2

For UFS you can never get UEFI install for BIOS boot:

https://github.com/opnsense/src/commit/c10887be55

And I am relatively sure that UEFI UFS install won't boot BIOS due to incompatible layout or at least that was the case at some point. But covering all this in QA is tedious work so I could be mixing up cases from back in 21.7 / HBSD 12 and things are different now.


Cheers,
Franco

Quote from: franco on June 24, 2022, 01:01:35 PM
Hmm, the swap dialog was hidden because it was decided to make auto-install as snappy as possible. seeing zfs being squeezed into tiny systems we might as well make the swap dialog get in the way of every zfs install, likely to the disadvantage of people avoiding the swap partition altogether.

While a swap file can be used, a swap file cannot hold a crash dump. This is what matters...

I meant to have read that with ZFS generally no swap file can be used?

Anyway, from a technical point of view, is there anything against making the swap partition only 2 GB in size for a ZFS installation?

Quote from: Reiter der OPNsense on June 24, 2022, 03:37:44 PM
I meant to have read that with ZFS generally no swap file can be used?
No swap FILE ON ZFS.

A swap partition is of course perfectly ok.

A swap file can lead to a circular dependency leading to a lock-up. If the system is under very high memory pressure and needs to free some blocks to do the necessary bookkeeping to write to ZFS, while trying to push blocks to swap which needs to be written to ZFS ... see the problem?

A swap partition is not a filesystem.
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)