How to display ZFS pool attributes including import path using the zdb CLI

book

Article ID: 100039093

calendar_today

Updated On:

Description

Description

ZFS is a type of file system presenting a pooled storage model developed by SUN (Oracle). File systems can directly draw from a common storage pool (zpool).

The Solaris Operating System (OS) can use two different types of disk labels: Sun Microsystems, Inc. (SMI) labels, and Extensible Firmware Interface (EFI) labels.
Traditionally, LUNs which are larger than 1TB in size, are configured with an EFI label (instead of SMI labels). ZFS configured devices will default with an EFI disk label regardless of the physical LUN size.

Veritas Volume Manager (VxVM) in conjunction with Veritas DMP can be used to manage ZFS pools and any ZFS file system(s) that operate on those pools.
If enabled, DMP can be used as the multi-pathing driver for the management of ZFS pools.

Veritas VCS uses the Zpool agent and enables the user to specify the faster /dev/vx/dmp// path details when importing the ZFS zpool. Taking microseconds to import rather than minutes in some cases.

Figure 1.0

ZFS Server image

The above sample Solaris environment consists of two Solaris Sparc (SOL) servers with several ZFS devices visible to both servers.



The output from the VxVM CLI command "vxdisk -eo alldgs list" displays a series of ZFS configured devices:

# vxdisk -eo alldgs list

DEVICE       TYPE           DISK        GROUP        STATUS               OS_NATIVE_NAME   ATTR
disk_0       auto:ZFS       -            -           ZFS                  c0t50000396681BAE38d0 -
disk_1       auto:ZFS       -            -           ZFS                  c0t50000396681BB1D4d0 -
emc0_0142    auto:ZFS       -            -           ZFS                  c1t5006048C5369798Fd65 RAID lun
emc0_0143    auto:ZFS       -            -           ZFS                  c1t5006048C5369798Fd66 RAID lun
3pardata0_15 auto:cdsdisk   -            (testdg)    online thinrclm      c2t21120002AC005B41d3s2 tprclm
3pardata0_16 auto:ZFS       -            -           ZFS                  c2t20120002AC005B41d4 tprclm
3pardata0_17 auto:ZFS       -            -           ZFS                  c2t20110002AC005B41d5 tprclm

 

zdb CLI
 

The ZFS header details can be displayed using the Solaris zdb CLI.

Sample output for Veritas Disk Access (DA) name, emc0_0142

# zdb -l /dev/vx/rdmp/emc0_0142s0

------------------------------------------
LABEL 0
------------------------------------------
    timestamp: 1493735242 date = Tue May  2 14:27:22 UTC 2017
    version: 37
    name: 'emc0_0142'
    state: 0
    txg: 63
    pool_guid: 15256135490155538961
    hostid: 2416387096
    hostname: 'viper'
    top_guid: 12035856588899804464
    guid: 12035856588899804464
    vdev_children: 1
    vdev_tree:
        type: 'disk'
        id: 0
        guid: 12035856588899804464
        path: '/dev/dsk/emc0_0142s0'
        devid: 'id1,dmp@n60060480000290301414533030313432/n60060480000290301414533030313432-a'
        phys_path: '/pseudo/vxdmp@0:n60060480000290301414533030313432-a'
        whole_disk: 1
        metaslab_array: 27
        metaslab_shift: 24
        ashift: 9
        asize: 2248146944
        is_log: 0
        create_txg: 4
------------------------------------------
LABEL 1 - CONFIG MATCHES LABEL 0
------------------------------------------
------------------------------------------
LABEL 2 - CONFIG MATCHES LABEL 0
------------------------------------------
------------------------------------------
LABEL 3 - CONFIG MATCHES LABEL 0
------------------------------------------

NOTE: The slice number is also required.


For Loop:

The below "for loop" can be used to display the pool name and path (last used to import) attribute for each ZFS pool visible to the host:


# for disk in `vxdisk -qo alldgs list | grep -w ZFS | awk '{ print $1 }'`; do list=`zdb -l /dev/vx/rdmp/${disk}s[0-9] | egrep ' name:| path:' | tr -s "\n" "\t"`; echo "$disk: $list"; done

Sample results:

disk_0:     name: 'rpool2'              path: '/dev/vx/dmp/disk_0s0'
disk_1:     name: 'rpool'               path: '/dev/dsk/disk_1s0'
emc0_0142:     name: 'emc0_0142'                path: '/dev/dsk/emc0_0142s0'
emc0_0143:     name: 'emc0_0143'                path: '/dev/rdsk/c1t5006048C536979A0d143s0'
3pardata0_16:     name: 'pardata0_16'           path: '/dev/rdsk/c1t20120002AC005B41d4s0'
3pardata0_17:     name: 'pardata0_17'           path: '/dev/rdsk/c1t20110002AC005B41d5s0'

In the above output, emc0_0142s0 relates to zpool name "emc0_0142" and will be imported using the symbolic link for the related DMP device.


# ls -al /dev/dsk/emc0_0142s0
lrwxrwxrwx   1 root     root          64 May  2 14:04 /dev/dsk/emc0_0142s0 -> ../../devices/pseudo/vxdmp@0:n60060480000290301414533030313432-a

The ZFS zpool "emc0_0142" can be imported using the -d argument. By specifying the Veritas Disk Access (DA) name along with the slice, the ZFS import operation should be much faster.

# zpool import -d /dev/vx/dmp/emc0_0142s0 emc0_0142

The imported ZFS pool details can be displayed using the "vxdmpadm native ls" command:


# vxdmpadm native ls

DMPNODENAME                      POOL NAME
=============================================
disk_0                           -
disk_1                           rpool
emc0_0142                        emc0_0142
emc0_0143                        -
3pardata0_16                     -
3pardata0_17                     -

 

NOTE: When the zpool is exported, the DMP symbolic link path to the DMP device will be used during the next import operation, unless an alternate path is explicitly specified with the -d argument.

 

Issue/Introduction

How to display ZFS pool attributes including import path using the zdb CLI