# [FreeNAS] Resize a RAIDZ pool by replacing disks, what's wrong?



## sska (Jan 23, 2012)

Hi there!

I want to increase the size of raidz1 pool I tried to do it in VM, but without success  What am I doing wrong?

Installed system is:

```
FreeBSD freenas.local 9.0-STABLE FreeBSD 9.0-STABLE #0: Thu Jan 12 01:34:30 JST 2012     
aoyama@fbsd9.freenas.local:/usr/obj/freenas/usr/src/sys/FREENAS-amd64  amd64
```

Virtual HDDs: 3x8Gb and 3x16Gb

```
# dmesg | grep 8192MB
da1: 8192MB (16777216 512 byte sectors: 255H 63S/T 1044C)
da2: 8192MB (16777216 512 byte sectors: 255H 63S/T 1044C)
da3: 8192MB (16777216 512 byte sectors: 255H 63S/T 1044C)

# dmesg | grep 16384MB
da4: 16384MB (33554432 512 byte sectors: 255H 63S/T 2088C)
da5: 16384MB (33554432 512 byte sectors: 255H 63S/T 2088C)
da6: 16384MB (33554432 512 byte sectors: 255H 63S/T 2088C)
```

First - create raid-z:

```
# zpool create tank raidz1 da1 da2 da3

# zpool status
  pool: tank
 state: ONLINE
  scan: none requested
config:

        NAME        STATE     READ WRITE CKSUM
        tank        ONLINE       0     0     0
          raidz1-0  ONLINE       0     0     0
            da1     ONLINE       0     0     0
            da2     ONLINE       0     0     0
            da3     ONLINE       0     0     0

errors: No known data errors

# zpool list
NAME   SIZE  ALLOC   FREE    CAP  DEDUP  HEALTH  ALTROOT
tank  23.9G   174K  23.9G     0%  1.00x  ONLINE  -

# zfs list
NAME   USED  AVAIL  REFER  MOUNTPOINT
tank   116K  15.7G  40.0K  /tank
```

SIZE - 23.9G / AVAIL - 15.7G by using 3x8Gb disks.


Then replace all disks on larger:

```
# zpool replace tank da1 da4
# zpool replace tank da2 da5
# zpool replace tank da3 da6

# zpool status
  pool: tank
 state: ONLINE
  scan: resilvered 55.5K in 0h0m with 0 errors on Mon Jan 23 13:30:51 2012
config:

        NAME        STATE     READ WRITE CKSUM
        tank        ONLINE       0     0     0
          raidz1-0  ONLINE       0     0     0
            da4     ONLINE       0     0     0
            da5     ONLINE       0     0     0
            da6     ONLINE       0     0     0

errors: No known data errors
```

Re-import pool:

```
# zpool export tank
# zpool import tank
```

Here I was expecting that the pool would be larger, isn't it? But not 

```
# zpool list
NAME   SIZE  ALLOC   FREE    CAP  DEDUP  HEALTH  ALTROOT
tank  23.9G   198K  23.9G     0%  1.00x  ONLINE  -

# zfs list
NAME   USED  AVAIL  REFER  MOUNTPOINT
tank   132K  15.7G  40.0K  /tank
```

What is wrong?


----------



## phoenix (Jan 23, 2012)

Check the *autoexpand* property on the pool.  And consider the *-e* switch for the import.  Searching the forums for either of the bolded options would have found you a recent thread with the solution.


----------



## sska (Jan 23, 2012)

```
# zpool get all tank | grep autoexpand
tank  autoexpand     off         default
```
Thanks! :beer

autoexpand is set to on

```
# zpool set autoexpand=on tank
```
*-e* switch for the import is unknown :r

```
# zpool import -e tank
invalid option 'e'
usage:
        import [-d dir] [-D]
        import [-d dir | -c cachefile] [-F [-n]] <pool | id>
        import [-o mntopts] [-o property=value] ...
            [-d dir | -c cachefile] [-D] [-f] [-m] [-N] [-R root] [-F [-n]] -a
        import [-o mntopts] [-o property=value] ...
            [-d dir | -c cachefile] [-D] [-f] [-m] [-N] [-R root] [-F [-n]]
            <pool | id> [newpool]
```

Thanks, I will try to search better.


----------



## sska (Jan 23, 2012)

One more time THANKS!
Working solutions are here: search forum "General" by keyword "autoexpand"

that works for me:


```
da1 da2 da3 - 8GB
da4 da5 da6 - 16GB
```


```
# zpool create tank raidz1 da1 da2 da3
# zpool list
NAME   SIZE  ALLOC   FREE    CAP  DEDUP  HEALTH  ALTROOT
tank  23.9G   155K  23.9G     0%  1.00x  ONLINE  -
```
*Before* any disks replacing verify *autoexpand* variable for pool:

```
# zpool get all tank | grep autoexpand
tank  autoexpand     off         default
```

if *off* - set to *on*!

```
# zpool set autoexpand=on tank
```

Replace the disks, *awaiting completion of* resilvering!


```
# zpool replace tank da1 da4
# zpool replace tank da2 da5
# zpool replace tank da3 da6
```

and you're done!


```
# zpool list
NAME   SIZE  ALLOC   FREE    CAP  DEDUP  HEALTH  ALTROOT
tank  47.9G   366K  47.9G     0%  1.00x  ONLINE  -
```


----------

