I have a Windows 7 computer that won't boot in regular mode, so I'm booting in Safe Mode to make a backup.

This fails,

wbadmin start backup

does not work in Safe Mode (I have been unable to find out why, as of yet - enabling and running the VSS service didn't fix it).

The replacement harddrive is smaller than the failing one, so my next option is to shrink the volume before cloning it to the new drive. Guess what: shrinking also doesn't work.

The shrink commands I used were:

select volume 1 (my C: drive)
shrink desired=102400 (the number of MBs you're trying to REMOVE from your partition)

I get the error:

DiskPart has encountered an error: This service cannot be started in Safe Mode
See the System Event Log for more information.

See my answer for the solution.


So I went to the Event Log. It turns out that DiskPart is trying to start defragsvc. You can't just start defragsvc in safe mode, so you have to enable it with regedit first.

  • Start Regedit
  • Go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SafeBoot
  • Open Minimal or Network, whichever type of safe boot you want to use
  • Right-click on Minimal or Network, and click New > Key
  • Type the name of the service: defragsvc
  • Click on defragsvc
  • Double click on the name (Default) on the right
  • Type "Service" without the quotes, and click OK

Now you can shrink your volume using diskpart as documented in my question.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.