1

Preface

At the company I'm working for we use database snapshots in our ETL process to ensure the data is in a consistent state. The snapshot files are placed on a separate disk (in our case the X:).

One of the source databases is a 3TB database with data updated frequently. When creating a database snapshot of this database we've encountered moments when the snapshot files increased and we've got the error:

"Operating system error 112(There is not enough space on the disk.) encountered."

That error was always in the index maintenance windows, or when a bulk process ran in the source database. Since then we've increased the available disk space on the X:\ drive and changed the schedule of index maintenance/dbcc checkdb jobs. As expected, the errors didn't occur anymore.

Problem

From time to time we need an initial load of some large tables (600.000.000 rows / 300GB per table). This week we've encountered a different error in the load of these large tables:

The operating system returned error 665(The requested operation could not be completed due to a file system limitation) to SQL Server during a write at offset 0x000056fb976000 in file 'X:\Data\DatabaseName_snapshot.ss'.

Additional messages in the SQL Server error log and system event log may provide more detail.

This error occurs only 18 - 25 hours after the snapshot is created.

Things already tried

  1. Disabled all index maintenance/dbcc checkdb jobs and other processes changing a lot of data (except user input).
  2. Monitored the available space on the snapshot disk (X:\ 400GB). About 80% of the available space is free when the error occurs.
  3. Looked for simmilar questions on stackexchange. Found DB snapshot goes into SUSPECT mode (SQL 2014 on WIN2K8R2) which was not answered.
  4. Looking into article https://blogs.msdn.microsoft.com/psssql/2015/06/10/operating-system-error-665-file-system-limitation-not-just-for-dbcc-anymore/ right now.

Does anyone have more ideas to tackle this problem?

We are using SQL Server 2014 SP2 CU1, enterprise edition and Windows Server 2012.

  • 3
    Was the X:\ volume formatted with /L:enable ? Chances are you're hitting the NTFS metadata fragmentation limit with small record sizes (default, use /L instead). – Sean Gallardy Feb 1 '17 at 14:28
  • Thank you for your time. I'l will try to format the volume with /L. I'll let you know if the problem is solved. – Ruud van de Beeten Feb 2 '17 at 9:06
  • After formatting the volume with /L the error didn't occur anymore. Seems like this was the solution. Can you answer this question, so I can accept is as the answer? – Ruud van de Beeten Feb 6 '17 at 7:48
1

The issue is around NTFS allocation maps and the amount of space they have for file allocations. In general, the more fragmented the file the more allocation mappings there needs to be.

By default when a volume is formatted for NTFS, small allocation map size is chosen (1024 bytes) whereas with /L the large allocation map size is chosen (4096 bytes).

Normally this doesn't come into play or show itself and any appreciable way... However once volumes get larger and larger or use technologies that create many small random allocations (such as database snapshots or checkdb) then it can rear its' ugly head.

To get around this, a few different options can be chosen:

  • Format the volume ntfs with /L:Enable
  • Make smaller volumes so that this doesn't happen
  • Use ReFS if on SQL 2014+

In most cases, choosing to format with /L:Enable will be the easiest and fastest option.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.