Re: difficulties replacing a ZFS installer zroot pool with a new zroot pool on a new disk

From: parv/FreeBSD <parv.0zero9+freebsd_at_gmail.com>
Date: Thu, 31 Mar 2022 04:56:43 UTC
On Wed, Mar 30, 2022 at 12:47 PM Russell L. Carter wrote:
...

> Once the NVMe SSD
> was booted, I reattached the SATA data cable and it showed up in the
> 'zpool import' list.  'zpool import zroot' was not a happy solution as
> it collided with the new SSD zroot pool.
>

Unsurprising, expected.



> I eventually worked out that I should rename the old pool zroot.old on
> import.


To rename a pool (semi-permanently), import it with a second name which
answers your query in (4) at the end your email ...

  # zpool import <existing pool name> <new pool name>

... which you had mentioned yourself in (2).


...

> I would submit that

...

> having the old SSD zroot.orig
> automatically import and mount everything, but not automatically
> import and mount everything when set given an altroot, is confusing.
> I would add that manually performing
>
> zfs mount zroot.old/ROOT/default
>
> (but not, say zfs unmount zroot.old/usr; zfs mount zroot.old/src)
>
.               ^ ^ ^ ^ ^
Is that "unmount" supposed to be "mount"?


mount everything I was missing, is also confusing and unintuitive.
>

Is this case not already covered by your assertion that given "altroot",
auto-mount of datasets did not happen on pool import?



> I have two more ZFS system pools to upgrade to SSDs.  I am going to
> try the following procedure:
>
> 1) unplug the old SATA drive and install FreeBSD to the new SSD.
>
> 2) shutdown,  reattach old drive, reboot
>     If the new drive boots (instead of the old drive), I boot
>     to single user.  I then try
>
>     zpool import -o altroot /mnt/zrool.old  zroot zroot.old
>

> 3) If that works, I try:
>
>     zfs mount zpool.old/ROOT/default
>
> 4) If it doesn't work, I'll probably have to zpool export the pool and
>     iterate.
>


How would you "iterate"?


- parv



>   I forget exactly how I got the old pool renamed in the
>   above.
>
...