Go to main content

Managing ZFS File Systems in Oracle® Solaris 11.4

Exit Print View

Updated: July 2019
 
 

Splitting a Mirrored Storage Pool to Create a New Pool

You can quickly clone a mirrored ZFS storage pool by using the zpool split command. The new pool will have identical contents to the original mirrored ZFS storage pool. You can then import the new pool either to the same system or to another system. For more information about importing pools, see Importing ZFS Storage Pools.

To split a pool, use the following command:

$ zpool split pool new-pool [device]

Unless you specify the device, the zpool split command by default detaches the last disk of the pool's virtual device for the newly created pool. If a pool has multiple top-level virtual devices, the command detaches a disk from each virtual device to create a new pool out of those disks.

Splitting a pool applies only to mirrored configurations. You cannot split a RAID-Z configured pool or a nonredundant pool.

If you split a pool that has only a single top-level device consisting of three disks, the new pool created out of the third disk is nonredundant. The remaining pool retains data redundancy with its two remaining disks. To convert the new pool into a redundant configuration, attach a new device to the pool.

For more procedures and examples about splitting a ZFS pool with the zpool split command, log in to your account at My Oracle Support (https://support.oracle.com) and see "How to Use 'zpool split' to Split an rpool (Doc ID 1637715.1)".

    Ensure the following before splitting a mirrored pool:

  • Data and application operations are quiesced.

  • No resilvering is in progress.

  • Your hardware is configured correctly. For related information about confirming your hardware's cache flush settings, see General System Practices.

Before the actual split operation occurs, data in memory is flushed to the mirrored disks. After the data is flushed, the disk is detached from the pool and given a new pool GUID so that the pool can be imported on the same system on which it was split.

If the pool to be split has non-default file system mount points and the new pool is created on the same system, then you must use the zpool split –R option to identify an alternate root directory for the new pool so that any existing mount points do not conflict. For example:

$ zpool split -R /system2 system1 system2

If you don't use the zpool split –R option and you can see that mount points conflict when you attempt to import the new pool, import the new pool with the –R option. If the new pool is created on a different system, then specifying an alternate root directory is not necessary unless mount point conflicts occur.

Example 12  Splitting a Mirrored ZFS Pool

In this example, a mirrored storage pool called poolA with three disks is split. The two resulting pools are the mirrored pool poolA with two disks and the new pool poolB with one disk.

$ zpool status poolA
  pool: poolA
 state: ONLINE
  scan: none requested
config:

        NAME        STATE     READ WRITE CKSUM
        poolA       ONLINE       0     0     0
          mirror-0  ONLINE       0     0     0
            c0t0d0  ONLINE       0     0     0
            c0t1d0  ONLINE       0     0     0
            c0t2d0  ONLINE       0     0     0

errors: No known data errors
$ zpool split poolA poolB
$ zpool import luna 
$ zpool status poolA poolB
  pool: luna
 state: ONLINE
  scan: none requested
config:

        NAME      STATE     READ WRITE CKSUM
        poolB     ONLINE       0     0     0
          c0t2d0  ONLINE       0     0     0

errors: No known data errors

  pool: poolA
 state: ONLINE
  scan: none requested
config:

        NAME        STATE     READ WRITE CKSUM
        poolA       ONLINE       0     0     0
          mirror-0  ONLINE       0     0     0
            c0t0d0  ONLINE       0     0     0
            c0t1d0  ONLINE       0     0     0

errors: No known data errors

With the new configuration, you can perform other operations. For example, you can import poolB on another system for backup purposes. After the backup is complete, you can destroy poolB and reattach the disk to poolA.