Recently noticed my SCCM server data drive was running out of space. Didn’t make sense as we haven’t added anything substantial lately or used USMT.
Installed WinDirStat and found the culprit to be a 400GB .ldf log file from SCCM.
The fix was pretty painless and takes less than 10mins.
- Backup the database
- Stop the database service
- Shrink the .ldf file
Start by opening up SQL Server Management Studio and connect to the server.
Expand the Databases object.
Right-click the database and select Tasks > Backup.
- Set Backup type: Full
- Add a backup destination
- Click OK when done.
Now the backup is complete we need to shrink the file. Stop the SQL Server service, then right-click on the database and select Tasks > Shrink > Shrink Files.
- Change File type to Log
- Click OK
The log file should now be cleaned up!