Growing a ZFS volume

Anton Sayetsky vsjcfm at gmail.com
Mon Mar 17 11:00:47 UTC 2014


2014-03-17 12:54 GMT+02:00 Adrian Gschwend <ml-ktk at netlabs.org>:
> On 17.03.14 11:48, Anton Sayetsky wrote:
>
> Hi Anton,
>
>> autoexpand does not works, same as autoreplace. ;)
>
> In terms of it does not work in ZFS on FreeBSD?
Yep, that's right. Below I prove it:
Script started on Sat Mar  8 15:12:40 2014
root at jnb:~# truncate -s 20g /home/jason/test.fil
root at jnb:~# mdconfig -a -t vnode -f /home/jason/test.fil
md0
root at jnb:~# gpart create -s gpt md0
md0 created
root at jnb:~# gpart add -a 4k -t freebsd-zfs -s 10g md0
md0p1 added
root at jnb:~# gpart show md0
=>      34  41942973  md0  GPT  (20G)
        34         6       - free -  (3.0k)
        40  20971520    1  freebsd-zfs  (10G)
  20971560  20971447       - free -  (10G)

root at jnb:~# zpool create -o cachefile=none -o autoexpand=on -O
canmount=off ztest /dev/md0p1
root at jnb:~# zpool list ztest
NAME    SIZE  ALLOC   FREE    CAP  DEDUP  HEALTH  ALTROOT
ztest  9.94G   137K  9.94G     0%  1.00x  ONLINE  -
root at jnb:~# zpool export ztest
root at jnb:~# gpart resize -i1 -a 4k -s 15g md0
md0p1 resized
root at jnb:~# gpart show md0
=>      34  41942973  md0  GPT  (20G)
        34         6       - free -  (3.0k)
        40  31457280    1  freebsd-zfs  (15G)
  31457320  10485687       - free -  (5G)

root at jnb:~# zpool import -o cachefile=none ztest
root at jnb:~# zpool list ztest
NAME    SIZE  ALLOC   FREE    CAP  DEDUP  HEALTH  ALTROOT
ztest  9.94G   204K  9.94G     0%  1.00x  ONLINE  -
root at jnb:~# zpool online -e ztest md0p1
root at jnb:~# zpool list ztest
NAME    SIZE  ALLOC   FREE    CAP  DEDUP  HEALTH  ALTROOT
ztest  14.9G   208K  14.9G     0%  1.00x  ONLINE  -
root at jnb:~# exit

Script done on Sat Mar  8 15:13:52 2014
>
> I just expanded it with online -e, worked great.
This is the only way to expand pool. You cannot do it automatically on FreeBSD.
>
> regards
>
> Adrian


More information about the freebsd-fs mailing list