ZFS not using whole partition

Hi!

I've moved FreeBSD from an old disk to a new one. The disk has 50 GiB space available. Partitions are (it is a
gpt partitioned disk):
Code:
# gpart show
=>       40  104857520  vtbd0  GPT  (50G)
         40       1024      1  freebsd-boot  (512K)
       1064   12582912      2  freebsd-swap  (6.0G)
   12583976   92273584      3  freebsd-zfs  (44G)

ZFS has 44GiB space available.
Code:
# zpool list
NAME    SIZE  ALLOC   FREE  CKPOINT  EXPANDSZ   FRAG    CAP  DEDUP    HEALTH  ALTROOT
zroot  43.8G  22.8G  20.9G        -         -    35%    52%  1.00x    ONLINE  -

This seems ok too, since the zpool is sized 43.8GiB. But now:
Code:
# df -h
Filesystem                   Size    Used   Avail Capacity  Mounted on
zroot                         20G    641M     20G     3%    /
devfs                        1.0K      0B    1.0K     0%    /dev
zroot/home                    20G    136K     20G     0%    /home
zroot/tmp                     20G    124M     20G     1%    /tmp
zroot/usr                     26G    6.1G     20G    24%    /usr
zroot/usr/ports               23G    3.6G     20G    16%    /usr/ports
zroot/usr/ports/distfiles     20G    128K     20G     0%    /usr/ports/distfiles
zroot/usr/ports/packages      20G     96K     20G     0%    /usr/ports/packages
zroot/usr/src                 25G    5.5G     20G    22%    /usr/src
zroot/var                     26G    6.4G     20G    25%    /var
zroot/var/crash               20G     96K     20G     0%    /var/crash
zroot/var/db                  20G    189M     20G     1%    /var/db
zroot/var/db/pkg              20G    104M     20G     1%    /var/db/pkg
zroot/var/empty               20G     96K     20G     0%    /var/empty
zroot/var/log                 20G    1.6M     20G     0%    /var/log
zroot/var/mail                20G    120K     20G     0%    /var/mail
zroot/var/run                 20G    208K     20G     0%    /var/run
zroot/var/tmp                 20G    124K     20G     0%    /var/tmp
procfs                       8.0K      0B    8.0K     0%    /proc
linprocfs                    8.0K      0B    8.0K     0%    /usr/compat/linux/proc
fdescfs                      1.0K      0B    1.0K     0%    /dev/fd

df says the filesystem has 20 GiB available! And it seems this is all zfs can allocate.
Since autoexpand is set to true:
Code:
# zpool get autoexpand zroot
NAME   PROPERTY    VALUE   SOURCE
zroot  autoexpand  on      local

Any idea why zfs does not use the remaining ~20GiB of the partition?
 
It is using all the spaces, it is df that does not show the real size.
Use zfs list -o space to know the real used space.
For df, it compute the size from what is available and what is used (but not the space used by snapshot).
 
It is using all the spaces, it is df that does not show the real size.
Use zfs list -o space to know the real used space.
For df, it compute the size from what is available and what is used (but not the space used by snapshot).
# zfs list -o space
NAME AVAIL USED USEDSNAP USEDDS USEDREFRESERV USEDCHILD
zroot 19.6G 22.8G 0B 641M 0B 22.2G
zroot/home 19.6G 232K 0B 136K 0B 96K
zroot/home/sct-muc 19.6G 96K 0B 96K 0B 0B
zroot/tmp 19.6G 124M 0B 124M 0B 0B
zroot/usr 19.6G 15.3G 0B 6.13G 0B 9.15G
zroot/usr/ports 19.6G 3.64G 0B 3.64G 0B 224K
zroot/usr/ports/distfiles 19.6G 128K 0B 128K 0B 0B
zroot/usr/ports/packages 19.6G 96K 0B 96K 0B 0B
zroot/usr/src 19.6G 5.51G 0B 5.51G 0B 0B
zroot/var 19.6G 6.71G 0B 6.42G 0B 294M
zroot/var/crash 19.6G 96K 0B 96K 0B 0B
zroot/var/db 19.6G 292M 0B 189M 0B 104M
zroot/var/db/pkg 19.6G 104M 0B 104M 0B 0B
zroot/var/empty 19.6G 96K 0B 96K 0B 0B
zroot/var/log 19.6G 1.50M 0B 1.50M 0B 0B
zroot/var/mail 19.6G 120K 0B 120K 0B 0B
zroot/var/run 19.6G 200K 0B 200K 0B 0B
zroot/var/tmp 19.6G 124K 0B 124K 0B 0B

