Page MenuHomeFreeBSD

bsdinstall: zfsboot: Prompt user for zpool name if the pool already exists
ClosedPublic

Authored by manu on Dec 8 2021, 10:46 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 8 2024, 12:04 AM
Unknown Object (File)
Feb 9 2024, 9:33 AM
Unknown Object (File)
Dec 20 2023, 12:05 AM
Unknown Object (File)
Dec 19 2023, 6:18 PM
Unknown Object (File)
Dec 12 2023, 1:19 AM
Unknown Object (File)
Nov 22 2023, 2:33 AM
Unknown Object (File)
Sep 28 2023, 2:25 PM
Unknown Object (File)
Sep 17 2023, 2:01 AM

Details

Summary

If one install FreeBSD on multiple disks (say 13 and CURRENT) the first created
pool will always be used.
Prompt the user for a new pool name if we detect that the default or supplied one
already exists.

MFC after: 2 weeks
Sponsored by: Beckhoff Automation GmbH & Co. KG

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 43228
Build 40116: arc lint + arc unit

Event Timeline

manu requested review of this revision.Dec 8 2021, 10:46 AM

BTW if someone could explain this loader/zfs behavior of always using the first created pool that would be nice.
I assumed that loader.efi would detect the disk its on and give the kernel some hints about the pool id or something.

corvink added inline comments.
usr.sbin/bsdinstall/scripts/zfsboot
1621

for loop should be breaked after asking for the desired pool name.

Break out of loop after prompt

manu marked an inline comment as done.Dec 8 2021, 12:50 PM
In D33331#753599, @manu wrote:

BTW if someone could explain this loader/zfs behavior of always using the first created pool that would be nice.
I assumed that loader.efi would detect the disk its on and give the kernel some hints about the pool id or something.

It's a legacy of the original ZFS implementation. It should do what UFS does and prefer a pool with a disk that matches. I added it to UFS, but ZFS is missing this feature.

In D33331#753684, @imp wrote:
In D33331#753599, @manu wrote:

BTW if someone could explain this loader/zfs behavior of always using the first created pool that would be nice.
I assumed that loader.efi would detect the disk its on and give the kernel some hints about the pool id or something.

It's a legacy of the original ZFS implementation. It should do what UFS does and prefer a pool with a disk that matches. I added it to UFS, but ZFS is missing this feature.

Mhm ok, so do we agree on adding this in the meantime that loader is fixed ?

In D33331#755800, @manu wrote:
In D33331#753684, @imp wrote:
In D33331#753599, @manu wrote:

BTW if someone could explain this loader/zfs behavior of always using the first created pool that would be nice.
I assumed that loader.efi would detect the disk its on and give the kernel some hints about the pool id or something.

It's a legacy of the original ZFS implementation. It should do what UFS does and prefer a pool with a disk that matches. I added it to UFS, but ZFS is missing this feature.

Mhm ok, so do we agree on adding this in the meantime that loader is fixed ?

Yes. I agree. It's been a lack for a while, and this review doesn't need to fix it.

This revision is now accepted and ready to land.Dec 14 2021, 5:51 PM