Managing ZFS File Systems in Oracle® Solaris 11.2

Exit Print View

Updated: December 2014
 
 

How to Replace a Disk in a ZFS Root Pool (SPARC or x86/EFI (GPT))

You might need to replace a disk in the root pool for the following reasons:

  • The root pool is too small and you want to replace it with a larger disk

  • The root pool disk is failing. In a non-redundant pool, if the disk is failing so that the system won't boot, you'll need to boot from an alternate media, such as a CD or the network, before you replace the root pool disk.

  • If you use the zpool replace command to replace a disk in a root pool disk, you will need to apply the boot blocks manually.

In a mirrored root pool configuration, you might be able to attempt a disk replacement without having to boot from alternate media. You can replace a failed disk by using the zpool replace command or if you have an additional disk, you can use the zpool attach command. See the steps below for an example of attaching an additional disk and detaching a root pool disk.

Systems with SATA disks require that you offline and unconfigure a disk before attempting the zpool replace operation to replace a failed disk. For example:

# zpool offline rpool c1t0d0
# cfgadm -c unconfigure c1::dsk/c1t0d0
<Physically remove failed disk c1t0d0>
<Physically insert replacement disk c1t0d0>
# cfgadm -c configure c1::dsk/c1t0d0
# zpool online rpool c1t0d0
# zpool replace rpool c1t0d0
# zpool status rpool
<Let disk resilver before installing the boot blocks>
x86# bootadm install-bootloader

On some hardware, you do not have to online or reconfigure the replacement disk after it is inserted.

  1. Physically connect the replacement disk.
  2. Attach the new disk to the root pool.

    For example:

    # zpool attach rpool c2t0d0 c2t1d0
    Make sure to wait until resilver is done before rebooting.

    The correct disk labeling and the boot blocks are applied automatically.

  3. Confirm the root pool status.

    For example:

    # zpool status rpool
    pool: rpool
    state: ONLINE
    scan: resilvered 11.6G in 0h5m with 0 errors on Fri Jul 20 12:06:07 2012
    config:
    
    NAME      STATE     READ WRITE CKSUM
    rpool     ONLINE       0     0     0
    mirror-0  ONLINE       0     0     0
    c2t0d0    ONLINE       0     0     0
    c2t1d0    ONLINE       0     0     0
    
    errors: No known data errors
  4. Verify that you can boot from the new disk after resilvering is complete.
  5. If the system boots from the new disk, detach the old disk.

    For example:

    # zpool detach rpool c2t0d0
  6. If you are replacing a smaller root pool disk with a larger disk, set the pool's autoexpand property to expand the pool's size.

    Determine the existing rpool pool size:

    # 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

    Review the expanded rpool pool size:

    # zpool list rpool
    NAME   SIZE  ALLOC  FREE  CAP  DEDUP  HEALTH  ALTROOT
    rpool  279G   146K  279G   0%  1.00x  ONLINE  -
  7. Set up the system to boot automatically from the new disk.

    Reconfigure the system BIOS.