Share via


Robocopy Switch /DCOPY:DA

Question

Friday, May 24, 2013 4:40 AM

Hi Experts

Recently I have been doing a lot of work in Robocopy on a Windows Server 2008 R2 box.  We are migrating Terabytes of data and I am looking at ways of increasing performance. 

Recently I saw this article http://support.microsoft.com/kb/2646535?wa=wsignin1.0

My main concern in moving this data is to make sure that all data is preserved.  That I have a 1 to 1 copy.  With the hotfix applied I can choose /DCOPY:A which copies across Directory Attributes.  But does not copy across Directory Data.

My question is what is Directory Data?  Do I need it?  How can I check I have Directory Data?

Currently we are running Robocopy in a way that makes just the directories with /DCOPY:DA (retaining the directory data) and then later populating the folders using a robocopy using /DCOPY:A.

Thanks in advance

All replies (8)

Friday, May 24, 2013 2:06 PM

Hi.

As i read KB2646535, I believe they are talking about Alternate Data Streams

A directory does not have a default data stream; however, it can have named alternate data streams.

To find if you have any use any of the suggestions below, from MSDN: NTFS Streams:

These alternate data streams are not normally visible but can be observed from a command line using the /R option of the DIR command

Or use Streams from Micosoft Sysinternals

Oscar Virot


Monday, May 27, 2013 8:14 AM

Hi,

I think Directory Data just means "Data". It said:

The default Robocopy behavior in Windows 7 and in Windows Server 2008 R2 (in the released versions and the hotfixed versions) is the same as using the /DCOPY:DA option.

And here is the description of the /copy parameter:

/copy:<CopyFlags>
 
Specifies the file properties to be copied. The following are the valid values for this option:

D Data

A Attributes

T Time stamps

S NTFS access control list (ACL)

O Owner information

U Auditing information

The default value for CopyFlags is DAT (data, attributes, and time stamps).

TechNet Subscriber Support in forum |If you have any feedback on our support, please contact [email protected].


Monday, May 27, 2013 9:47 AM | 1 vote

Hi

Hi,

I think Directory Data just means "Data". It said:

The default Robocopy behavior in Windows 7 and in Windows Server 2008 R2 (in the released versions and the hotfixed versions) is the same as using the /DCOPY:DA option.

/copy:<CopyFlags>

Well the /COPY flags arent that important. Try the following example:

mkdir \test
mkdir \test\src
mkdir \test\src\folder
mkdir \test\src\folder-ea

cat "This is secret" > \test\src\folder-ea:SecretfromShaon
cat "Not so secret" > \test\src\file.txt

mkdir \test\target-da
mkdir \test\target-d
mkdir \test\target-a


robocopy \test\src \test\target-da /E /COPY:A /Dcopy:DA
robocopy \test\src \test\target-a /E /COPY:A /Dcopy:A
robocopy \test\src \test\target-d /E /COPY:A /Dcopy:D


dir /R \test\target-a
dir /R \test\target-d
dir /R \test\target-da

By using the /COPY:A it will skip the copy of files.. And /DCOPY:D and DA shows that then, and only then does robocopy copy extended Attributes (NTFS Streams)

C:\dir /R \test\target-a
 Volume in drive C has no label.
 Volume Serial Number is FE3C-7DC6

 Directory of C:\test\target-a

2013-05-27  11:23    <DIR>          .
2013-05-27  11:23    <DIR>          ..
2013-05-27  11:23    <DIR>          folder
2013-05-27  11:23    <DIR>          folder-ea
               0 File(s)              0 bytes
               4 Dir(s)  102 715 068 416 bytes free

C:\dir /R \test\target-d
 Volume in drive C has no label.
 Volume Serial Number is FE3C-7DC6

 Directory of C:\test\target-d

2013-05-27  11:23    <DIR>          .
2013-05-27  11:23    <DIR>          ..
2013-05-27  11:23    <DIR>          folder
2013-05-27  11:23    <DIR>          folder-ea
                                  0 folder-ea:SecretfromShaon:$DATA
               0 File(s)              0 bytes
               4 Dir(s)  102 715 068 416 bytes free

Oscar Virot


Wednesday, May 29, 2013 4:46 AM

Hi There

I believe we are talking about 2 different switches /copy:<copyflags> relates to files.  Whereas /dcopy:<dcopyflags> relates to directories.

You are correct that /copy defaults to DAT.  I also think /dcopy defaults to DA.

So a default robocopy implicitly implies by default robocopy /copy:DAT /dcopy:DA.

What are your thoughts?


Wednesday, May 29, 2013 4:52 AM

So /DCOPY:DA copies Directory streams and attributes whereas /DCOPY:A only copies directory attributes.  Is that correct?  Is there anything else?

What is the importance of the directory streams?


Thursday, May 30, 2013 3:35 AM

Hi,

Oscar is correct. Streams contain information about a file than attributes and properties. Here is an article for File Streams:

File Streams
http://msdn.microsoft.com/en-us/library/windows/desktop/aa364404(v=vs.85).aspx

TechNet Subscriber Support in forum |If you have any feedback on our support, please contact [email protected].


Wednesday, June 5, 2013 3:41 AM

If there is anything further we could help please let us know.

TechNet Subscriber Support in forum |If you have any feedback on our support, please contact [email protected].


Thursday, June 6, 2013 12:09 AM

Hi Shaon

Thanks for your reply.  I am interested only in the switch /DCOPY as this seems to be the area addressed in the hotfix.  The switch seems to refer to directories.  The heart of my question is in relation to directories. 

The link you sent me has a section talking about directory streams.

::$INDEX_ALLOCATION

The stream type of a directory. Used to implement filename allocation for large directories. This stream represents the directory itself and contains all of the data of the directory. Changes to streams of this type are logged to the NTFS change journal. The default stream name of an $INDEX_ALLOCATION stream type is $I30 so "DirName", "DirName::$INDEX_ALLOCATION", and "DirName:$I30:$INDEX_ALLOCATION" are all equivalent

I am trying to gauge the relevance of retaining Directory streams.  Is this important?  What are the implications of not retaining directory streams.

Also I wanted to know if there is a way to method to check directory streams(data).  Oscar showed Dir /R but is there a tool to use to check nested directories.

Is there a method to check?  Oscar suggested NTFS Streams from sysinternals.  This seems to work fine on files but I couldn't see any usage on directories.