

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

# 了解 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) 存放在 Amazon S3 使用者中繼資料中的檔案中繼資料可與使用 的檔案閘道上的 NFS 共用互通 AWS Storage Gateway。檔案閘道可讓您從內部部署網路存取由 DataSync 複製到 Amazon S3 的資料。此中繼資料也可以與 FSx for Lustre 互通。 當 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_tw/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_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 會在這些儲存系統之間複製 （其中大部分具有不同的中繼資料結構） 時，以下列方式處理中繼資料。

[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/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_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 套用的中繼資料。