Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PCHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
FREEDOM251

Freedom251 › Blog › error code 665

How to Fix Windows Error Code 665 (File System Limitation)

By Freedom251 Team · · 11 min read

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Windows error 665 means ERROR_FILE_SYSTEM_LIMITATION (0x00000299): “The requested operation could not be completed due to a file system limitation.” It usually appears when a very fragmented NTFS file, especially a compressed or sparse file, can no longer grow because its metadata has reached a filesystem limit. The number is not universal, however: calculators, appliances, backup programs and other vendors also use 665 for unrelated conditions. Confirm the product, complete message and failed operation before applying the Windows procedure below.

What Windows error 665 means

On Windows, code 665 is the decimal form of hexadecimal 0x00000299. Microsoft names it ERROR_FILE_SYSTEM_LIMITATION and describes it as a requested operation that could not be completed because of a filesystem limitation. The error concerns the way a file is represented on the volume, not automatically a bad disk, malware or insufficient free space.

As an Amazon Associate I earn from qualifying purchases.

NTFS stores a file’s data in extents and keeps metadata describing those extents. Repeated growth, deletion and rewriting can leave a file heavily fragmented. A sufficiently fragmented file may need more metadata records than NTFS can maintain for that file. The file can then stop growing even when Explorer reports plenty of free capacity.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Compression makes the condition more likely because the compressed stream can be divided into many extents as it changes. Sparse files, which represent unused regions as holes rather than writing zeros, can also encounter the same type of layout limit. Microsoft has described an approximate 40–90 GB range for a very fragmented file, but that is an observed range from its guidance, not a universal maximum file size. The actual point depends on fragmentation, compression, sparse allocation, volume history and the application writing the file.

#1 Best Overall
Seagate 2TB Portable Hard Drive | USB 3.0 (STGX2000400) | Everyday HDD storage. Plug-and-play backup. Windows & macOS. Adobe CC trial included. 1-Year Warranty
  • Easily store and access 2TB to content on the go with the Seagate Portable Drive, a USB external hard drive
  • Designed to work with Windows or Mac computers, this external hard drive makes backup a snap just drag and drop
  • To get set up, connect the portable hard drive to a computer for automatic recognition no software required
  • This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable
  • The available storage capacity may vary.

First confirm that your code is the Windows code

Error numbers are reused. If the screen does not include the Windows wording or the operation is not running on a Windows filesystem, do not assume the NTFS explanation applies.

Where 665 appears Meaning reported by that vendor Correct next step
Windows file operation, backup, export or database write ERROR_FILE_SYSTEM_LIMITATION; the full text mentions a filesystem limitation Use the diagnostic and repair sequence in this article.
TI-Nspire calculator “Matrix not diagonalisable” Use the calculator’s mathematics and operating instructions, not NTFS remedies.
Vorwerk Thermomix TM7 An account or region authentication message Follow the appliance’s account, network and regional support procedure.
Another appliance, controller, backup product or application Vendor-specific; the number alone is insufficient Search that product’s manual using the exact message and model.

Write down the application name and version, the complete error text, the file path, the source and destination volumes, and what you were doing when the message appeared. A backup job, SQL database growth event and ordinary copy can all display 665 but require different handling.

Prepare before changing the file or volume

  • Protect the data. Make a current, verified backup or a second copy of irreplaceable data before moving, rewriting, compressing or defragmenting anything. If the failing file is a database, use the database engine’s supported backup method rather than copying an active data file as if it were an ordinary document.
  • Record the original path. Note the drive letter or mount point, volume label, filesystem, file size and whether the application was still open. This information helps a vendor distinguish a file-layout problem from an application defect.
  • Check the volume filesystem. In File Explorer, right-click the drive, choose Properties and read File system. Windows commonly shows NTFS; a server may use ReFS or another format. Do the same for the destination if the operation crosses volumes.
  • Check available space on both volumes. Free space does not eliminate a metadata limit, but an attempted copy or rewrite can fail for ordinary capacity reasons as well. Ensure enough room for a complete temporary copy if you plan to create one.
  • Capture logs. Preserve the application’s log and the relevant Windows Event Viewer entries around the failure. Do not clear logs before an escalation.

Inspect compression, sparse allocation and fragmentation

Check whether the file is compressed

Right-click the file, choose Properties, select Advanced on the General tab and look for Compress contents to save disk space. You can query NTFS compression from a Command Prompt with:

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
compact /q "C:pathtofile.ext"

Run the command against the exact file that failed. Do not uncompress a valuable file without a backup and sufficient free space: creating an uncompressed replacement can temporarily require room for both versions. If an application supports writing an uncompressed export or backup, that is usually safer than changing a live database file in place.

