Temporary mounting zpool from different OS

In case you have different zfs instances, and you need to read one from another, but without altering its metadata. It can be done like this (assuming that other zpool is named “zroot”):

# make sure that /zroot exists, following command will mount
# all but /ROOT/default
zpool import -o readonly=on -f -R /zroot zroot
# zroot/ROOT/default might need special request
zfs mount zroot/ROOT/default
# at this point everything within zroot zpool is mounted
# under /zroot hierarchy, and it can be read
# ...
# once done with it export it (this will umount all of it)
# if it complains about being busy, just repeat the command
zpool export zroot


Posted

in

by