ZFS Trying to access root directory of another system's root disk

While installing 11-Release on another disk on a system, I am trying to access the data of its' old FreeBSD 11-RC2 disk. Which was set up the by the installer the standard way without any customizations.

zpool list, zpool status etc do not list the pool.

However, as I know the pool's name, I can successfully access the /tmp, /usr and /var directories from /mnt after using either
zpool import -o readonly=on -R /mnt -d /dev <poolname>
or
zpool import -o readonly=on -o altroot=/mnt -d /dev <poolname>

However, no other directories are shown. Importing without read-only option does not change anything. See this please:

snurg@mypc:/mnt % ll
total 146
drwxr-xr-x 2 root wheel 2 Aug 14 2016 cesspool/
drwxrwxrwt 6 root wheel 6 Sep 4 06:32 tmp/
drwxr-xr-x 5 root wheel 5 Nov 27 14:11 usr/
drwxr-xr-x 7 root wheel 7 Nov 27 14:11 var/
snurg@mypc:/mnt %



I mainly need to get access to /etc, which is in the "/" zfs "subpartition" (or whatever is the correct name) of the pool.

So, what do I need to do to access the imported zfs pools' "/" "subpartition"?

(Ofc, I know I could just boot the old system and copy stuff to an usb stick for transferring. But I think that would be an awkward, windows-like style to solve this problem)
 
You'll need to mount the filesystems manually. The problem is that the installer sets the canmount option to false for the root filesystem and that results in the filesystem not being automatically mounted the very moment you import the ZFS pool. And because any other optional filesystems depend on the root filesystem to be present you'll get a cascade effect where nothing is accessible at first.

So try something like # zfs mount zroot/root/DEFAULT or # zfs mount -a. Use zfs list or mount to verify the results.
 
Thank you for the quick answer.
The canmount thing you mention seems a very bad idea to me, making recovery of other system disks' configuration files unnecessary difficult.

I am studying the zfs manpages etc atm to understand things better, because I am a bit hesitant to try zfs mount -a because the last time I did that a few years ago, it simply mounted the old system's zfs filesystems over the new ones, either because the zfs tool has no altroot option, or I used that incorrectly (I don't remember exactly now). And that was very very destructive...

(For now I was able to use the primitive usb stick method, as the old system is still functional. But if you are in the situation where you need to recover things from an unbootable system...)
 
To mount a zfs filesystem with canmount option set to off, you can use the good old mount command. First import the pool, then
mount -t zfs [I]what-you-want-to-mount[/I] [I]mountpoint[/I]
 
Back
Top