Check for sparse allocation

A sparse file can contain unallocated holes. From an elevated Command Prompt, query its sparse flag with:

fsutil sparse queryflag "C:pathtofile.ext"

The command is diagnostic; it does not convert the file or repair it. Let the application that created the file handle any conversion. Converting a sparse or compressed database, virtual disk or backup image by an unsupported method can make it unusable.

Rank #2
Seagate Portable 5TB External Hard Drive HDD – USB 3.0 for PC, Mac, PS4, & Xbox - 1-Year Rescue Service (STGX5000400), Black
  • Easily store and access 5TB of content on the go with the Seagate portable drive, a USB external hard Drive
  • Designed to work with Windows or Mac computers, this external hard drive makes backup a snap just drag and drop
  • To get set up, connect the portable hard drive to a computer for automatic recognition software required
  • This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable
  • The available storage capacity may vary.

Assess fragmentation

Open Start, search for Defragment and Optimize Drives, select the affected volume and choose Analyze. Windows will report whether the volume needs optimization. For a file-level view, Microsoft’s Contig utility can be run with the -a option to analyze fragmentation:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Contig.exe -a "C:pathtofile.ext"

Use the result as evidence, not as a reason to run a destructive command immediately. A fragmented file on a nearly empty volume can still hit the metadata limit, while a busy database volume may need service-aware maintenance rather than a generic optimization pass.

Fix an ordinary copy, export or file-growth failure

1. Retry with smaller files or chunks

Chunking is the least disruptive first remedy because each output file needs its own, smaller extent map. If an export tool supports date, ID or size ranges, produce multiple files instead of one continuously growing file. Keep a manifest of the ranges and verify every part before deleting the source or assembling the result.

For a backup application, use its built-in split, segmented or striped-output option. Choose a destination with adequate space and do not place every stripe on the same physical disk if the software’s documentation warns that this creates a single point of failure. Test a restore from the resulting set; a collection of files is useful only if the application can reconstruct it.

2. Copy the file to a healthier volume

When another NTFS volume is available, copy the affected file while it is closed, then repeat the operation against the copy. A new placement on a less-fragmented volume can give the file a simpler extent layout. Confirm the copy with the application’s integrity check, checksum or restore test before switching production paths.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

If the source is an active database, virtual machine disk or mail store, do not use a normal Explorer copy as a substitute for a consistent backup. Stop or quiesce the owning service according to its documentation, or use its export and backup mechanism.

Rank #3
Seagate Portable 1TB External Hard Drive HDD – USB 3.0 for PC, Mac, PlayStation, & Xbox, 1-Year Rescue Service (STGX1000400) , Black
  • Easily store and access 1TB to content on the go with the Seagate Portable Drive, a USB external hard drive.Specific uses: Personal
  • Designed to work with Windows or Mac computers, this external hard drive makes backup a snap just drag and drop. Reformatting may be required for Mac
  • To get set up, connect the portable hard drive to a computer for automatic recognition no software required
  • This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable
  • The available storage capacity may vary.

3. Rewrite rather than repeatedly extending one file

Applications that append indefinitely to one compressed, sparse or heavily fragmented file are more exposed to the limit. Configure a rolling set of files, periodic archival or a fresh destination file when the application supports it. This changes the growth pattern instead of forcing one file to acquire more extents.

4. Recheck the operation after each change

Do not make several destructive changes at once. After chunking or moving the file, rerun the exact export, copy or backup that failed and record whether the error disappears. If the new file succeeds, retain the original until you have validated the output and completed a backup.

Fix SQL Server, BCP and database backup cases

SQL Server can report 665 while DBCC works with database files or while a database file is being written. Microsoft documents cases in which it appears with error 1450 and latch timeouts. These symptoms require database-aware maintenance; repeatedly retrying the same growth operation can increase fragmentation and extend downtime.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Split BCP output with a predicate

For a bulk-copy export, Microsoft SQL Server support recommends using queryout with a WHERE clause to take data in reasonable file sizes. A generic pattern is:

bcp "SELECT columns FROM dbo.Table WHERE KeyColumn >= 1 AND KeyColumn < 100000" queryout part-01.dat -S server -T -c

Adapt the server, authentication, column list and ranges to your environment. Use non-overlapping predicates that cover every row, and record the range in each filename or manifest. Choose a stable key or date boundary; a moving predicate on a table receiving writes can omit or duplicate rows unless the export is coordinated with a transaction or maintenance window.

Review database file growth and filegroups

