Skip to content

Instantly share code, notes, and snippets.

@danielb2
Created April 10, 2017 21:19
Show Gist options
  • Select an option

  • Save danielb2/af0b9771b2fbd83424951b8df170bc69 to your computer and use it in GitHub Desktop.

Select an option

Save danielb2/af0b9771b2fbd83424951b8df170bc69 to your computer and use it in GitHub Desktop.

Revisions

  1. danielb2 created this gist Apr 10, 2017.
    35 changes: 35 additions & 0 deletions zfs-resize.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,35 @@
    ``` bash
    [~/tmp]$ ls -lh j1 j2 z1 z2
    -rw-r--r-- 1 daniel daniel 174M Apr 10 13:11 j1
    -rw-r--r-- 1 daniel daniel 174M Apr 10 13:11 j2
    -rw-r--r-- 1 daniel daniel 731M Apr 10 13:10 z1
    -rw-r--r-- 1 daniel daniel 731M Apr 10 13:10 z2

    $ sudo zpool create ztest mirror (pwd)/j1 (pwd)/j2

    $ sudo zpool set autoexpand=on ztest

    [~/tmp]$ zpool status ztest
    pool: ztest
    state: ONLINE
    scan: none requested
    config:

    NAME STATE READ WRITE CKSUM
    ztest ONLINE 0 0 0
    mirror-0 ONLINE 0 0 0
    /usr/home/daniel/tmp/j1 ONLINE 0 0 0
    /usr/home/daniel/tmp/j2 ONLINE 0 0 0

    errors: No known data errors

    [~/tmp]$ zfs list ztest
    NAME USED AVAIL REFER MOUNTPOINT
    ztest 74.5K 128M 19K /ztest

    [~/tmp]$ sudo zpool replace -f ztest (pwd)/j2 (pwd)/z2
    [~/tmp]$ sudo zpool replace -f ztest (pwd)/j1 (pwd)/z1

    [~/tmp]$ zfs list ztest
    NAME USED AVAIL REFER MOUNTPOINT
    ztest 86.5K 688M 19K /ztest