Bug 164741 - zvol always present as 512 bytes/sector regardless of blocksize
Summary: zvol always present as 512 bytes/sector regardless of blocksize
Status: Closed Works As Intended
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 8.2-STABLE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
Depends on:
Reported: 2012-02-03 16:50 UTC by Pete French
Modified: 2018-05-21 06:33 UTC (History)
1 user (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Pete French 2012-02-03 16:50:09 UTC
	A zvol may be created with a specific sectorsize, specified with -b
	or the volblocksize property. The resulting device in /dev/zvol
	always appears to have 512 bytes per sector however, as reported by


For zvols to be uses as iscsi devices the desired blocksize can
	be specified in the istgt config file. For volumes being used
	internally however (e.g. as volumed for VirtualBox machines)
	I have discovered no workaround.
        # zfs create -V 1G -b 512 tank/test1
        # zfs create -V 1G -b 4k tank/test2
        # zfs create -V 1G tank/test3
        # zfs get volblocksize tank/test1 tank/test2 tank/test3
        NAME        PROPERTY      VALUE     SOURCE
        tank/test1  volblocksize  512       -
        tank/test2  volblocksize  4K        -
        tank/test3  volblocksize  8K        -
        # diskinfo /dev/zvol/tank/test*
        /dev/zvol/tank/test1    512     1073741824      2097152 0       0
        /dev/zvol/tank/test2    512     1073741824      2097152 0       0
        /dev/zvol/tank/test3    512     1073741824      2097152 0       0
Comment 1 Alexander Motin freebsd_committer 2014-09-15 20:06:17 UTC
I don't think this is a bug, more like a feature request.

ZVOL in that place behaves exactly like 512e (Advanced Format) HDDs. Last time it even reports its block size as stripesize property to GEOM, and CTL now announces that size to the iSCSI layer as disk's physical sector size size.

I have no idea whether VirtualBox supports reporting physical sector size, or large sectors at all, but I think it should.
Comment 2 Eitan Adler freebsd_committer freebsd_triage 2018-05-20 23:52:23 UTC
For bugs matching the following conditions:
- Status == In Progress
- Assignee == "bugs@FreeBSD.org"
- Last Modified Year <= 2017

- Set Status to "Open"