Inspect the data-file layout, growth increments and filegroups with the database team. A single file that grows in many small increments is more likely to become fragmented than files pre-sized for the expected workload. Repeatedly forcing one file to expand is not a substitute for planning capacity and distributing objects appropriately.

Rank #4
Seagate Portable 4TB External Hard Drive HDD – USB 3.0, 1-Year Rescue | Everyday HDD storage. Plug-and-play backup. Windows & macOS. Adobe CC trial included. 1-Year Warranty
  • Easily store and access 4TB of content on the go with the Seagate Portable Drive, a USB external hard drive.Specific uses: Personal
  • Designed to work with Windows or Mac computers, this external hard drive makes backup a snap just drag and drop
  • To get set up, connect the portable hard drive to a computer for automatic recognition no software required
  • This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable
  • The available storage capacity may vary.

For a database backup or restore, use the product’s supported backup, restore and stripe settings. Compression can reduce the amount of data written and may reduce file pressure, but test CPU, throughput and restore time in your environment. If you stripe a backup, avoid putting all stripes on the same physical media when that defeats the purpose of striping.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Defragment database files only with service-aware maintenance

Microsoft’s SQL Server guidance recommends defragmenting the volume where appropriate and stopping SQL Server before defragmenting database files. Coordinate a maintenance window, stop the correct SQL Server instance through SQL Server Configuration Manager or the approved service procedure, perform the supported volume optimization, then restart and verify the instance and databases. Never defragment an active database file simply because Windows reports 665.

After maintenance, check database consistency with the normal DBCC process for your organization and test a backup and restore. If the error returns, collect the SQL Server error log, Windows storage events, file sizes, growth history and the exact statement or backup command for escalation.

When volume optimization helps—and when it does not

For a normal NTFS data volume, Windows Defragment and Optimize Drives can consolidate fragmented allocation. Schedule it when the volume is lightly used, keep a verified backup, and allow the operation to finish. The objective is to improve file placement; it is not to create free space or guarantee that every file will become contiguous.

Do not confuse a filesystem limitation with a failing disk. If Event Viewer also shows I/O errors, bad blocks, controller resets or repeated read failures, stop stressing the volume and follow your storage-replacement and backup plan. Defragmentation cannot repair physical media.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

On a server hosting SQL Server or another stateful service, use the service’s maintenance guidance. A volume-level operation that is acceptable for an ordinary document can cause corruption or downtime when performed on an open database file.

Best Value
UnionSine 500GB Ultra Slim Portable External Hard Drive HDD-USB 3.0 | for PC, Mac, Laptop, PS4, Xbox one, Xbox 360-(Black)
  • [Upgraded Version] - This external hard drive features a mirrored logo stripe combined with a striped anti-slip design, and the rounded corners of the casing make it easier to grip. The stripes also have a heat dissipation function, ensuring stable and fast data transfer.
  • 【Ultra-thin and quiet】 - The motherboard adopts JMicron 578 noise-free solution, giving you a quiet working environment. Lightweight and portable size designed to fit in your pocket for easy portability.
  • 【Ultra-Fast Data Transfers】 - Pairing this external hard drive with JMicron 578 solution USB 3.0 and USB 2.0 interfaces enables blazing-fast data transfer. It boasts theoretical read speeds of up to 125MB/s and write speeds of up to 103MB/s.
  • 【Plug and Play】 - With no software to install, just plug it in and the drive is ready to use.The hard disk chip is wrapped with an aluminum anti-interference layer to increase heat dissipation and protect data.
  • 【What You Get】 - 1 x Portable Hard Drive, 1 x USB 3.0 Cable, 1 x User Manual, Gift-type shell packaging ,Three-year manufacturer's warranty and free technical support services.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Should you move from NTFS to ReFS?

Microsoft notes that ReFS does not have the same NTFS attribute-list limits in the SQL Server scenario discussed in its guidance. That does not make ReFS a quick repair or prove that changing filesystems will solve every 665 report. Filesystem conversion changes how the volume is managed and can affect boot support, applications, backup tools, permissions, deduplication, quotas and recovery procedures.

Treat ReFS as an architectural decision for an administrator:

  1. Confirm that the Windows edition, server role, application and backup products support ReFS for the intended workload.
  2. Build a new, correctly formatted destination volume rather than experimenting on the only copy of the data.
  3. Take and verify a full backup, document permissions and application settings, and plan downtime or a controlled migration.
  4. Copy or restore the data, validate the application and complete a test backup and restore before retiring the NTFS volume.

Do not format, delete partitions or attempt an unplanned conversion solely because code 665 appeared. A migration is reversible only when the original data and a verified backup remain available.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Decision guide: choose the least disruptive remedy first

