Bug 164741

Summary: zvol always present as 512 bytes/sector regardless of blocksize
Product: Base System Reporter: Pete French <petefrench>
Component: kernAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed Works As Intended    
Severity: Affects Only Me CC: mav
Priority: Normal    
Version: 8.2-STABLE   
Hardware: Any   
OS: Any   

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
	diskinfo

Fix: 

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.
How-To-Repeat: 
        # 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

Do
- Set Status to "Open"