Bug 214946 - zfs autoexpand seems to be not working in 11 and above
Summary: zfs autoexpand seems to be not working in 11 and above
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 11.0-RELEASE
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-fs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-11-30 10:04 UTC by Toomas Soome
Modified: 2016-11-30 20:19 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Toomas Soome freebsd_committer freebsd_triage 2016-11-30 10:04:01 UTC
After expanding the disk for VM and using gpart resize, and setting autoexpand=on the pool does still not getting added space:

# zpool list
NAME    SIZE  ALLOC   FREE  EXPANDSZ   FRAG    CAP  DEDUP  HEALTH  ALTROOT
zroot  13.9G  11.5G  2.34G        4G    71%    83%  1.00x  ONLINE  -

# zpool get autoexpand
NAME   PROPERTY    VALUE   SOURCE
zroot  autoexpand  on      local

# zpool export zroot
# zpool list
no pools available
# zpool import -N zroot
# zpool list
NAME    SIZE  ALLOC   FREE  EXPANDSZ   FRAG    CAP  DEDUP  HEALTH  ALTROOT
zroot  13.9G  11.5G  2.35G        4G    71%    83%  1.00x  ONLINE  -

no change. however:

# zpool reopen zroot
# zpool list
NAME    SIZE  ALLOC   FREE  EXPANDSZ   FRAG    CAP  DEDUP  HEALTH  ALTROOT
zroot  17.9G  11.5G  6.34G         -    55%    64%  1.00x  ONLINE  -

but the interesting fact is, this session is done from cd boot; when zroot was booted from, even zpool reopen did not trigger the resize.
Comment 1 Steven Hartland freebsd_committer freebsd_triage 2016-11-30 17:03:33 UTC
Does running the following expand it:
zpool online -e <pool> <device>
Comment 2 Steven Hartland freebsd_committer freebsd_triage 2016-11-30 17:05:50 UTC
The process we've used in the past is details here: http://blog.multiplay.co.uk/2016/05/resizing-a-freebsd-zfs-pool/
Comment 3 Toomas Soome freebsd_committer freebsd_triage 2016-11-30 17:26:07 UTC
well, except once your disk is resized and partition size is fixed, the only thing you *supposed to do is to zpool set autoexpand=on and then off, or definitely it should get expanded with autoexpand=on on system reboot. zpool offline on your only disk in your boot poool does not seem to be very wise action to take;)
Comment 4 Steven Hartland freebsd_committer freebsd_triage 2016-11-30 19:06:27 UTC
No mention of offline, just online. The fact its already online at the time doesn't matter ;-)
Comment 5 Toomas Soome freebsd_committer freebsd_triage 2016-11-30 19:11:12 UTC
(In reply to Steven Hartland from comment #4)

oh, right, my mistake. well, the point is, you shouldn't need even that:) but as an workaround, it is valid point.

So, it means, whatever is fbsd port doing on zpool online, should also be done when autoexpand is getting set, and on zpool import (either from command line or at boot time) - that should fix this issue:)
Comment 6 Steven Hartland freebsd_committer freebsd_triage 2016-11-30 20:19:03 UTC
I believe autoexpand is only triggered in two cases:
1. Replacement of vdev.
2. When autoexpand is enabled.

I don't think that a straight pool open or reopen triggers the expansion.

Useful info can be found here:
http://docs.oracle.com/cd/E19253-01/819-5461/githb/index.html