

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 了解 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_tw/datasync/latest/userguide/metadata-copied.html)  |  [See the AWS documentation website for more details](http://docs.aws.amazon.com/zh_tw/datasync/latest/userguide/metadata-copied.html)  | 下列為 Amazon S3 使用者中繼資料：[See the AWS documentation website for more details](http://docs.aws.amazon.com/zh_tw/datasync/latest/userguide/metadata-copied.html)<br />存放在 Amazon S3 使用者中繼資料中的檔案中繼資料可與使用 的檔案閘道上的 NFS 共用互通 AWS Storage Gateway。檔案閘道可讓您從內部部署網路存取由 DataSync 複製到 Amazon S3 的資料。此中繼資料也可以與 FSx for Lustre 互通。<br />當 DataSync 將包含此中繼資料的物件複製回 NFS 伺服器時，會還原檔案中繼資料。還原中繼資料需要將提升的許可授予 NFS 伺服器。如需詳細資訊，請參閱[使用 NFS 檔案伺服器設定 AWS DataSync 傳輸](create-nfs-location.md)。 | 

### Amazon S3 與其他物件儲存體之間
<a name="metadata-copied-between-object-s3"></a>


<table>
<thead>
  <tr><th>在這些位置之間複製時</th><th>DataSync 可以複製</th></tr>
</thead>
<tbody>
  <tr><td> [See the AWS documentation website for more details](http://docs.aws.amazon.com/zh_tw/datasync/latest/userguide/metadata-copied.html) </td><td rowspan="2">[See the AWS documentation website for more details](http://docs.aws.amazon.com/zh_tw/datasync/latest/userguide/metadata-copied.html)DataSync 不會複製其他物件中繼資料，例如物件存取控制清單 (ACLs)、先前的物件版本或上次修改的金鑰。</td></tr>
  <tr><td> [See the AWS documentation website for more details](http://docs.aws.amazon.com/zh_tw/datasync/latest/userguide/metadata-copied.html) </td></tr>
</tbody>
</table>


### 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_tw/datasync/latest/userguide/metadata-copied.html)  | 下列為 Amazon S3 使用者中繼資料：[See the AWS documentation website for more details](http://docs.aws.amazon.com/zh_tw/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_tw/datasync/latest/userguide/metadata-copied.html)  |  [See the AWS documentation website for more details](http://docs.aws.amazon.com/zh_tw/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_tw/datasync/latest/userguide/metadata-copied.html)  |  [See the AWS documentation website for more details](http://docs.aws.amazon.com/zh_tw/datasync/latest/userguide/metadata-copied.html)  | 

## 在其他傳輸案例中複製的中繼資料
<a name="metadata-copied-different"></a>

DataSync 會在這些儲存系統之間複製 （其中大部分具有不同的中繼資料結構） 時，以下列方式處理中繼資料。


<table>
<thead>
  <tr><th>從其中一個位置複製時</th><th>前往其中一個位置</th><th>DataSync 可以複製</th></tr>
</thead>
<tbody>
  <tr><td> [See the AWS documentation website for more details](http://docs.aws.amazon.com/zh_tw/datasync/latest/userguide/metadata-copied.html) </td><td> [See the AWS documentation website for more details](http://docs.aws.amazon.com/zh_tw/datasync/latest/userguide/metadata-copied.html) </td><td>目的地檔案系統上所有檔案和資料夾[的預設 POSIX 中繼資料](#POSIX-metadata)，或目的地 S3 儲存貯體中的物件。這種方法包括使用預設的 POSIX 使用者 ID 和群組 ID 值。<br />不會保留 Windows 型中繼資料 （例如 ACLs)。</td></tr>
  <tr><td> [See the AWS documentation website for more details](http://docs.aws.amazon.com/zh_tw/datasync/latest/userguide/metadata-copied.html) </td><td> [See the AWS documentation website for more details](http://docs.aws.amazon.com/zh_tw/datasync/latest/userguide/metadata-copied.html) </td><td>目的地檔案和資料夾上的[預設 POSIX 中繼資料](#POSIX-metadata)。這種方法包括使用預設的 POSIX 使用者 ID 和群組 ID 值。</td></tr>
  <tr><td> [See the AWS documentation website for more details](http://docs.aws.amazon.com/zh_tw/datasync/latest/userguide/metadata-copied.html) </td><td> [See the AWS documentation website for more details](http://docs.aws.amazon.com/zh_tw/datasync/latest/userguide/metadata-copied.html) </td><td>以下是使用者定義的中繼資料：[See the AWS documentation website for more details](http://docs.aws.amazon.com/zh_tw/datasync/latest/userguide/metadata-copied.html)</td></tr>
  <tr><td> [See the AWS documentation website for more details](http://docs.aws.amazon.com/zh_tw/datasync/latest/userguide/metadata-copied.html) </td><td> [See the AWS documentation website for more details](http://docs.aws.amazon.com/zh_tw/datasync/latest/userguide/metadata-copied.html) </td><td>[See the AWS documentation website for more details](http://docs.aws.amazon.com/zh_tw/datasync/latest/userguide/metadata-copied.html)HDFS 會將檔案和資料夾使用者和群組擁有權儲存為字串，而不是數字識別符 （例如 UIDs和 GIDs)。UIDs和 GIDs的預設值會套用至目的地檔案系統。如需詳細資訊，請參閱[了解 DataSync 何時以及如何套用預設 POSIX 中繼資料](#POSIX-metadata)。</td></tr>
  <tr><td> [See the AWS documentation website for more details](http://docs.aws.amazon.com/zh_tw/datasync/latest/userguide/metadata-copied.html) </td><td> [See the AWS documentation website for more details](http://docs.aws.amazon.com/zh_tw/datasync/latest/userguide/metadata-copied.html) </td><td>來源位置的檔案和資料夾時間戳記。檔案或資料夾擁有者是根據您在建立 HDFS [傳輸位置時指定的 HDFS](create-hdfs-location.md) 使用者或 Kerberos 主體所設定。Hadoop 叢集上的群組映射組態會決定群組。</td></tr>
  <tr><td> [See the AWS documentation website for more details](http://docs.aws.amazon.com/zh_tw/datasync/latest/userguide/metadata-copied.html) </td><td> [See the AWS documentation website for more details](http://docs.aws.amazon.com/zh_tw/datasync/latest/userguide/metadata-copied.html) </td><td rowspan="2">來源位置的檔案和資料夾時間戳記。擁有權是根據 DataSync 中指定的 Windows 使用者來設定，以存取 Amazon FSx 或 SMB 共享。許可繼承自父目錄。</td></tr>
  <tr><td> [See the AWS documentation website for more details](http://docs.aws.amazon.com/zh_tw/datasync/latest/userguide/metadata-copied.html) </td><td> [See the AWS documentation website for more details](http://docs.aws.amazon.com/zh_tw/datasync/latest/userguide/metadata-copied.html) </td></tr>
</tbody>
</table>


## 了解 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_tw/datasync/latest/userguide/metadata-copied.html)  |  [See the AWS documentation website for more details](http://docs.aws.amazon.com/zh_tw/datasync/latest/userguide/metadata-copied.html)  | 0755 | 0755 | 65534 | 65534 | 
|  [See the AWS documentation website for more details](http://docs.aws.amazon.com/zh_tw/datasync/latest/userguide/metadata-copied.html)  |  [See the AWS documentation website for more details](http://docs.aws.amazon.com/zh_tw/datasync/latest/userguide/metadata-copied.html)  | 0644 | 0755 | 65534 | 65534 | 
|  [See the AWS documentation website for more details](http://docs.aws.amazon.com/zh_tw/datasync/latest/userguide/metadata-copied.html)  |  [See the AWS documentation website for more details](http://docs.aws.amazon.com/zh_tw/datasync/latest/userguide/metadata-copied.html)  | 0644 | 0755 | 65534 | 65534 | 

1 如果物件沒有之前由 DataSync 套用的中繼資料。