# df -hT
Filesystem Type Size Used Avail Capacity Mounted on
zroot zfs 20G 641M 20G 3% /
devfs devfs 1.0K 0B 1.0K 0% /dev
zroot/home zfs 20G 136K 20G 0% /home
zroot/home/sct-muc zfs 20G 96K 20G 0% /home/sct-muc
zroot/tmp zfs 20G 124M 20G 1% /tmp
zroot/usr zfs 26G 6.1G 20G 24% /usr
zroot/usr/ports zfs 23G 3.6G 20G 16% /usr/ports
zroot/usr/ports/distfiles zfs 20G 128K 20G 0% /usr/ports/distfiles
zroot/usr/ports/packages zfs 20G 96K 20G 0% /usr/ports/packages
zroot/usr/src zfs 25G 5.5G 20G 22% /usr/src
zroot/var zfs 26G 6.4G 20G 25% /var
zroot/var/crash zfs 20G 96K 20G 0% /var/crash
zroot/var/db zfs 20G 189M 20G 1% /var/db
zroot/var/db/pkg zfs 20G 104M 20G 1% /var/db/pkg
zroot/var/empty zfs 20G 96K 20G 0% /var/empty
zroot/var/log zfs 20G 1.5M 20G 0% /var/log
zroot/var/mail zfs 20G 120K 20G 0% /var/mail
zroot/var/run zfs 20G 200K 20G 0% /var/run
zroot/var/tmp zfs 20G 124K 20G 0% /var/tmp
procfs procfs 8.0K 0B 8.0K 0% /proc
linprocfs linprocfs 8.0K 0B 8.0K 0% /usr/compat/linux/proc
fdescfs fdescfs 1.0K 0B 1.0K 0% /dev/fd

While:
# gpart show
=> 40 104857520 vtbd0 GPT (50G)
40 1024 1 freebsd-boot (512K)
1064 12582912 2 freebsd-swap (6.0G)
12583976 92273584 3 freebsd-zfs (44G)

Looks a lot like zfs is not using all available space within gpt-partition 3. Only 20G are "seen". Since autoexpand ist set to on I did expect zfs to expand its partition to take the additional available space – at least after rebooting.
 
What's the output of df -ahT
# df -ahT
Filesystem Type Size Used Avail Capacity Mounted on
zroot zfs 20G 641M 20G 3% /
devfs devfs 1.0K 0B 1.0K 0% /dev
zroot/home zfs 20G 136K 20G 0% /home
zroot/home/sct-muc zfs 20G 96K 20G 0% /home/sct-muc
zroot/tmp zfs 20G 124M 20G 1% /tmp
zroot/usr zfs 26G 6.1G 20G 24% /usr
zroot/usr/ports zfs 23G 3.6G 20G 16% /usr/ports
zroot/usr/ports/distfiles zfs 20G 128K 20G 0% /usr/ports/distfiles
zroot/usr/ports/packages zfs 20G 96K 20G 0% /usr/ports/packages
zroot/usr/src zfs 25G 5.5G 20G 22% /usr/src
zroot/var zfs 26G 6.4G 20G 25% /var
zroot/var/crash zfs 20G 96K 20G 0% /var/crash
zroot/var/db zfs 20G 189M 20G 1% /var/db
zroot/var/db/pkg zfs 20G 104M 20G 1% /var/db/pkg
zroot/var/empty zfs 20G 96K 20G 0% /var/empty
zroot/var/log zfs 20G 1.5M 20G 0% /var/log
zroot/var/mail zfs 20G 120K 20G 0% /var/mail
zroot/var/run zfs 20G 200K 20G 0% /var/run
zroot/var/tmp zfs 20G 124K 20G 0% /var/tmp
procfs procfs 8.0K 0B 8.0K 0% /proc
linprocfs linprocfs 8.0K 0B 8.0K 0% /usr/compat/linux/proc
fdescfs fdescfs 1.0K 0B 1.0K 0% /dev/fd
 
# zfs list -o space
NAME AVAIL USED USEDSNAP USEDDS USEDREFRESERV USEDCHILD
zroot 19.6G 22.8G 0B 641M 0B 22.2G

While:
# gpart show
=> 40 104857520 vtbd0 GPT (50G)
40 1024 1 freebsd-boot (512K)
1064 12582912 2 freebsd-swap (6.0G)
12583976 92273584 3 freebsd-zfs (44G)

Looks a lot like zfs is not using all available space within gpt-partition 3. Only 20G are "seen". Since autoexpand ist set to on I did expect zfs to expand its partition to take the additional available space – at least after rebooting.
So you have 22.8 G used, and have 19.6Gb available so it mostly add up to 40Gb.
So no it see all the storage, it is just that you already used half of it.
 
So you have 22.8 G used, and have 19.6Gb available so it mostly add up to 40Gb.
So no it see all the storage, it is just that you already used half of it.
This means misinterpretation of data output on my side.
on the other hand: it takes around 17GiB it compile world (most object-files) and then compiling kernel takes another +4GiB?
 
Back
Top