

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# 了解如何 DataSync 处理文件和对象元数据
<a name="metadata-copied"></a>

AWS DataSync 可以在数据传输期间保留您的文件或对象元数据。如何复制元数据取决于您的传输位置以及这些位置是否使用类似类型的元数据。

## 系统级元数据
<a name="metadata-copied-system-level"></a>

通常， DataSync 不会复制系统级元数据。例如，从 SMB 文件服务器传输时，您在文件系统级别配置的权限不会复制到目标存储系统。

有一些例外。在 Amazon S3 和其他对象存储之间传输时， DataSync 会复制一些[系统定义的对象元数据](#metadata-copied-between-object-s3)。

## 在 Amazon S3 传输中复制的元数据
<a name="metadata-copied-amazon-s3"></a>

下表描述了当传输涉及 Amazon S3 位置时 DataSync 可以复制哪些元数据。

**Topics**
+ [到 Amazon S3](#metadata-copied-to-s3)
+ [在 Amazon S3 和其他对象存储之间](#metadata-copied-between-object-s3)
+ [在 Amazon S3 和 HDFS 之间](#metadata-copied-between-hdfs-s3)

### 到 Amazon S3
<a name="metadata-copied-to-s3"></a>


| 从其中一个位置复制时 | 到此位置 | DataSync 可以复制 | 
| --- | --- | --- | 
|  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/datasync/latest/userguide/metadata-copied.html)  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/datasync/latest/userguide/metadata-copied.html)  |  以下是 Amazon S3 用户元数据： [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/datasync/latest/userguide/metadata-copied.html) 存储在 Amazon S3 用户元数据中的文件元数据可使用 AWS Storage Gateway与文件网关上 NFS 共享互操作。文件网关支持从本地网络对复制到 Amazon S3 的数据进行低延迟访问。 DataSync此元数据也可以与 Lustre 互操作 FSx 。 将包含此元数据的对象 DataSync 复制回 NFS 服务器时，文件元数据将被恢复。还原元数据要求向 NFS 服务器授予提升的权限。有关更多信息，请参阅 [使用 NFS 文件服务器配置 AWS DataSync 传输](create-nfs-location.md)。  | 

### 在 Amazon S3 和其他对象存储之间
<a name="metadata-copied-between-object-s3"></a>

[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/datasync/latest/userguide/metadata-copied.html)

### 在 Amazon S3 和 HDFS 之间
<a name="metadata-copied-between-hdfs-s3"></a>


| 在这些位置之间复制时 | DataSync 可以复制 | 
| --- | --- | 
|  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/datasync/latest/userguide/metadata-copied.html)  | 以下是 Amazon S3 用户元数据：[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/datasync/latest/userguide/metadata-copied.html)HDFS 使用字符串来存储文件和文件夹的用户和群组所有权，而不是数字标识符，例如 UIDs 和 GIDs。 | 

## 在 NFS 传输中复制的元数据
<a name="metadata-copied-nfs"></a>

下表描述了 DataSync 可以在使用网络文件系统 (NFS) 的位置之间复制哪些元数据。


| 在这些位置之间复制时 | DataSync 可以复制 | 
| --- | --- | 
|  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/datasync/latest/userguide/metadata-copied.html)  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/datasync/latest/userguide/metadata-copied.html)  | 

## 在 SMB 传输中复制的元数据
<a name="metadata-copied-smb"></a>

下表描述了 DataSync 可以在使用服务器消息块 (SMB) 的位置之间复制哪些元数据。


| 在这些位置之间复制时 | DataSync 可以复制 | 
| --- | --- | 
|  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/datasync/latest/userguide/metadata-copied.html)  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/datasync/latest/userguide/metadata-copied.html)  | 

## 在其他传输场景中复制的元数据
<a name="metadata-copied-different"></a>

DataSync 在这些存储系统（其中大多数具有不同的元数据结构）之间进行复制时，使用以下方式处理元数据。

[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/datasync/latest/userguide/metadata-copied.html)

## 了解何时以及如何 DataSync 应用默认 POSIX 元数据
<a name="POSIX-metadata"></a>

DataSync 在以下情况下应用默认 POSIX 元数据：
+ 当传输的源位置和目标位置不具有类似的元数据结构时
+ 当源位置缺少元数据时

下表描述了在这些类型的传输期间如何 DataSync 应用默认 POSIX 元数据：


| 来源 | 目标位置 | 文件权限 | 文件夹权限 | UID | GID | 
| --- | --- | --- | --- | --- | --- | 
|  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/datasync/latest/userguide/metadata-copied.html)  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/datasync/latest/userguide/metadata-copied.html)  |  0755  | 0755 |  65534  |  65534  | 
|  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/datasync/latest/userguide/metadata-copied.html)  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/datasync/latest/userguide/metadata-copied.html)  |  0644  |  0755  |  65534  |  65534  | 
|  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/datasync/latest/userguide/metadata-copied.html)  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/datasync/latest/userguide/metadata-copied.html)  |  0644  |  0755  |  65534  |  65534  | 

1 如果对象没有先前应用的元数据 DataSync。