SOLVED iscsi physical sector size

Status
Not open for further replies.

flake

Dabbler
Joined
Oct 5, 2011
Messages
15
i dont know if it is a bug, or if i missed something.

i have an iscsi target mounted by an MS hyper-v server as a raw disk
on that disk sits a windows 2008 r2
my iscsi logical block size is 512

after upgrading from 9.2.1.8 to 9.3 the disk reports physical sector size 131072 (i think it was 4096 before but not sure).

fsutil fsinfo ntfsinfo c:

Version : 3.1
Bytes per sector : 512
Bytes per physischen sector : 131072
Bytes per Cluster : 4096
Bytes per filedatasegment : 1024
Cluster per filedatasegment : 0

windows runs, but has several problems.
for example:

esentutl /g %windir%\security\Database\secedit.sdb
Extensible Storage Engine Utilities for Microsoft(R) Windows(R) Version 6.1
Copyright (C) Microsoft Corporation. All Rights Reserved.

Initiating INTEGRITY mode...
Database: C:\Windows\security\Database\secedit.sdb
Temp. Database: TEMPINTEG5256.EDB

Operation terminated with error -583 (JET_errSectorSizeNotSupported, The physical sector size reported by the disk subsystem, is unsupported by ESE for a specific file type.)

also an mssql database is no longer able to start, because the master table was created for 4096 bytes sector.
 
Last edited:

mav@

iXsystems
iXsystems
Joined
Sep 29, 2011
Messages
1,428
FreeNAS 9.3 reports physical block size equal to block/record size of underlying storage (zvol or dataset). Probably your storage has 128K block size. At this point there is no way to make new iSCSI target to lie about that. Theoretically you may recreate your storage with 4K block size as MSSQL wants, but it will probably be a large penalization for linear I/O.
 

mav@

iXsystems
iXsystems
Joined
Sep 29, 2011
Messages
1,428
I am not a Windows expert to know whether it is possible to fix that on Windows side. From FreeNAS side the only option I see is adding new WebUI option. Please create feature request if you find no other solution.
 

flake

Dabbler
Joined
Oct 5, 2011
Messages
15
hi mav,
thanks for the response and for the feature request.
 

mav@

iXsystems
iXsystems
Joined
Sep 29, 2011
Messages
1,428
Latest 9.3 nightly build includes per-extent checkbox to disable physical block reporting, that should help with this problem. It should be also included into the next 9.3-STABLE update, when it is released.
 

flake

Dabbler
Joined
Oct 5, 2011
Messages
15
I switched the train to nightly and disabling the physical block reporting is working as intended. Thank you again for the afford.
When just mounting the iscsi drive it shows as 4096 bytes.

Bytes Per Sector : 512
Bytes Per Physical Sector : 4096
Bytes Per Cluster : 4096
Bytes Per FileRecord Segment : 1024

but when booting the virtual machine with it, it still shows 131072. Still causing the same problems as before. Somehow windows remembered the last reported sector size and is stuck with it?
 

mav@

iXsystems
iXsystems
Joined
Sep 29, 2011
Messages
1,428
When just mounting the iscsi drive it shows as 4096 bytes but when booting the virtual machine with it, it still shows 131072. Still causing the same problems as before. Somehow windows remembered the last reported sector size and is stuck with it?
Can't say much about Windows virtual machines, but you may try to explicitly set 4096 bytes psectorsize in /etc/ctl.conf instead of zero and restart ctld with `service ctld restart`. Just a guess, may be different explicitly passed value can replace the cached one? If even then won't help -- then questions to Microsoft.
 

mav@

iXsystems
iXsystems
Joined
Sep 29, 2011
Messages
1,428
Will it still work if you now revert that option back to zero? So, is this a caching, or it needs it be set to 4K permanently?
 

flake

Dabbler
Joined
Oct 5, 2011
Messages
15
i reverted back to zero. interesting result, now it shows 512bytes:

Bytes Per Sector : 512
Bytes Per Physical Sector : 512
Bytes Per Cluster : 4096
Bytes Per FileRecord Segment : 1024
 

Scott Hosier

Cadet
Joined
Sep 3, 2015
Messages
2
I am having the same issue installing an 2012 SQL cluster node. Using freenas 9.3-stable. Looking at the cal.conf file I do not see a psectorsize setting?
 

Scott Hosier

Cadet
Joined
Sep 3, 2015
Messages
2
please ignore my previous post.. i didnt realize the per-extent checkbox to disable physical block option was there. I deleted my extent, recreated extent checking the box. Formatted on windows side and all is well. Thanks this thread was invaluable for this issue!
 

flake

Dabbler
Joined
Oct 5, 2011
Messages
15
for future reference
I am having the same issue installing an 2012 SQL cluster node. Using freenas 9.3-stable. Looking at the cal.conf file I do not see a psectorsize setting?
there is no "psectorsize" (i think mav only abbreviated there) the actual setting name is just "blocksize".

The option to not publish the blocksize (pblocksize) is crucial when running a mssql server
 

mav@

iXsystems
iXsystems
Joined
Sep 29, 2011
Messages
1,428
The option of not reporting physical sector size should indeed look like: "option pblocksize 0". I've just checked it, and it indeed looks like that.
 

user76838763

