How to Create a Mirrored ZFS Storage Pool

How to Create a Mirrored ZFS Storage Pool

The OpenSolaris installer creates a ZFS storage pool, which is a pool of devices that all the file systems in that pool share.

If you have an additional disk that is the same size as the disk in the ZFS storage pool that was created during the OpenSolaris installation, you might consider creating a two-disk mirrored ZFS storage pool. A two-disk mirrored pool provides better data protection against a disk failure.

Tip - For general recommendations about ZFS storage pools, go to http://www.solarisinternals.com/wiki/index.php/ZFS_Best_Practices_Guide.

Steps
  1. Start a privileged shell.

    user@opensolaris:-$ pfexec bash
    #
    

    In this example, the bash shell is selected. You can choose to use any shell with the pfexec command. If you support multiple versions of the SolarisTM OS, use the standard su – root command. The su command works on all Solaris versions.

  2. Identify your existing storage pool devices.
    For example:
    # zpool status
      pool: rpool
     state: ONLINE
     scrub: none requested
    config:
    
            NAME        STATE     READ WRITE CKSUM
            rpool       ONLINE       0     0     0
              c4d0s0    ONLINE       0     0     0
    
    errors: No known data errors
    
  3. Attach a second disk as a mirror to the existing storage pool device.
    For example:
    # zpool attach rpool c4d0s0 c4d1s0
    
  4. Verify that the device is attached.
    For example:
    # zpool status
      pool: rpool
     state: ONLINE
     scrub: none requested
    config:
    
            NAME          STATE     READ WRITE CKSUM
            rpool         ONLINE       0     0     0
              mirror      ONLINE       0     0     0
                  c4d0s0  ONLINE       0     0     0
                  c4d1s0  ONLINE       0     0     0
    
    errors: No known data errors
    
  5. Apply the boot blocks to the newly attached disk.
    For example:
    # installgrub /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c4d1s0
    
  6. Confirm that you can boot from the newly attached disk by selecting this disk from the BIOS level.

For more information:

Labels

osoladmin osoladmin Delete
task task Delete
filesystem filesystem Delete
zfs zfs Delete
storagepool storagepool Delete
adding adding Delete
admin admin Delete
sundoc sundoc Delete
largesiteadmin largesiteadmin Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.

Sign up or Log in to add a comment or watch this page.


The individuals who post here are part of the extended Sun Microsystems community and they might not be employed or in any way formally affiliated with Sun Microsystems. The opinions expressed here are their own, are not necessarily reviewed in advance by anyone but the individual authors, and neither Sun nor any other party necessarily agrees with them.

Copyright 1994-2009 Sun Microsystems, Inc.
Powered by Atlassian Confluence
Sun Guidelines on Public Discourse Privacy Policy Terms of Use Trademarks Site Map Employment Investor Relations Contact