ZFS Importing an old pool

Hi,

I have installed a new SSD in my system and installed FreeBSD 12.2-RELEASE on it using ZFS with default installer options. Worked perfectly.

The old system (two SSDs combined into one non-redundant ZFS pool, also containing FreeBSD 12.2-RELEASE) is still installed in the computer, but is currently unused. Before installing the new system, I renamed that old pool into "zroot_old". I would like to import that pool to investigate some old configuration files.

When I run zpool list it only displays the new, current pool:
Code:
# zpool list
NAME    SIZE  ALLOC   FREE  CKPOINT  EXPANDSZ   FRAG    CAP  DEDUP  HEALTH  ALTROOT
zroot   896G  22.9G   873G        -         -     0%     2%  1.00x  ONLINE  -

Why doesn't zpool show the old pool? Can I somehow explicity "scan" for all available ZFS pools, even though they are offline?

Trying to import the old pool explicitly works (luckily I remembered the correct name ...):
Code:
# mkdir /mnt/zroot_old
# zpool import -fR /mnt/zroot_old zroot_old
# zfs list
...
zroot_old                     143G  1.60T    88K  /mnt/zroot_old/zroot
zroot_old/ROOT               30.0G  1.60T    88K  none
zroot_old/ROOT/12.1-p9          8K  1.60T  15.8G  /mnt/zroot_old
zroot_old/ROOT/12.2-RELEASE     8K  1.60T  25.8G  /mnt/zroot_old
zroot_old/ROOT/default       30.0G  1.60T  26.0G  /mnt/zroot_old
zroot_old/linuxdisk0          103G  1.70T  4.08G  -
zroot_old/tmp                 305M  1.60T   305M  /mnt/zroot_old/tmp
zroot_old/usr                7.50G  1.60T    88K  /mnt/zroot_old/usr
zroot_old/usr/home           6.04G  1.60T  6.04G  /mnt/zroot_old/usr/home
zroot_old/usr/ports           767M  1.60T   767M  /mnt/zroot_old/usr/ports
zroot_old/usr/src             734M  1.60T   734M  /mnt/zroot_old/usr/src
zroot_old/var                2.17G  1.60T    88K  /mnt/zroot_old/var
zroot_old/var/audit            88K  1.60T    88K  /mnt/zroot_old/var/audit
zroot_old/var/crash          1.82G  1.60T  1.82G  /mnt/zroot_old/var/crash
zroot_old/var/log             600K  1.60T   600K  /mnt/zroot_old/var/log
zroot_old/var/mail            112K  1.60T   112K  /mnt/zroot_old/var/mail
zroot_old/var/tmp             366M  1.60T   366M  /mnt/zroot_old/var/tmp

The directory /mnt/zroot_old now looks like this:
Code:
# ls /mnt/zroot_old
tmp    usr    var    zroot

How can I access the directories /etc, /boot, etc. from the old system? They don't seem to show up in /mnt/zroot_old

Sorry for these newbish questions ...

Thanks!
 
The man page (zpool-import(8)) covers this in detail. zpool list will only show your currently active pools, not those that are available to import. If you want to see pools that could be imported, just type zpool import with no other arguments.

As for your second question, check the canmount and mountpoint (the latter of which can already be seen in your zfs list output) property of the respective datasets (zfs-get(8)). Use zfs mount -a to mount everything, but I believe this is still subject to those properties.
 
Why doesn't zpool show the old pool? Can I somehow explicity "scan" for all available ZFS pools, even though they are offline?
zpool import shows pools available but not active. Without the old pool in your cache file, it won't automatically be imported. You probably don't want that anyway.


How can I access the directories /etc, /boot, etc. from the old system? They don't seem to show up in /mnt/zroot_old
zroot/ROOT/default normally has canmount=noauto set, you need to use zfs mount zroot_old/ROOT/default first. For this use case, using -N on the import command is usefult, manually mount the root, then zfs mount -a for the rest.
 
How can I access the directories /etc, /boot, etc. from the old system? They don't seem to show up in /mnt/zroot_old
Pools are imported but the filesystems aren't mounted automatically. Either mount them separately or run zfs mount -a to mount them all.
 
Back
Top