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
F106179135: D33331.diff
Thu, Dec 26, 4:58 PM
Unknown Object (File)
Wed, Dec 18, 11:05 AM
Unknown Object (File)
Wed, Dec 4, 7:44 PM
Unknown Object (File)
Tue, Dec 3, 5:38 PM
Unknown Object (File)
Tue, Dec 3, 5:38 PM
Unknown Object (File)
Tue, Dec 3, 5:38 PM
Unknown Object (File)
Tue, Dec 3, 5:38 PM
Unknown Object (File)
Tue, Dec 3, 5:19 PM

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