Bhyve storage improvements (was: Several bhyve quirks)

Julian Hsiao madoka at
Tue Mar 31 05:59:22 UTC 2015

On 2015-03-27 09:46:50 +0000, Alexander Motin said:

> [snip]
> Also both virtio-blk and ahci-hd drivers now report to guest logical and
> physical block sizes of underlying storage, that allow guests properly
> align partitions and I/Os for best compatibility and performance.

Hi Alexander,

In a previous reply from Peter Grehan, he said that ahci-hd should 
already report the correct block size in 10.1.  I had some time to try 
it out today, but I'm still having issues:

$ zfs create \
    -o compression=off \
    -o primarycache=metadata \
    -o secondarycache=metadata \
    -o volblocksize=4096 \
    -o refreservation=none \
    -V 10G \
$ geli init -B none -e AES-XTS -K test.key -l 128 -P -s 4096 \
$ geli attach -p -k test.key zvol/zroot/usr/bhyve/test/img
[set up device map, grub-bhyve, etc.]
$ bhyve -A -c 1 -H -P -m 256 \
    -s 0:0,hostbridge \
    -s 1:0,ahci-hd,img.eli \
    -s 2:0,ahci-cd,ubuntu-14.10-server-amd64.iso \
    -s 31,lpc -l com1,stdio \
[boot guest to recovery console]
$ fdisk -l /dev/sda
fdisk: cannot open /dev/sda: Input/output error

And syslog shows a lot of errors accessing sda.

Note that the actual HDD has 512-byte sectors, so perhaps bhyve is 
getting the sector size from the hardware and not from geli / ZFS?

Julian Hsiao

More information about the freebsd-virtualization mailing list