See: blocksize.c (Source) and blocksize (binary, compiled on Solaris 10/x86).
Note that on the x86 platform, this will only work if the disks are attached to the sd driver (because the DKIOCGMEDIAINFOEXT ioctl is implemented only there and not in the cmdk driver). This will be the case if you use an AHCI controller supported by ahci(7d).
In my case (this is on 5.10 Generic_142910-17)
root@ilbirs> format -e </dev/null | egrep "[0-9]\."
0. c0t0d0 <DEFAULT cyl 30390 alt 2 hd 255 sec 63>
1. c0t1d0 <ATA-Hitachi HDS72107-A70M-698.64GB>
2. c0t3d0 <ATA-WDC WD20EARS-00M-AB50-1.82TB>
3. c0t4d0 <ATA-Hitachi HDS72107-A70M-698.64GB>
root@ilbirs> ./blocksize /dev/rdsk/c0t3d0
dkmp.dki_capacity = 3907029167
dkmp.dki_lbsize = 512
dkmp_ext.dki_capacity = 3907029167
dkmp_ext.dki_lbsize = 512
dkmp_ext.dki_pbsize = 512
root@ilbirs> ./blocksize /dev/rdsk/c0t4d0
dkmp.dki_capacity = 1465149167
dkmp.dki_lbsize = 512
dkmp_ext.dki_capacity = 1465149167
dkmp_ext.dki_lbsize = 512
dkmp_ext.dki_pbsize = 512
The above WD20EARS is revision "00MVWB0". I have another one at revision "00J2GB0", unfortunately hanging on a controller unsupported by ahci(7d).
If anybody has a WDxxEARS correctly reporting a dki_pbsize = 4096, I would love to hear it.
Edit:
If anybody has a Samsung HD204UI, I would also like to know if this disk correctly reports the physical block size.
1. c10t9d1 < ATA-SAMSUNG HD204UI-0001-1.82TB >
/pci@0,0/pci15ad,7a0@15,1/pci1014,3b1@0/sd@9,1
root@tank:~# ./blocksize /dev/rdsk/c10t9d1
dkmp.dki_capacity = 3907029168
dkmp.dki_lbsize = 512
dkmp_ext.dki_capacity = 3907029168
dkmp_ext.dki_lbsize = 512
dkmp_ext.dki_pbsize = 512
root@media:~# ./blocksize /dev/rdsk/c9t3d0
dkmp.dki_capacity = 3907029168
dkmp.dki_lbsize = 512
dkmp_ext.dki_capacity = 3907029168
dkmp_ext.dki_lbsize = 512
dkmp_ext.dki_pbsize = 512
Since I didn't know about the jumper setting before I installed the drives, I am resilvering my raidz now one drive at a time. I'll report any improvements in performance.
printf ("dkmp_ext.dki_capacity = %llu\n", dkmp_ext.dki_capacity);
printf ("dkmp_ext.dki_lbsize = %u\n", dkmp_ext.dki_lbsize);
printf ("dkmp_ext.dki_pbsize = %u\n", dkmp_ext.dki_lbsize);
shouldn't the second line look like this?:
printf ("dkmp_ext.dki_pbsize = %u\n", dkmp_ext.dki_pbsize);
You are absolutely right. Will fix this tomorrow for the downloadable file.
Thanks!