How to Configure a Mirrored Root Pool (SPARC or x86/VTOC)

Prepare the second disk to attach to the root pool as follows:

This procedure describes how to convert the default root pool installation into a redundant configuration. This procedure applies to certain x86 systems and SPARC systems without GPT-aware firmware whose disks have the SMI (VTOC) label.

  1. Display the current root pool status.
    $ zpool status root-pool

    The configuration would display the disk's slice 0, as shown in the following example for rpool.

    $ zpool status rpool
    pool: rpool
    state: ONLINE
    scrub: none requested
    config:
    
    NAME        STATE     READ WRITE CKSUM
    rpool       ONLINE       0     0     0
    c2t0d0s0    ONLINE       0     0     0
    
    errors: No known data errors
  2. Attach the second disk to configure a mirrored root pool.
    $ zpool attach root-pool current-disk new-disk

    Make sure that you include the slice when specifying the disk, such as c2t0d0s0. The correct disk labeling and the boot blocks are applied automatically.

  3. View the root pool status to confirm that resilvering is complete.

    If resilvering has been completed, the output includes a message similar to the following:

    scan: resilvered 11.6G in 0h5m with 0 errors on Fri Jul 20 13:57:25 2014
  4. If the new disk is larger than the current disk, enable the ZFS autoexpand property.
    $ zpool set autoexpand=on root-pool

    The following example shows the difference in the rpool's disk space after the autoexpand property is enabled.

    $ zpool list rpool
    NAME   SIZE  ALLOC   FREE  CAP  DEDUP  HEALTH  ALTROOT
    rpool  29.8G   152K  29.7G   0%  1.00x  ONLINE  -
    $ zpool set autoexpand=on rpool
    $ zpool list rpool
    NAME   SIZE  ALLOC  FREE  CAP  DEDUP  HEALTH  ALTROOT
    rpool  279G   146K  279G   0%  1.00x  ONLINE  -
  5. Verify that you can boot successfully from the new disk.

    Note:

    Unexpected behavior might occur if the ZFS configuration consists of a root file system that is built on mirrored iSCSI targets and the second LUN is not available on the same iSCSI target or session as the boot disk. When the system is booted, the boot process would report that opening the second iSCSI LUN failed and the root pool is in a degraded state. However, this status is temporary. The issue automatically resolves after the ZFS performs a quick resilvering. The second LUN then goes online and the state of the root pool goes online as well.