Computer >> Computer tutorials >  >> Troubleshooting >> Windows Errors

How to Fix Component-Based Servicing (cbs.log) using Excessive Disk Space

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.

How to Fix Component-Based Servicing (cbs.log) using Excessive Disk Space

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).

How to Fix Component-Based Servicing (cbs.log) using Excessive Disk Space

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.

  1. Click Windows, type: Services, and right-click on it. Then select Run as Administrator.How to Fix Component-Based Servicing (cbs.log) using Excessive Disk Space
  2. Now right-click on the Windows Update service and in the menu shown, choose Stop.How to Fix Component-Based Servicing (cbs.log) using Excessive Disk Space
  3. 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).How to Fix Component-Based Servicing (cbs.log) using Excessive Disk Space
  4. Then right-click Windows and select the Task Manager.
  5. Now right-click on Windows Modules Installer (if present) and select End Task.
  6. Then head to the Details tab and right-click the TiWorker.exe.How to Fix Component-Based Servicing (cbs.log) using Excessive Disk Space
  7. Now select End Task and then end the task of the TrustedInstaller.exe in the Details tab.
  8. Then navigate to the following path (copy-paste the address):
    \Windows\Logs\CBS
    How to Fix Component-Based Servicing (cbs.log) using Excessive Disk Space
  9. Now delete all the files in the CBS folder and head to the following temp folder:
    \windows\temp\
    How to Fix Component-Based Servicing (cbs.log) using Excessive Disk Space
  10. 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.
  11. Now start the Windows Modules Installer and Windows Update service (steps 1 to 3).
  12. Then check the Windows temp folder (step 9) again and if it shows any of the files, delete those files as well.
  13. Now again empty the Recycle Bin and shut down the PC.
  14. Wait for one minute and then power on the system.
  15. 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:

  1. ClickWindows, type: Command Prompt, right-click on Command Prompt and choose Run as Administrator.How to Fix Component-Based Servicing (cbs.log) using Excessive Disk Space
  2. Now execute the following:
    net stop TrustedInstaller
    How to Fix Component-Based Servicing (cbs.log) using Excessive Disk Space
  3. 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"
    How to Fix Component-Based Servicing (cbs.log) using Excessive Disk Space
  4. 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.

  1. Firstly, shut down your PC and wait for one minute.
  2. Then power on the system and perform an SFC scan.How to Fix Component-Based Servicing (cbs.log) using Excessive Disk Space
  3. 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.

  1. Right-click Windows and open Settings.
  2. Now select Update & Security and in the right pane, open the Advanced Options.How to Fix Component-Based Servicing (cbs.log) using Excessive Disk Space
  3. Then expand the dropdown of Pause Updates and select a date.How to Fix Component-Based Servicing (cbs.log) using Excessive Disk Space
  4. 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.How to Fix Component-Based Servicing (cbs.log) using Excessive Disk Space
  5. Upon system’s boot, launch a web browser and open the Windows 10 download page of the Microsoft website.
  6. Now click on the Update Now button for the latest update (e.g., Windows 10 October 2020 Update) and let the download complete.How to Fix Component-Based Servicing (cbs.log) using Excessive Disk Space
  7. Then launch the downloaded file as administrator and follow the prompts to install the update.
  8. Once the installation is complete, reboot your PC and upon reboot, steer to the Microsoft Update Catalog.How to Fix Component-Based Servicing (cbs.log) using Excessive Disk Space
  9. 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).
  10. Then install the update as administrator by following the prompts to complete the installation.
  11. Now reboot your PC and delete the CBS.log (as discussed in solution 1).
  12. 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.

  1. Click Windows, type: Notepad, and then open it.
  2. Now copy-paste the following lines to the Notepad:
    net stop “TrustedInstaller”
    
    del /S c:\windows\logs\cbs\*.log
    
    net start “TrustedInstaller”
    How to Fix Component-Based Servicing (cbs.log) using Excessive Disk Space
  3. Then expand the File menu and choose Save.
  4. Now change the file type to All Files and name the file with a .bat extension (e.g., DeleteCBSLog.bat).How to Fix Component-Based Servicing (cbs.log) using Excessive Disk Space
  5. After that, in the Save as dialogue box, head to the directory where you want to save the file (e.g., Desktop).
  6. Now click on Save and close the Notepad.
  7. Now click Windows, type: Task Scheduler, and then open it.How to Fix Component-Based Servicing (cbs.log) using Excessive Disk Space
  8. Then expand the Action menu and choose Create Task.How to Fix Component-Based Servicing (cbs.log) using Excessive Disk Space
  9. Now enter the name of the task (e.g., DeleteCBSLogs) and checkmark Run with Highest Privileges.How to Fix Component-Based Servicing (cbs.log) using Excessive Disk Space
  10. Then head to the Triggers tab and click on the New button.How to Fix Component-Based Servicing (cbs.log) using Excessive Disk Space
  11. Now select Daily and click on the OK button.How to Fix Component-Based Servicing (cbs.log) using Excessive Disk Space
  12. Then head to the Actions tab and click on the New button.How to Fix Component-Based Servicing (cbs.log) using Excessive Disk Space
  13. Now click on Browse (in front of Program/Scrip) and head to the directory where the .bat file is located (e.g., Desktop).How to Fix Component-Based Servicing (cbs.log) using Excessive Disk Space
  14. Then double-click on the batch file (e.g., DeleteCBSLogs) and head to the Settings tab.How to Fix Component-Based Servicing (cbs.log) using Excessive Disk Space
  15. Now checkmark “If the Task Fails, Restart Every“, and set the dropdown to 1 Hour.
  16. Then uncheck the box of “Stop the Task if it Runs Longer Than”, and click on the OK button.How to Fix Component-Based Servicing (cbs.log) using Excessive Disk Space
  17. 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.

  1. Click Windows, type: Registry Editor, and right-click on it. Then select Run as Administrator.
  2. Now navigate to the following path:
    Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing
  3. Then double-click on EnableLog and set its value to 0 (you may have to take ownership of the registry key).How to Fix Component-Based Servicing (cbs.log) using Excessive Disk Space
  4. Now exit the editor and delete the current CBS logs as discussed in solution 1.
  5. 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.