Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 18 Jun 2020 00:45:48 +0000
From:      bugzilla-noreply@freebsd.org
To:        virtualization@FreeBSD.org
Subject:   [Bug 247367] Sometimes, GPT-labeled partitions don't appear in /dev/gpt/ in a FreeBSD BHYVE guest
Message-ID:  <bug-247367-27103@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D247367

            Bug ID: 247367
           Summary: Sometimes, GPT-labeled partitions don't appear in
                    /dev/gpt/ in a FreeBSD BHYVE guest
           Product: Base System
           Version: 12.1-RELEASE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: bhyve
          Assignee: virtualization@FreeBSD.org
          Reporter: seb@boisvert.info

Actual result
-------------

According to "glabel", my disk has 3 GPT labels:

root@nova:~ # gpart show -l
=3D>      40  41942960  vtbd0  GPT  (20G)
        40       216         - free -  (108K)
       256      1024      1  boot0  (512K)
      1280  39844608      2  root0  (19G)
  39845888   2097112      3  swap0  (1.0G)

But in /dev/gpt/, only boot0 is detected.

root@nova:~ # ls /dev/gpt
boot0


Also, "glabel refresh" fails too:

root@nova:~ # glabel refresh vtbd0
Can't refresh metadata from vtbd0: Operation not permitted.


I don't think that GPT labels depends on the type of disk (VirtIO, AHCI/SAT=
A,=20
, SCSI, and so on).


Expected result
---------------

I expect to see 3 entries in /dev/gpt/, namely:
- /dev/gpt/boot0
- /dev/gpt/root0
- /dev/gpt/swap0

I am only seeing /dev/gpt/boot0.


Why this is important
---------------------

This is annoying because in the BHYVE guest config file, I want to change
the disk type from virtio-blk to ahci-hd since virtio-blk does not support =
TRIM
and ahci-hd does.

In Linux, I use /dev/disk/by-uuid/* to avoid using the
/dev/something-not-portable.


BHYVE guest config
------------------

root@atlantis:~ # cat /tank/vm-bhyve/nova/nova.conf
loader=3D"bhyveload"
cpu=3D1
memory=3D256M
network0_type=3D"virtio-net"
network0_switch=3D"public"
disk0_type=3D"virtio-blk"
disk0_name=3D"disk0"
disk0_dev=3D"zvol"
uuid=3D"788979be-a7b4-11ea-a49d-a8a15906202d"
network0_mac=3D"58:9c:fc:0c:50:9c"


Disk ZVOL in the BHYVE host
---------------------------

Inside the VM, only 5.4G is Used:

root@nova:~ # df -h /
Filesystem      Size    Used   Avail Capacity  Mounted on
/dev/vtbd0p2     18G    5.4G     12G    32%    /


But the FreeBSD 12.1 guest has a ZVOL with REFER=3D20.1G:

root@atlantis:~ # zfs list tank/vm-bhyve/nova/disk0
NAME                       USED  AVAIL  REFER  MOUNTPOINT
tank/vm-bhyve/nova/disk0  20.6G  5.04T  20.1G  -


Comparison with a Debian guest
------------------------------

Inside the VM, Used is 1.1G.

capside@capside:~$ df -h /
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda1       125G  1.1G  118G   1% /


And the corresponding ZVOL has a REFER=3D4.13G.

root@atlantis:~ # zfs list tank/vm-bhyve/capside/disk0
NAME                          USED  AVAIL  REFER  MOUNTPOINT
tank/vm-bhyve/capside/disk0   132G  5.17T  4.13G  -

--=20
You are receiving this mail because:
You are the assignee for the bug.=



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