Robocopy: destination folder size is bigger than source folder size

3

I've backed up my windows profile folder to external hard drive with the following command in batch file:

robocopy %userprofile% %~dp0src\dest /b /mir /mt /r:1 /w:5 >nul

After the copy was completed the destination folder ended up being bigger in size (by a couple of Gb) and containing more files than the source folder.

What may be the cause of it?

qwaz

Posted 2017-05-15T18:53:39.813

Reputation: 163

Different allocation unit sizes between source and destination volumes. How are you determining the sizes of the two folders? – I say Reinstate Monica – 2017-05-15T19:07:39.387

@Twisty also more files – Daniel F – 2017-05-15T19:08:03.010

@DanielF LOL. If that's true, silly me for assuming the OP took that into account before asking this question!! – I say Reinstate Monica – 2017-05-15T19:08:54.000

@Twisty by windows "properties" on the folder – qwaz – 2017-05-15T19:13:17.473

2

Without /sl it copies the target instead of the symbolic link. Maybe the windows properties are not taking that into account and you do have a symlink somewhere. http://stackoverflow.com/questions/2483010/how-to-list-all-symbolic-links-on-an-ntfs-filesystem

– Daniel F – 2017-05-15T19:19:01.370

In the Properties dialog, are you comparing Size or Size on disk? – I say Reinstate Monica – 2017-05-15T19:47:37.320

1Size. I open dialog on both source and destination folders and compare sizes. – qwaz – 2017-05-15T20:07:30.703

@TwistyImpersonator @qwaz.... Use the fsutil fsinfo ntfsinfo c: elevated command prompt and compare the applicable sizes, etc. If you must, reformat the destination partition, etc. to use the same bytes per sector and cluster— I agree with Twist <Scream and Shout>☺☺☺☺☺☺ – Pimp Juice IT – 2017-12-10T07:00:02.437

some of the source files could also be using ntfs compression, whereas the destination will not auto compress things – BeowulfNode42 – 2017-12-10T07:32:26.780

Answers

0

I'm not sure how you were able to run a RoboCopy commandline without including the /XJ flag because it gets stuck on the dreaded "Application Data\Application Data" junction resulting in an infinate loop, causing RoboCopy to try files that dont exist.

Your not supposed to use RoboCopy to copy userprofiles, although if you really know what your doing its a good solution.

You have a few options to copy whole userprofiles. The only downside to these solutions would be copying settings, which RoboCopy is copying thru its copying of hidden .dat files.

  1. User State Migration Tools (USMT) You would have to download this from Microsoft or find the standalone version someone created online. This is a tool thats not user friendly and is for system administrators.
  2. Windows EZ Transfer. Not on every edition of Windows. You can find it from Microsoft though. Its geared towards the general population.
  3. "User Profiles" dialog box. On all editions.
  4. RoboCopy is an option but I think is the worst of the four.

Find the "User Profiles" dialog box Microsoft has the "User Profiles" dialog box in Advaced System Properties dialog box. Control Panel -> System and Security -> System -> Advanced System Settings -> Under User Profiles section click Settings - > Select a profile -> Hit "Copy to"

As for the question I'm still curious but if I were to guess it probably has to do something with how Windows Explorer deals with the large number of directory junctions, not to mention, OneDrive, all of which are Hardlinks to files in your OneDrive account. Which if you use RoboCopy you will be copying your OneDrive files. Even if you use RoboCopy flag /XJ to include junction points.

  1. Managing User Profiles https://msdn.microsoft.com/en-us/library/bb726990.aspx

Noshad Chaudhry

Posted 2017-05-15T18:53:39.813

Reputation: 138

0

I know this is an old question but this may help as the problem crops up with other people.

Within the user profiles are commonly shortcuts to other libraries especially from users who have backed up accounts multiple times. In some instances there have been "Hidden" shortcuts embedded within the "My Documents" library for example.

When you initiate a copy it will iterate through all of the files AND shortcuts.

Have a look at the Menu bar-> Tools -> Folder Options -> View -> Show hidden files, folders and drives and make sure this radial option is checked.

Next check the source folders for library shortcuts and delete the shortcuts before you initiate the copy.

bdwhat

Posted 2017-05-15T18:53:39.813

Reputation: 1