Monday, January 27, 2020

Windows 10 Disk Is Full but Windows Explorer Cannot Account for the Missing Space

Recently my laptop was running out of disk space. This laptop has an SSD of 512 GB size. Windows explorer showed that it had 0 byte left. But when I right clicked on the C drive and opened its "Properties" dialog box, The total used disk space was much less:


This was very strange. If I removed some files to make room, the free space would be gone automatically little by little, as time goes by.

Thanks to a free software called "WizTree" (https://antibody-software.com/web/software/software/wiztree-finds-the-files-and-folders-using-the-most-disk-space-on-your-hard-drive/), the culprit was identified very quickly: it was the Microsoft SQL Server Developer Edition. When the SQL Server is installed with "PolyBase Query Service for External Data", and when the TCP/IP protocol is not enabled for the SQL server, it will write more and more contents into its dump files  in the folder "C:\Program Files\Microsoft SQL Server\MSSQL15.MSSQLSERVER\MSSQL\Log\PolyBase\dump"(https://nielsberglund.com/2019/11/20/fix-polybase-in-sql-server-2019-developers-edition/).

However, when I clicked on the folder "C:\Program Files\Microsoft SQL Server\MSSQL15.MSSQLSERVER\MSSQL\Log" in Windows Explorer, or when I tried to open this folder by simply pasting it into the address box of an Explorer window, I got no response at all, as if I did nothing.

It turns out that the Microsoft SQL Server installer does not specify an owner for this folder. Apparently that was why its size was not included in the total size of all the files on my C drive!

Because the folder "C:\Program Files\Microsoft SQL Server\MSSQL15.MSSQLSERVER\MSSQL" is owned by "SYSTEM", I changed the owner of "C:\Program Files\Microsoft SQL Server\MSSQL15.MSSQLSERVER\MSSQL\Log" to SYSTEM as well. Once I did that, I was able to get into "C:\Program Files\Microsoft SQL Server\MSSQL15.MSSQLSERVER\MSSQL\Log" just like a normal folder.

I enabled the TCP/IP protocol on the SQL Server, restarted the PC, and then I removed all of the dump files and log files in the folder "C:\Program Files\Microsoft SQL Server\MSSQL15.MSSQLSERVER\MSSQL\Log\PolyBase\dump". Now the free space on my C drive is no longer disappearing on me anymore.