how to resize a zvol (legacy version of zfs)

tech-lists tech-lists at zyxst.net
Sun Sep 13 13:03:53 UTC 2020


On Sun, Sep 13, 2020 at 01:14:55PM +0100, tech-lists wrote:
>Hi,
>
>I have a bhyve instance mounted on a zvol on a freebsd-12-stable host. I'm not
>using any special tool to manage the bhyve apart from screen.
>
>How can I resize the bhyve instance wihtout making it unusable? The zol is
>64GB and I'd like to make it 256GB.

As a test, I've successfully resized it on the host. The problem is when the
guest boots up, the guesnt's growfs (the fs in the guest is ufs) cant see the
space.

On the guest I did this:

# sysrc growfs_enable=YES
growfs_enable: NO -> YES

# reboot

then on the host, did this:

# zfs get volsize data/current
NAME                  PROPERTY  VALUE    SOURCE
data/current          volsize   64G      local

# zfs set volsize=256G data/current

# zfs get volsize data/current
NAME                  PROPERTY  VALUE    SOURCE
data/current          volsize   256G     local

log into the guest...

# mount 

/dev/vtbd0s1a on / (ufs, local, journaled soft-updates)
devfs on /dev (devfs)

# growfs /
growfs: requested size 61GB is not larger than the current filesystem size
61GB

# gpart recover /dev/vtbd0
vtbd0 recovering is not needed

# gpart resize -i 1 /dev/vtbd0
GEOM_PART: vtbd0s1 was automatically resized.
   Use `gpart commit vtbd0s1` to save changes or `gpart undo vtbd0s1` to revert
them.
vtbd0s1 resized
Sep 13 13:36:31 current syslogd: last message repeated 1 times

# gpart commit vtbd0s1
# 
# growfs /
growfs: requested size 61GB is not larger than the current filesystem size
61GB

What am I doing wrong?
-- 
J.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-fs/attachments/20200913/9f3c0217/attachment.sig>


More information about the freebsd-fs mailing list