Help with zfs mount

Hi forum
I've been having a simple FreeBSD desktop, 13.2-RELEASE-p8 with zfs filesystem on ssd. Default zpool=zroot.
Have now done fresh install of 14.0-RELEASE onto a newer and larger ssd, with zfs and default pool.
When installing the 14.0, I kept the old ssd disconnected to ensure risk-free fallback in case of any disappointment.
Now that I have 14.0 basically running, how do I mount the "old" ssd (safely read only ?) so I can conveniently copy some files to the updated desktop ?
Not using any raid, or snapshot/s.
Sorry I don't yet have a working knowledge of zfs concepts and commands, and I couldn't quite find a solution to my question on this page.

 
Read carefully before you do.

zpool(8)
zfs(8)

zpool import -f zroot
zfs mount -a

if you have used password encryption, then zfs mount -a -l


Reference:
 
If the old pool uses the same name you won't be able to import it, it will need to be imported with a different name; zpool import -R /tmp/oldroot zroot zroot_old
Also don't just import it, as that will overlay all the existing mountpoints, use -R to set altroot.

Code:
             -R root
                     Sets the cachefile property to none and the altroot
                     property to root.
zpool-import(8)
 
If the old pool uses the same name you won't be able to import it, it will need to be imported with a different name; zpool import -R /tmp/oldroot zroot zroot_old
Also don't just import it, as that will overlay all the existing mountpoints, use -R to set altroot.
Thanks for reply. Hopefully I'm starting to understand.
Yes, the 2 separate ssd's each have a zfs pool called "zroot".
How does the zpool import command know to import the pool from /dev/da0 rather than /dev/ada0 ?
Do I also need to include the -d dir|device ?
 
How does the zpool import command know to import the pool from /dev/da0 rather than /dev/ada0 ?
You might need to use the ID instead of the name, I've done this on a system I reinstalled. But I forgot how exactly I did it. The zpool import will show the to-be-imported pool. Besides the 'zroot' name it will also have a unique ID. Use that ID for the import in that case.

zpool import -R /tmp/oldroot <long number> zroot_old

Do I also need to include the -d dir|device ?
No, the -R option will take care of any overlapping mounts as it sets an altroot. That's used to prefix all the mountpoints of the old pool. So your old pool ends up having all its mount points under /tmp/oldroot. From there you can copy all the files you need.
 
As mentioned, be careful when importing a zpool, especially when it you have a zpool name clash (as in your case with zroot) and when it will overlay with your current mountpoints. zpool-import(8) mounts stuff, although you don't use an explicit "mount" command.

Be careful with any -f option, especially in the ZFS world, Today's ZFS Michael W Lucas (from ca. 11:31 min.):
One other thing to remember on ZFS and the ZFS tools is the -f flag is important. It's dangerous and any time you come across -f you should think hard and thoroughly before typing that, and then you shouldn't type that. -f stands for force. [...]

The -f point is worth hammering home twice in this talk, because one of the most common messages you'll see on forums and mailing lists is "I used -f and now my life is terrible." Yes, it is, you used -f.

As someone new to ZFS, have a look at this ZFS presentation.
 
Back
Top