Cadet
Joined
Oct 3, 2018
Messages
4
I just installed SQL 2012 in a virtualized lab environment using FreeNAS iSCSI and got the error above when finishing my sql installation and I can't start SQL. ntfsinfo reports 4096 but not sectorinfo, which reports 131072.

Windows PowerShell
Copyright (C) 2013 Microsoft Corporation. All rights reserved.

PS C:\Users\administrator.TESTDOMAIN> fsutil fsinfo sectorInfo E:
LogicalBytesPerSector : 512
PhysicalBytesPerSectorForAtomicity : 131072
PhysicalBytesPerSectorForPerformance : 131072
FileSystemEffectivePhysicalBytesPerSectorForAtomicity : 4096
Device Alignment : Aligned (0x000)
Partition alignment on device : Aligned (0x000)
No Seek Penalty
Trim Not Supported
PS C:\Users\administrator.TESTDOMAIN> fsutil fsinfo ntfsInfo E:
NTFS Volume Serial Number : 0xacf6d135f6d1010e
NTFS Version : 3.1
LFS Version : 2.0
Number Sectors : 0x00000000013fe7ff
Total Clusters : 0x000000000027fcff
Free Clusters : 0x000000000027ba56
Total Reserved : 0x0000000000000000
Bytes Per Sector : 512
Bytes Per Physical Sector : 4096
Bytes Per Cluster : 4096
Bytes Per FileRecord Segment : 1024
Clusters Per FileRecord Segment : 0
Mft Valid Data Length : 0x0000000000040000
Mft Start Lcn : 0x00000000000c0000
Mft2 Start Lcn : 0x0000000000000002
Mft Zone Start : 0x00000000000c0040
Mft Zone End : 0x00000000000cc840
Resource Manager Identifier : 785456E5-C723-11E8-80BC-000C29CE4CFF
PS C:\Users\administrator.TESTDOMAIN>


I'll try that checkbox.
 
Last edited:

user76838763

Cadet
Joined
Oct 3, 2018
Messages
4
After checking the checkbox I had to restart the iscsi service on the nas. now windows shows:
PS C:\Users\administrator.TESTDOMAIN> fsutil fsinfo sectorinfo E:
LogicalBytesPerSector : 512
PhysicalBytesPerSectorForAtomicity : 512
PhysicalBytesPerSectorForPerformance : 512
FileSystemEffectivePhysicalBytesPerSectorForAtomicity : 512
Device Alignment : Aligned (0x000)
Partition alignment on device : Aligned (0x000)
No Seek Penalty
Trim Not Supported

and I needed to re-install SQL server.
 
Last edited:

mav@

iXsystems
iXsystems
Joined
Sep 29, 2011
Messages
1,428
now windows shows:
Trim Not Supported

Are you using file-backed extent? Both physical block size of 128KB and lack of trim tell so. I would recommend to reconsider that. I don't know how you are planning to use the database, but 128KB block size, default for datasets, unlike ZVOLs, is not very suitable for random updates. Lack of TRIM also doesn't help.
 

user76838763

Cadet
Joined
Oct 3, 2018
Messages
4
Yes I am using file-backed. I was just testing a clustered SQL install procedure. Not planning to do anything with the actual SQL databases.

Just for fun, I created a disk based extent without checking the disable sector reporting checkbox and and mounted to drive letter F: on the same Windows VM:


PS C:\Users\administrator.TESTDOMAIN> fsutil fsinfo sectorinfo F:
LogicalBytesPerSector : 512
PhysicalBytesPerSectorForAtomicity : 512
PhysicalBytesPerSectorForPerformance : 512
FileSystemEffectivePhysicalBytesPerSectorForAtomicity : 512
Device Alignment : Aligned (0x000)
Partition alignment on device : Aligned (0x000)
No Seek Penalty
Trim Not Supported
PS C:\Users\administrator.TESTDOMAIN> fsutil fsinfo ntfsinfo F:
NTFS Volume Serial Number : 0x88f6d339f6d3266a
NTFS Version : 3.1
LFS Version : 2.0
Number Sectors : 0x00000000027fe7ff
Total Clusters : 0x00000000004ffcff
Free Clusters : 0x00000000004fc98b
Total Reserved : 0x0000000000000000
Bytes Per Sector : 512
Bytes Per Physical Sector : 512
Bytes Per Cluster : 4096
Bytes Per FileRecord Segment : 1024
Clusters Per FileRecord Segment : 0
Mft Valid Data Length : 0x0000000000040000
Mft Start Lcn : 0x00000000000c0000
Mft2 Start Lcn : 0x0000000000000002
Mft Zone Start : 0x00000000000c0000
Mft Zone End : 0x00000000000cc820
Resource Manager Identifier : 40AD86EA-C7EF-11E8-80C5-000C29CE4CFF


The FreeNAS instance is installed in a vmware workstation VM. So even though it is disk backed, it is a vmware vmdk virtual disk. I am running the VM on an SSD on my laptop.
 

user76838763

Cadet
Joined
Oct 3, 2018
Messages
4
For anyone interested, the SQL error I was getting was Event ID 5178:

Cannot use file 'E:\MSSQL11.OASYSHDB\MSSQL\DATA\mastlog.ldf' because it was originally formatted with sector size 4096 and is now on a volume with sector size 131072. Move the file to a volume with a sector size that is the same as or smaller than the original sector size.

Which is what led me here.
 
Status
Not open for further replies.
Top