On Solaris, how do you mount a second zfs system disk for diagnostics

opensolarissolariszfs

(Cross posted from Stack Overflow 1)

I've got two hard disks in my computer, and have installed Solaris 10u8 on the first and Opensolaris 2010.3 (dev onnv_134) on the second. Both systems uses ZFS and were independently created with a zpool name of 'rpool'.

While running Solaris 10u8 on the first disk, how do I mount the second ZFS hard disk (at /dev/dsk/c1d1s0) on an arbitrary mount point (like /a) for diagnostics?

Best Answer

While running under Solaris 10u8 you won't be able to mount zpools created on a new OpenSolaris build. (snv_134). Since S10u8 and snv_134 are using different ZFS On Disk Pool Versions (IIRC 15 and 22 respectively) only when running OpenSolaris will you be able to access both volumes. ZFS is backwards, but not forwards compatible. Also having multiple pools with the same name ('rpool) on the same physical system isn't supported. You should rename one of them.

To mount the second 'rpool' volume, do the following while booted into OpenSolaris:

# zpool import
Find the cXtXdX disk corresponding to your S10 rpool
# format -e
Find the UUID string corresponding to your cXtXdX disk
# zpool import <UUID> notjustrpool 
Imports the other rpool and renames it to 'notjustrpool' 

You can also specify a mountpoint with -m /mnt/point/ after your zpool import statement, but once you've renamed it, it'll just mount as /notjustrpool. Sub-pools that have their own non-nested mountpoints (like rpool/export) may conflict with your existing mountpoints, so once you've imported the pool you'll have to zfs set mountpoint=/export2 rpool/export or whatever. Note, you'll have to update your grub menu.lst to reflect the pool name change if you still want to boot the renamed rpool.