Component-Based Servicing (cbs.log) may start consuming all the drive space if the system files are corrupt or if a Windows update is continuously failing to install. The issue arises when the user sees his system drive to be filled (or a large chunk of the drive is occupied) by the CBS logs. But after deleting the files, the logs again rapidly grow in the size.
Before moving on to reduce the size of your CBS log, make sure to reset the file association to the defaults (Settings > Apps > Default Apps > Reset to Microsoft Recommended Defaults).
Solution 1: Delete the CBS Log Files
The CBS log files are split into different files once a file reaches 50 MB and then compressed to save the disk space. But the issue arises when a CBS log file (due to a glitch) grows to 2 GB in the size (after which the Makecab cannot compress it) and the file size starts to grow rapidly. In this context, deleting the CBS files may solve the problem.
- Click Windows, type: Services, and right-click on it. Then select Run as Administrator.
- Now right-click on the Windows Update service and in the menu shown, choose Stop.
- Then repeat the same to stop the Windows Modules Installer service (if you cannot disable the Windows Modules Installer service, then try the method mentioned at the end of this solution).
- Then right-click Windows and select the Task Manager.
- Now right-click on Windows Modules Installer (if present) and select End Task.
- Then head to the Details tab and right-click the TiWorker.exe.
- Now select End Task and then end the task of the TrustedInstaller.exe in the Details tab.
- Then navigate to the following path (copy-paste the address):
- Now delete all the files in the CBS folder and head to the following temp folder:
- Then delete all the files in the Temp folder (you may have to take ownership of some files) and after that, make sure to empty the Recycle Bin.
- Now start the Windows Modules Installer and Windows Update service (steps 1 to 3).
- Then check the Windows temp folder (step 9) again and if it shows any of the files, delete those files as well.
- Now again empty the Recycle Bin and shut down the PC.
- Wait for one minute and then power on the system.
- Upon system’s boot, check if the CBS.log issue is resolved.
If you cannot stop the Windows Modules Installer, then try the method below:
- ClickWindows, type: Command Prompt, right-click on Command Prompt and choose Run as Administrator.
- Now execute the following:
net stop TrustedInstaller
- If it is successful, then try steps 4-15 to delete the CBS.log, and if the above-command fails, then execute the following one by one:
sc qc TrustedInstaller tasklist | find /i "TrustedInstaller.exe" taskkill /f /im "TrustedInstaller.exe"
- Then try steps 4-15 to delete the CBS.log files and check if that resolves the drive space issue.
Solution 2: Perform an SFC Scan
The CBS.log issue may arise if the essential system files are corrupt. In this context, performing an SFC scan may clear the files’ corruption and thus solve the problem.
- Firstly, shut down your PC and wait for one minute.
- Then power on the system and perform an SFC scan.
- Once the scan is complete, check if the CBS.log is back to the normal size. If not, then delete the CBS.log (as discussed in solution 1) and check if that resolves the Component-Bases Servicing issue.
Solution 3: Manually Perform the Offline Update
The CBS.log may have consumed a large chunk of the drive space if an update is continuously failing to install and repeated retrying may cause the rapid growth of the CBS file. In this case, manually installing the offline update may clear the glitch and thus solve the problem.
- Right-click Windows and open Settings.
- Now select Update & Security and in the right pane, open the Advanced Options.
- Then expand the dropdown of Pause Updates and select a date.
- Now make sure to completely close all the applications (so no application is writing to the system’s storage drive) and press the power button till the system is powered off (do not shut down or restart). Then power on the system.
- Upon system’s boot, launch a web browser and open the Windows 10 download page of the Microsoft website.
- Now click on the Update Now button for the latest update (e.g., Windows 10 October 2020 Update) and let the download complete.
- Then launch the downloaded file as administrator and follow the prompts to install the update.
- Once the installation is complete, reboot your PC and upon reboot, steer to the Microsoft Update Catalog.
- Now download the latest KB updates for your system (you may search the internet to find the KB number of the latest updates for your system).
- Then install the update as administrator by following the prompts to complete the installation.
- Now reboot your PC and delete the CBS.log (as discussed in solution 1).
- Then disable the pause updates option (by repeating steps 1 to 3) and check if the CBS drive issue is resolved.
Solution 4: Use the Task Scheduler to Delete the CBS Log Files
If the above solutions did not do the trick for you, then you may create a repeated task in the Task Scheduler to delete the CBS log files, which will stop the consumption of the drive space by the CBS logs and thus solve the problem.
- Click Windows, type: Notepad, and then open it.
- Now copy-paste the following lines to the Notepad:
net stop “TrustedInstaller” del /S c:\windows\logs\cbs\*.log net start “TrustedInstaller”
- Then expand the File menu and choose Save.
- Now change the file type to All Files and name the file with a .bat extension (e.g., DeleteCBSLog.bat).
- After that, in the Save as dialogue box, head to the directory where you want to save the file (e.g., Desktop).
- Now click on Save and close the Notepad.
- Now click Windows, type: Task Scheduler, and then open it.
- Then expand the Action menu and choose Create Task.
- Now enter the name of the task (e.g., DeleteCBSLogs) and checkmark Run with Highest Privileges.
- Then head to the Triggers tab and click on the New button.
- Now select Daily and click on the OK button.
- Then head to the Actions tab and click on the New button.
- Now click on Browse (in front of Program/Scrip) and head to the directory where the .bat file is located (e.g., Desktop).
- Then double-click on the batch file (e.g., DeleteCBSLogs) and head to the Settings tab.
- Now checkmark “If the Task Fails, Restart Every“, and set the dropdown to 1 Hour.
- Then uncheck the box of “Stop the Task if it Runs Longer Than”, and click on the OK button.
- Now delete the CBS Logs (as discussed in solution 1) and reboot your device to check if the CBS.log issue is resolved.
Solution 5: Edit the System’s Registry to Stop the Creation of CBS Log Files
If none of the solutions did the trick for you, then editing the system’s registry to disable the CBS log may solve the problem (keep in mind to enable the setting once the issue is reported to be solved).
Warning: Advance with extreme care and at your own risk as editing the system’s registry is a skillful job and if not done properly, you may cause everlasting damage to your PC/data.
- Click Windows, type: Registry Editor, and right-click on it. Then select Run as Administrator.
- Now navigate to the following path:
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing
- Then double-click on EnableLog and set its value to 0 (you may have to take ownership of the registry key).
- Now exit the editor and delete the current CBS logs as discussed in solution 1.
- Then reboot your PC and check if the CBS.log issue is resolved.
If the issue persists, then you may try a 3rd party cleaning utility to check if that clears out the CBS.log issue.