Situation First choice Downtime Risk and qualification
Ordinary copy or export to NTFS Split the output, then retry on a less-fragmented destination Usually none beyond the retry Low and reversible; verify every chunk and keep the source.
Compressed or sparse file Use an application-supported uncompressed or freshly created output Depends on whether the file can be closed Do not change a live database, virtual disk or image in place.
SQL Server BCP queryout with non-overlapping WHERE ranges Usually low, subject to consistency requirements Record ranges and validate row counts or checksums.
SQL Server database-file growth Review growth increments, filegroups and fragmentation; schedule service-aware maintenance Planned maintenance may be required Stop SQL Server before defragmenting database files as Microsoft advises.
Backup or restore with stripes Use supported smaller or compressed sets and separate physical media where practical Depends on backup size Test a complete restore; stripes on one disk do not provide media separation.
Persistent failures on NTFS Move to a healthy volume and escalate with logs; evaluate ReFS only as a planned migration Migration may require downtime Filesystem changes are disruptive and require verified backups.

What not to do

  • Do not assume that 665 means the disk is full, infected or physically dead without checking the full message and storage events.
  • Do not delete the file, format the volume or rebuild a database merely because the number appeared.
  • Do not run an unverified “repair” utility against a database, virtual disk or backup image.
  • Do not uncompress, de-sparsify or move an active application file without following that application’s consistency procedure.
  • Do not keep retrying one huge append operation when the application can produce bounded chunks.
  • Do not treat the 40–90 GB range as a guaranteed threshold; a smaller or larger file can fail depending on its layout.

When to escalate

Contact the application or storage vendor when chunking, a verified move to a healthy volume and appropriate maintenance do not resolve the failure. Provide the exact product and version, Windows edition, filesystem, file size, compression and sparse status, fragmentation findings, source and destination paths, operation being attempted, complete error text, and relevant application and Windows logs. For SQL Server, include the instance name, database file layout, growth settings, BCP or backup command, SQL error log and whether error 1450 or latch timeouts appeared.

Escalation is also appropriate when the file cannot be copied for backup, the volume reports I/O errors, a restore test fails, or the affected data is the only remaining copy. Preserve the original state while support investigates instead of experimenting with destructive filesystem changes.

Quick Recap

Bestseller No. 1
Seagate 2TB Portable Hard Drive | USB 3.0 (STGX2000400) | Everyday HDD storage. Plug-and-play backup. Windows & macOS. Adobe CC trial included. 1-Year Warranty
Seagate 2TB Portable Hard Drive | USB 3.0 (STGX2000400) | Everyday HDD storage. Plug-and-play backup. Windows & macOS. Adobe CC trial included. 1-Year Warranty
This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable; The available storage capacity may vary.
$129.99
Bestseller No. 2
Seagate Portable 5TB External Hard Drive HDD – USB 3.0 for PC, Mac, PS4, & Xbox - 1-Year Rescue Service (STGX5000400), Black
Seagate Portable 5TB External Hard Drive HDD – USB 3.0 for PC, Mac, PS4, & Xbox - 1-Year Rescue Service (STGX5000400), Black
This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable; The available storage capacity may vary.
$219.99
Bestseller No. 3
Seagate Portable 1TB External Hard Drive HDD – USB 3.0 for PC, Mac, PlayStation, & Xbox, 1-Year Rescue Service (STGX1000400) , Black
Seagate Portable 1TB External Hard Drive HDD – USB 3.0 for PC, Mac, PlayStation, & Xbox, 1-Year Rescue Service (STGX1000400) , Black
This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable; The available storage capacity may vary.
$119.80
Bestseller No. 4
Seagate Portable 4TB External Hard Drive HDD – USB 3.0, 1-Year Rescue | Everyday HDD storage. Plug-and-play backup. Windows & macOS. Adobe CC trial included. 1-Year Warranty
Seagate Portable 4TB External Hard Drive HDD – USB 3.0, 1-Year Rescue | Everyday HDD storage. Plug-and-play backup. Windows & macOS. Adobe CC trial included. 1-Year Warranty
This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable; The available storage capacity may vary.
$189.99

As an optional shortcut after these manual steps, Outbyte PC Repair can address more than 100 common Windows issues, including broken system elements and invalid redirects, and can check settings, temporary files and caches that may contribute to broader system problems. It runs on Windows 11, 10, 8 and 7, offers a category-based free trial of at least two days and then requires a subscription. Results vary; it complements antivirus software and does not replace it, and no tool repairs every crash.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

error code 665File systemNTFSSQL ServerWindows errors

Leave a Reply

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

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.