Date: Mon, 17 Nov 2025 20:30:33 +0100 (CET) From: Ronald Klop <ronald-lists@klop.ws> To: Alexandre Biancalana <biancalana@gmail.com> Cc: Freebsd fs <freebsd-fs@freebsd.org> Subject: Re: FreeBSD guest online disk resize Message-ID: <863272167.12409.1763407833561@localhost> In-Reply-To: <CAGF-nS7M6RvbP9mAHJFivLfiwLWF9fyEs%2BZoha2jvf8cat9eJw@mail.gmail.com>
index | next in thread | previous in thread | raw e-mail
[-- Attachment #1 --] Van: Alexandre Biancalana <biancalana@gmail.com> Datum: maandag, 17 november 2025 20:01 Aan: Freebsd fs <freebsd-fs@freebsd.org> Onderwerp: FreeBSD guest online disk resize > > Hello, > > I am using bhyve with several VMs where the VM disks (NVMe) are stored > on an NFS server and exported to the hypervisor. Occasionally, I need > to expand the disks due to space constraints. I perform this expansion > by resizing the VM disk files using the truncate command. > > On Linux guests, the disk resize is immediately recognized, and the > filesystem can be expanded online without issues. > > However, on FreeBSD guests, while the NVMe layer recognizes the disk > resize (confirmed by the appearance of the asynchronous event message > in dmesg): > > nvme2: async event occurred (type 0x2, info 0x00, page 0x04) > > and `nvmecontrol devlist` correctly shows the new disk size, there is a problem. > > The VM disk has no partition table and is formatted entirely with UFS > and has a ufs label, hence geom_label is in use. Unfortunately, glabel > list does not recognize the disk resize and still shows the old disk > size. > > I have tried the following attempts to force recognition of the new > size without success: > > Setting `sysctl kern.geom.debugflags=16` > > Resetting the NVMe controller with `nvmecontrol reset nvme2` > > Rescanning the disk with `camcontrol rescan nda2` and `camcontrol reprobe nda2` > > Ideally, I would like to perform a disk resize that FreeBSD recognizes > without requiring a system reboot. > > Am I missing a step, or is there a recommended procedure to make > geom_label recognize the resized disk size dynamically on FreeBSD > guests? > > > > What is the output of glabel list? And next to that, does glabel refresh <device> do something useful? Regards, Ronald. [-- Attachment #2 --] <html><head></head><body><br> <p><strong>Van:</strong> Alexandre Biancalana <biancalana@gmail.com><br> <strong>Datum:</strong> maandag, 17 november 2025 20:01<br> <strong>Aan:</strong> Freebsd fs <freebsd-fs@freebsd.org><br> <strong>Onderwerp:</strong> FreeBSD guest online disk resize</p> <blockquote style="padding-right: 0px; padding-left: 5px; margin-left: 5px; border-left: #000000 2px solid; margin-right: 0px"> <div class="MessageRFC822Viewer" id="P"> <div class="TextPlainViewer" id="P.P">Hello,<br> <br> I am using bhyve with several VMs where the VM disks (NVMe) are stored<br> on an NFS server and exported to the hypervisor. Occasionally, I need<br> to expand the disks due to space constraints. I perform this expansion<br> by resizing the VM disk files using the truncate command.<br> <br> On Linux guests, the disk resize is immediately recognized, and the<br> filesystem can be expanded online without issues.<br> <br> However, on FreeBSD guests, while the NVMe layer recognizes the disk<br> resize (confirmed by the appearance of the asynchronous event message<br> in dmesg):<br> <br> nvme2: async event occurred (type 0x2, info 0x00, page 0x04)<br> <br> and `nvmecontrol devlist` correctly shows the new disk size, there is a problem.<br> <br> The VM disk has no partition table and is formatted entirely with UFS<br> and has a ufs label, hence geom_label is in use. Unfortunately, glabel<br> list does not recognize the disk resize and still shows the old disk<br> size.<br> <br> I have tried the following attempts to force recognition of the new<br> size without success:<br> <br> Setting `sysctl kern.geom.debugflags=16`<br> <br> Resetting the NVMe controller with `nvmecontrol reset nvme2`<br> <br> Rescanning the disk with `camcontrol rescan nda2` and `camcontrol reprobe nda2`<br> <br> Ideally, I would like to perform a disk resize that FreeBSD recognizes<br> without requiring a system reboot.<br> <br> Am I missing a step, or is there a recommended procedure to make<br> geom_label recognize the resized disk size dynamically on FreeBSD<br> guests?<br> </div> <hr></div> </blockquote> <br> <br> What is the output of glabel list?<br> <br> And next to that, does glabel refresh <device> do something useful?<br> <br> Regards,<br> Ronald.<br> </body></html>home | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?863272167.12409.1763407833561>
