9

I ran robocopy on my system (with all apps I could close, closed) and tried to rip the entirety of my C drive to a different drive.

Im not sure why but, there was a systemlink in the C drive called "Documents and Settings" and it used said link to create over a terabyte of junk data while I was asleep. Thankfully I stopped it and wiped the drive, but it still kinda sucked.. I was hoping to have it finished so I could go and reset the system this morning, now Im left with no viable backup and the possibility of having more issues in the future.

I would like to back all of the drive up without creating a similar situation again... is there a parameter in robocopy that would allow this?

Specifically, I want to copy the ENTIRE DRIVE. All of its structure and files, ignore empty folders, and only copy the files of links / shortcuts / junctions / whatnot, not the contents of where they point to... Thats what caused this whole mess.

The command I used: robocopy C:\ D:\backup /S /COPYALL /DCOPY:DAT /R:1 /W:1 /B

enter image description here

3
  • 4
    You do know that a copy of the drive created with robocopy is not bootable, right?
    – JRE
    Commented Jul 25, 2023 at 13:52
  • @JRE Im aware. I never said I wanted to boot it. The whole reason of doing this is to get rid of my current system, as windows is really starting to die (Years of modifying windows and installing shit on it, it really doesnt run well anymore). Its only a reference copy anyhow, Im doing the entire drive because I have tools and files dispersed all over the system and I want to be sure I dont miss anything. Ive got terabytes upon terabytes of free space so its not an issue. Commented Jul 30, 2023 at 14:43
  • But while that's not your goal, why not reap the benefits of both? Just make a disk image and your have all your files as well as a potential to boot it Commented Jul 30, 2023 at 18:26

2 Answers 2

14

Append /sj and /sl option in the command to copy junctions and symlinks as is (Administrative privilege is needed to create symlinks). Documentation available here.

@YisroelTech the option /xjd excludes junction points, which does not meet OP's needs. Besides, excess options should also be added in case of symbolic links (although Windows does not automatically create them).

4
  • 2
    Besides, according to OP's description, I believe you may also need to copy NTFS ACL and the ownership information, or (preferably) to create an image of the whole volume. Commented Jul 24, 2023 at 15:32
  • 1
    I basically only need the file contents. Ownership doesnt matter too much. Im only backing it up as a reference point, so I can find all my shortcuts, installed apps, game data, software data, etc... I have a lot of intertwined data between many drives and I dont entirely know what I would break by wiping it, hence the full system copy. Commented Jul 24, 2023 at 16:17
  • 1
    Wouldn't a partition copy just be less of a hassle? The fact that you don't know means you have no idea what corner cases to setup for, so if it isn't this infinite loop, you'll end up losing "something", but you would have no idea what, and you wouldn't know until you try to use it.
    – Nelson
    Commented Jul 25, 2023 at 1:45
  • @Nelson wdym "corner cases"? This does everything I need quickly and easily. I only need the files and quick access to them. Sure theres alternative ways to do it but this is totally acceptable and does what I need without any issues. Commented Jul 30, 2023 at 14:45
3

For what it's worth, for what you are probably trying to do, DISM might actually be the better option. You can capture an image of just your C:\ drive into a WIM file, this is done like this:

dism /Capture-Image /CaptureDir:C:\ /ImageFile:"D:\backup\YourFileNameHere.wim" /Name:CBackup2023OrWhatever

This will take the entire partition that holds C:\ and create a WIM file - this can then be natively mounted by Windows and explored like any other mounted filesystem. As far as I understand, it handles symlinks well and may even preserve them properly. Consider reading the link at the end for more inormations regarding WIM files and symlinks.

Alternatively, you can image the physical drive, including partition tables, recovery partitions, anything - but that will of course require there to be a second physical drive to save the file to. This is called an FFU ("Full Flash Utility", not really relevant here) image.

An FFU is captured like this:

dism /Capture-FFU /ImageFile:"D:\backup\YourFileNameHere.ffu" /CaptureDrive:\\.\PhysicalDriveX /Name:CBackup2023OrWhatever

You will need to replace the X after PhysicalDrive with the physical drive number of the drive you will be imaging - it is often 0 but do not assume and check it using diskpart:

C:\>diskpart
Microsoft DiskPart version 10.0.19041.964

Copyright (C) Microsoft Corporation.
On computer: COMPUTERNAME

DISKPART>list vol
  Volume ###  Ltr  Label        Fs     Type        Size     Status     Info
  ----------  ---  -----------  -----  ----------  -------  ---------  --------
  Volume 0     C   SYSTEM       NTFS   Partition    476 GB  Healthy    Boot
  Volume 1                      FAT32  Partition    100 MB  Healthy    System
  Volume 2                      NTFS   Partition    477 MB  Healthy    Hidden

DISKPART>sel vol 0

Volume 0 is the selected volume.
DISKPART> detail vol

  Disk ###  Status         Size     Free     Dyn  Gpt
  --------  -------------  -------  -------  ---  ---
* Disk 0    Online          476 GB  1024 KB        *

Read-only              : No
Hidden                 : No
No Default Drive Letter: No
Shadow Copy            : No
Offline                : No
BitLocker Encrypted    : Yes
Installable            : Yes

Volume Capacity        :  476 GB
Volume Free Space      :  274 GB

Short recap, start diskpart, get a list of all volumes (list volume; every keyword can be shortened down to at least 3 letters), note the number of the one that has your desired drive letter (like C), select it (select volume 0), then show the detailed information (detail volume - the 0 is not needed as volume 0 is already selected), which shows it living on Disk 0.

You can also go to Disk Management for a more graphical overview if that is preferred.

In my experience you will need to get into a recovery environment to be able to perform those images, however. Normally all it takes is to hold the Shift key and then click through the usual steps to restart Windows - you will then have a few menus to click through, you will want the option that gives you the command line.

You can also boot into a Windows install USB stick and hit Shift+10.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .