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
F102401037: D33331.id99703.diff
Mon, Nov 11, 6:28 PM
F102380451: D33331.diff
Mon, Nov 11, 11:46 AM
Unknown Object (File)
Sun, Nov 10, 12:16 AM
Unknown Object (File)
Fri, Nov 1, 4:23 AM
Unknown Object (File)
Fri, Oct 18, 12:01 PM
Unknown Object (File)
Oct 9 2024, 1:33 AM
Unknown Object (File)
Sep 18 2024, 5:13 AM
Unknown Object (File)
Sep 5 2024, 5:28 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
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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