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/VTOC)

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 c1t0d0s0
# cfgadm -c unconfigure c1::dsk/c1t0d0
<Physically remove failed disk c1t0d0>
<Physically insert replacement disk c1t0d0>
# cfgadm -c configure c1::dsk/c1t0d0
<Confirm that the new disk has an SMI label and a slice 0>
# zpool replace rpool c1t0d0s0
# zpool online rpool c1t0d0s0
# zpool status rpool
<Let disk resilver before installing the boot blocks>
# 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. Prepare a second disk for attachment to the root pool, if necessary.
  3. Attach the new disk to the root pool.

    For example:

    # zpool attach rpool c2t0d0s0 c2t1d0s0
    Make sure to wait until resilver is done before rebooting.

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

  4. Confirm the root pool status.

    For example:

    # zpool status rpool
    pool: rpool
    state: ONLINE
    scan: resilvered 11.7G in 0h5m with 0 errors on Fri Jul 20 13:45:37 2012
    rpool     ONLINE       0     0     0
    mirror-0  ONLINE       0     0     0
    c2t0d0s0  ONLINE       0     0     0
    c2t1d0s0  ONLINE       0     0     0
    errors: No known data errors
  5. Verify that you can boot from the new disk after resilvering is complete.

    For example, on a SPARC based system:

    ok boot /pci@1f,700000/scsi@2/disk@1,0

    Identify the boot device pathnames of the current and new disk so that you can test booting from the replacement disk and also manually boot from the existing disk, if necessary, if the replacement disk fails. In the example below, the current root pool disk (c2t0d0s0) is:


    In the example below, the replacement boot disk is (c2t1d0s0):

    boot /pci@1f,700000/scsi@2/disk@1,0
  6. If the system boots from the new disk, detach the old disk.

    For example:

    # zpool detach rpool c2t0d0s0
  7. 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
    rpool  29.8G   152K  29.7G   0%  1.00x  ONLINE  -
    # zpool set autoexpand=on rpool

    Review the expanded rpool pool size:

    # zpool list rpool
    rpool  279G   146K  279G   0%  1.00x  ONLINE  -
  8. Set up the system to boot automatically from the new disk.
    • SPARC: Set up the system to boot automatically from the new disk, either by using the eeprom command or the setenv command from the boot PROM.

    • x86: Reconfigure the system BIOS.