Tough Command Line Backup using Robocopy or Xcopy


  1. Posts : 18
    windows 10x64 home
       #1

    Tough Command Line Backup using Robocopy or Xcopy


    I must backup my BSOD'd PC from the command line before re-installing Windows 10, but Robocopy is glacially slow and Xcopy emits"Insufficient Memory" (due to long pathnames). I am now running Windows 10 from a USB 3.0 drive downloaded from MSft which brought me to [Install Now] or [Repair Your Computer]. Though MS states that [Install Now] would not destroy my personal files, I do not trust that. Hence I wish to first backup from [Repair Your Computer] at command line. I already tried the System Restore option to no avail. And other options like [Safe Mode with Command Prompt] just gets me back to the BSOD. So I am now at a Command Prompt X:>

    • Robocopy /e /zb /b /sl /xj /create from C:\users to Seagate D:\users runs at a glacial 80MB/hr and would take thousands of hours to back up anything sizable.
    • Xcopy /e /c /h /y /b /s /r runs at a tolerable 25GB/hr (20hrs for my entire C: drive). However it stops with "Insufficient Memory" which definitely is a pathname > 256 chars problem, and I have many of them--for example, in .eml filenames of which I have about 100,000. Note that the /c option already requests "continue on error" but apparently not that error. There is a LongPathNames=0 setting in the registry which I can set to 1, but the doc says I need to reboot and this does not appear to get saved on the USB drive.
    • Even though I cannot boot from my C:drive, I can run many executables from them. Can I run standard MS backup from the command line and make a disk image? I do not need a backup to restore from, just want to keep all my data in case Windows 10 re-install destroys too much. I found that System32/sdclt.exe does not run alone. The Seagate backup utilities on D: are not compatible with Windows 10.

    This post is mainly to ask if anyone knows why Robocopy is so slow or how I could get around the LongPathNames in Xcopy. I have spent many many hours trying to restore.
    Last edited by cabujones; 13 Feb 2018 at 01:48. Reason: ypo
      My Computer


  2. Posts : 5,478
    2004
       #2

    Why not use Windows 10 Recovery Tools - Bootable Rescue Disk - Windows 10 Forums ?

    It is a bootable PE image that contains Macrium, AOMEI and Acronis so you could make an image with whichever you prefer. That would be the fastest way to backup.

    As for robocopy I'm not sure why it is slow - it is faster than xcopy for me. You could try with the /mt switch (multi threading) and reduce the wait and retry

    Something like
    Code:
    robocopy <whatever> /b /e /r:0 /w:0 /copyall /mt /log:<wherever>.log
      My Computer


  3. Posts : 18
    windows 10x64 home
    Thread Starter
       #3

    @Ix07: Thank you kindly for your prompt reply. I was using a win10 recovery .iso downloaded from MSFT, but it does not have a lot of tools. But now I don't know how to create a bootable USB drive with Winpese on it (MSFT webpage created the one I am using). What I tried: I downloaded the Winpese-x64-.iso to a win7 laptop, formatted a USB flash drive there as a 32GB fat32 (using Diskpart) and copied the downloaded .iso to it. But when I put that USB into my win10 and selected the Boot Manager, it does not find the new .iso. It finds my windows hard drive, and my windows recovery iso as bootable, but does not see the Winpese as a bootable drive.
    - How do I put the Winpese.iso on a USB drive and make it bootable?
      My Computer


  4. Posts : 5,478
    2004
       #4

    1. Insert the USB flash drive.
    2. Open a Command Prompt and enter: diskpart (if it isn't an administrator command prompt, it will ask for administrator permission).
    3. list disk
    4. select disk # <- replace # with the actual disk number of the USB flash drive
    5. clean <- this will erase the disk selected above, make sure it is the USB flash drive!
    6. create partition primary
    7. format fs=fat32 quick
    8. active
    9. exit <enter> exit <enter> - and if the first command prompt was not an administrator command prompt, exit that one too.

    Mount ISO. In Windows 10 it is easy - you just double click. If you are using Windows 7 it is more convoluted - you can see this tutorial: ISO - Disk Image File : Extract to the Desktop - Windows 7 Help Forums

    Copy contents of ISO (not the ISO file) to the USB key. It should look like this (except for the "Other" directory which is something I added - you don't need that)...


    Tough Command Line Backup using Robocopy or Xcopy-capture.png

    Disable secureboot in your UEFI (if it is turned on) then it should boot.
      My Computer


  5. Posts : 18
    windows 10x64 home
    Thread Starter
       #5

    @Ix07--Thank you--thank you. I now have a bootable USB drive with the winpese-x64.iso provided at
    Windows 10 Recovery Tools - Bootable Rescue Disk - Windows 10 Help Forums
    I had to make it on a Win7 and employ it on a win10. At first I tried just copying the winpese-x64.iso to my usb drive (being a dummy) but it would not boot correctly on the win10. You said this would have to be specially created if done on a win7. Thankfully I was able to take the shortcut described by NavyLCDR at the bottom of that winpese website:
    take a standard Windows 10 install USB flash drive, copy the boot.wim file from \sources from Kyhi's recovery drive to the \sources on the Windows 10 install USB flash drive (overwrite the old file). Now your Windows 10 install USB flash drive will boot into Kyhi's recovery drive giving you all those utilities.
    I did have a standard windows 10 install disk which was wholly created for me by Microsoft at How to Download Official Windows 10 ISO files Using Media Creation - Microsoft Community .
    But it did not have the backup (and many other) utilities that the winpese has. So I copied the sources/boot.wim from the unzipped winpese to the MSFT install disk per NavyLCDR. This booted up into the grand winpese recovery environment.
    • Now I haven't rescued my Win10 yet, but since this complaint was only about command-line backups not working, I declare it solved.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 14:22.
Find Us




Windows 10 Forums