Categories
Tech Uncategorized

SQL server 2016 did not start after upgrade to Windows 11

It looked bad for a while. I have tried to upgrade to Windows 11 many times. It was always something that was not ready for Windows 11. The upgrade software did not tell me what is was. I suspect it was the LSI 9211 SAS card. Yesterday there was a new message about that Windows 11 22H2 was ready for me. This time there was nothing that prevented an upgrade. After the upgrade i started to test if everything was working. The storage spaces pool was there. That means the LSI card was working. The cluster manager was working. I could not login to the Veeam backup software. After a while i saw that the SQL server database was not started. I tried to start it but it could not start. I looked in the ERROR file. This looks bad. SQL server is crashing at startup.

2022-11-05 17:12:29.55 spid5s      There have been 256 misaligned log IOs which required falling back to synchronous IO.  The current IO is on file C:\Program Files\Microsoft SQL Server\MSSQL13.VEEAMSQL2016\MSSQL\DATA\master.mdf.
2022-11-05 17:12:29.55 spid5s      11/05/22 17:12:29 Stack Overflow Dump not possible - Exception c00000fd EXCEPTION_STACK_OVERFLOW at 0x00007FFD41D6714A
2022-11-05 17:12:29.55 spid5s      SqlDumpExceptionHandler: Address=0x00007FFD41D6714A Exception Code = c00000fd
2022-11-05 17:12:29.55 spid5s      Rax=000000006ca12248 Rbx=0000000000000001 Rcx=000000007e6b4040 Rdx=0000000000000001
2022-11-05 17:12:29.55 spid5s      Rsi=0000000000000993 Rdi=000000007e6b4040 Rip=0000000041d6714a Rsp=000000006ca11f30
2022-11-05 17:12:29.55 spid5s      Rbp=000000006ca12030 EFlags=0000000000010206
2022-11-05 17:12:29.55 spid5s      cs=0000000000000033 ss=000000000000002b ds=000000000000002b
es=000000000000002b fs=0000000000000053 gs=000000000000002b
2022-11-05 17:12:29.55 spid5s      1: Frame 000000B86CA12030 Return Address 00007FFD41D6714A

It has something to do with block size on the volume the database file is stored. SQL server must have block size 512B or 4KB. https://learn.microsoft.com/en-us/troubleshoot/sql/admin/troubleshoot-os-4kb-disk-sector-size

If i run the command “fsutil fsinfo sectorinfo c:” i get.

PS C:\Users\Kalle> fsutil fsinfo sectorinfo c:
LogicalBytesPerSector :                                 512
PhysicalBytesPerSectorForAtomicity :                    4096
PhysicalBytesPerSectorForPerformance :                  16384
FileSystemEffectivePhysicalBytesPerSectorForAtomicity : 4096
Device Alignment :                                      Aligned (0x000)
Partition alignment on device :                         Aligned (0x000)
No Seek Penalty
Trim Supported
Not DAX capable
Not Thinly-Provisioned

SQL server dont like the PhysicalBytesPerSectorForPerformance : 16384 part. Luckily there is a trace flag for SQL server to make it always use 4KB. It is trace flag 1800. If you add -t1800 to the sql server command line it will start.

Leave a Reply

Your email address will not be published. Required fields are marked *