Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 08 Feb 2017 10:58:56 -0600
From:      "Dean E. Weimer" <dweimer@dweimer.net>
To:        Allan Jude <allanjude@freebsd.org>
Cc:        freebsd-virtualization@freebsd.org, owner-freebsd-virtualization@freebsd.org
Subject:   Re: Resizing ZVOL used for bhyve VM.
Message-ID:  <6377c5cd376f0111e0e8e186c4ef4a41@dweimer.net>
In-Reply-To: <495d71a8-b4e0-fe9a-401f-a2ef607fbd3d@freebsd.org>
References:  <cbf9bb34ae4114d68af96b5a5fc25ae1@dweimer.net> <495d71a8-b4e0-fe9a-401f-a2ef607fbd3d@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2017-02-08 9:24 am, Allan Jude wrote:
> On 2017-02-08 00:23, Dean E. Weimer wrote:
>> I am trying to resize a secondary data disk on a Debian Linux Virtual
>> machine. The data really isn't all that important, its video from IP
>> security cameras. Since nothing has happened that needs reviewed I 
>> could
>> scrap it and start over. However I can't even do that.
>> 
>> I tried just setting the volsize to a larger value while the vm is
>> shutdown. zfs excepts the command, I boot up the VM but it is not
>> recognizing the volume properly I can see that its grown, but it 
>> errors
>> trying to update the GPT partition table with the new size. I gave up
>> shutdown VM and tried to delete the zvol so I could create a new one.
>> However it believes the zvol is in use and wont let me destroy it. So
>> something funky seems to be going on. oddly enough I set the zvol back
>> to the original size boot up the vm, all the data is intact and
>> functioning just fine. So somehow I can't break it despite doing all
>> kinds of things that could have and probably should have destroyed the
>> data.
>> 
>> I am going to guess the only thing I have left to try is disable vms 
>> on
>> startup and reboot to see if I can then destroy the zvol and create a
>> new larger one. But I was hoping someone else might have another
>> suggestion to correctly increase the volume size.
>> 
> 
> Make sure you actually destroy the bhyve vm, not just shut it down.
> 
> You may also be having issues where GEOM on the host has locked the
> device when it saw the disk resize. You likely want to have the zfs
> property 'volmode' set to 'dev', instead of the default 'geom', to
> prevent this when using bhyve.
> 
> I'd recommend, with the bhyve 'destroyed' (the instance, not your 
> data),
> gpart recover zvol/path/name
> 
> To rewrite the backup copy of the GPT table at the new end of the 
> drive.
> 
> Then try booting the VM again.

I was missing the volmode setting as dev. I had it on the virtual 
machine's system disk zvol but not its secondary data disk. I went ahead 
and decided to delete the disk and recreate it after all the messing 
around just in case I had corrupted something. I did verify though that 
with this setting I was able to shutdown the VM and then delete the new 
disk and recreate it. So it definately was the dev volmode setting not 
being there that was causing the lock, and likely causing the resize to 
fail.

-- 
Thanks,
    Dean E. Weimer
    http://www.dweimer.net/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6377c5cd376f0111e0e8e186c4ef4a41>