Powered By Blogger

Wednesday, April 8, 2009

Add Additional storage in zpool

# zpool detach zpool-name c1t2d0
# cfgadm -c unconfigure c1::dsk/c1t2d0


Physically replace the disk with that of a higher capacity

# cfgadm -c configure c1::dsk/c1t2d0
# zpool attach zpool-name c1t3d0 c1t2d0


Wait for resilvering to complete…

# zpool detach zpool-name c1t3d0
# cfgadm -c unconfigure c1::dsk/c1t3d0


Physically replace the disk with that of a higher capacity

# cfgadm -c configure c1::dsk/c1t3d0
# zpool attach zpool-name c1t2d0 c1t3d0

1 comment:

  1. Another way to add/increase space found in another blog

    ----
    I had a mirrored ZFS pool fill up on me this week, which required me to add additional storage to ensure that my application kept functioning correctly. Since expanding storage is a trivial process with ZFS, I decided to increase the available pool storage by replacing the 36GB disks in the pool with 72GB disks. Here is the original configuration:

    $ df -h netbackup

    Filesystem size used avail capacity Mounted on
    netbackup 33G 32G 1G 96% /opt/openv
    $ zpool status -v netbackup

    pool: netbackup
    state: ONLINE
    scrub: none requested
    config:

    NAME STATE READ WRITE CKSUM
    netbackup ONLINE 0 0 0
    mirror ONLINE 0 0 0
    c1t2d0 ONLINE 0 0 0
    c1t3d0 ONLINE 0 0 0

    errors: No known data errors
    To expand the available storage, I replaced the disk c1t2d0 with a 72GB disk, and then used the zpool “replace” option to replace the old disk with the new one:

    $ zpool replace netbackup c1t2d0

    Once the pool finished resilvering (you can run `zpool status -v’ to monitor the progress), I replaced the disk c1t3d0 with a 72GB disk, and used the zpool “replace” option to replace the old disk with the new one:

    $ zpool replace netbackup c1t3d0

    Once the pool finished resilvering, I had an extra 36GB of disk space available:

    $ df -h netbackup

    Filesystem size used avail capacity Mounted on
    netbackup 67G 32G 35G 47% /opt/openv
    This is pretty powerful, and it’s nice not to have to run another utility to extend volumes and file systems once new storage is available. There is also the added benefit that ZFS resilvers at the object level, and not at the block level. Giddie up!

    ----

    ReplyDelete

Welcome to the UNIX world