

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

# Studio 中的 Amazon EFS 自動掛載
<a name="studio-updated-automount"></a>

 Amazon SageMaker AI 支援為網域中的每個使用者自動在 Amazon EFS 磁碟區中掛載資料夾。使用此資料夾，使用者可以在自己的私有空間之間共用資料。不過，使用者無法與網域中的其他使用者共用資料。使用者只能存取自己的資料夾。

 使用者資料夾可透過名為 `user-default-efs` 的資料夾存取。此資料夾存在於 Studio 應用程式的 `$HOME` 目錄中。

 如需選擇退出 Amazon EFS 自動掛載的相關資訊，請參閱[選擇退出 Amazon EFS 自動掛載](studio-updated-automount-optout.md)。

 Amazon EFS 自動掛載也有助於將資料從 Studio Classic 遷移至 Studio。如需詳細資訊，請參閱[(選用) 將資料從 Studio Classic 遷移至 Studio](studio-updated-migrate-data.md)。

 **存取點資訊** 

 啟用自動掛載時，SageMaker AI 會使用 Amazon EFS 存取點，來協助存取 Amazon EFS 磁碟區中的資料。如需存取點的詳細資訊，請參閱[使用 Amazon EFS 存取點](https://docs.aws.amazon.com/efs/latest/ug/efs-access-points.html)。SageMaker AI 會在建立使用者設定檔期間或在為現有使用者設定檔建立應用程式期間，為網域中的每個使用者設定檔建立唯一的存取點。存取點的 POSIX 使用者值符合 SageMaker AI 為其建立存取點之使用者設定檔的 `HomeEfsFileSystemUid` 值。若要取得使用者的值，請參閱 [DescribeUserProfile](https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_DescribeUserProfile.html#sagemaker-DescribeUserProfile-response-HomeEfsFileSystemUid)。根目錄路徑也會設定為與 POSIX 使用者值相同的值。  

 SageMaker AI 會將新目錄的許可設定為下列值：

 
+  擁有者使用者 ID：`POSIX user value`
+  擁有者群組 ID：`0`
+  許可 `700` 

 存取 Amazon EFS 磁碟區需要存取點。因此，您無法刪除或更新存取點，而不會失去對 Amazon EFS 磁碟區的存取。

 **錯誤解決** 

 如果在建立應用程式期間自動掛載 Amazon EFS 使用者資料夾時 SageMaker AI 遇到問題，則仍會建立應用程式。不過，在此情況下，SageMaker AI 會建立名為 `error.txt` 的檔案，而不是掛載 Amazon EFS 資料夾。此檔案描述遇到的錯誤，以及解決該錯誤的步驟。SageMaker AI 會在位於應用程式 `$HOME` 目錄的 `user-default-efs` 資料夾中建立 `error.txt` 檔案。

# 選擇退出 Amazon EFS 自動掛載
<a name="studio-updated-automount-optout"></a>

 您可以在網域和使用者設定檔建立期間，或為現有網域或使用者設定檔選擇退出 Amazon SageMaker AI 自動掛載 Amazon EFS 使用者資料夾。

## 在網域建立期間選擇退出
<a name="studio-updated-automount-optout-domain-creation"></a>

 您可以在使用主控台或 AWS Command Line Interface建立網域時選擇退出 Amazon EFS 自動掛載。

### 主控台
<a name="studio-updated-automount-optout-domain-creation-console"></a>

從主控台建立網域時，請完成下列步驟來選擇退出 Amazon EFS 自動掛載。

1. 開啟 Amazon SageMaker AI 主控台，網址為 [https://console.aws.amazon.com/sagemaker/](https://console.aws.amazon.com/sagemaker/)。

1.  使用下列修改來完成[使用 Amazon SageMaker AI 的自訂設定](onboard-custom.md)中的步驟，以設定網域。
   +  在**設定儲存**步驟中，關閉**自動掛載 EFS 儲存和資料**。

### AWS CLI
<a name="studio-updated-automount-optout-domain-creation-cli"></a>

 使用下列命令，在使用 AWS CLI建立網域期間選擇退出 Amazon EFS 自動掛載。如需使用 建立網域的詳細資訊 AWS CLI，請參閱 [使用 Amazon SageMaker AI 的自訂設定](onboard-custom.md)。

```
aws --region region sagemaker create-domain \
--domain-name "my-domain-$(date +%s)" \
--vpc-id default-vpc-id \
--subnet-ids subnet-ids \
--auth-mode IAM \
--default-user-settings "ExecutionRole=execution-role-arn,AutoMountHomeEFS=Disabled" \
--default-space-settings "ExecutionRole=execution-role-arn"
```

## 選擇退出現有的網域
<a name="studio-updated-automount-optout-domain-existing"></a>

 您可以使用主控台或 AWS CLI選擇退出現有網域的 Amazon EFS 自動掛載。

### 主控台
<a name="studio-updated-automount-optout-domain-existing-console"></a>

 從主控台更新網域時，請完成下列步驟來選擇退出 Amazon EFS 自動掛載。

1. 開啟 Amazon SageMaker AI 主控台，網址為 [https://console.aws.amazon.com/sagemaker/](https://console.aws.amazon.com/sagemaker/)。

1.  在左側導覽的**管理員組態**下，選擇**網域**。

1.  在**網域**頁面上，選取您要選擇退出 Amazon EFS 自動掛載的網域。

1.  在**網域詳細資訊**頁面上，選取**網域設定**索引標籤。

1.  導覽至**儲存組態**區段。

1.  選擇 **Edit** (編輯)。

1.  從**編輯儲存設定**頁面中，關閉**自動掛載 EFS 儲存和資料**。

1.  選取**提交**。

### AWS CLI
<a name="studio-updated-automount-optout-domain-existing-cli"></a>

 使用下列命令，在使用 AWS CLI更新現有網域時，選擇退出 Amazon EFS 自動掛載。

```
aws --region region sagemaker update-domain \
--domain-id domain-id \
--default-user-settings "AutoMountHomeEFS=Disabled"
```

## 在建立使用者設定檔期間選擇退出
<a name="studio-updated-automount-optout-user-creation"></a>

 您可以在使用主控台或 AWS CLI建立使用者設定檔時選擇退出 Amazon EFS 自動掛載。

### 主控台
<a name="studio-updated-automount-optout-user-creation-console"></a>

 從主控台建立使用者設定檔時，請完成下列步驟來選擇退出 Amazon EFS 自動掛載。

1. 開啟 Amazon SageMaker AI 主控台，網址為 [https://console.aws.amazon.com/sagemaker/](https://console.aws.amazon.com/sagemaker/)。

1.  使用下列修改來完成[新增使用者設定檔](domain-user-profile-add.md)中的步驟，以建立使用者設定檔。
   +  在**資料和儲存**步驟中，關閉**從網域繼承設定**。這可讓使用者具有與為網域設定的預設值不同的值。  
   +  關閉**自動掛載 EFS 儲存體和資料**。

### AWS CLI
<a name="studio-updated-automount-optout-user-creation-cli"></a>

 使用下列命令，在使用 AWS CLI建立使用者設定檔期間選擇退出 Amazon EFS 自動掛載。如需使用 建立使用者設定檔的詳細資訊 AWS CLI，請參閱 [新增使用者設定檔](domain-user-profile-add.md)。

```
aws --region region sagemaker create-user-profile \
--domain-id domain-id \
--user-profile-name "user-profile-$(date +%s)" \
--user-settings "ExecutionRole=arn:aws:iam::account-id:role/execution-role-name,AutoMountHomeEFS=Enabled/Disabled/DefaultAsDomain"
```

## 選擇退出現有的使用者設定檔
<a name="studio-updated-automount-optout-user-existing"></a>

 您可以使用主控台或 AWS CLI選擇退出現有使用者設定檔的 Amazon EFS 自動掛載。

### 主控台
<a name="studio-updated-automount-optout-user-existing-console"></a>

 從主控台更新使用者設定檔時，請完成下列步驟來選擇退出 Amazon EFS 自動掛載。

1. 開啟 Amazon SageMaker AI 主控台，網址為 [https://console.aws.amazon.com/sagemaker/](https://console.aws.amazon.com/sagemaker/)。

1.  在左側導覽的**管理員組態**下，選擇**網域**。

1.  在**網域**頁面上，選取網域，其中包含您要選擇退出 Amazon EFS 自動掛載的使用者設定檔。

1.  在**網域詳細資訊**頁面上，選取**使用者設定檔**索引標籤。

1.  選取要更新的使用者設定檔。

1.  從**使用者詳細資訊**索引標籤中，導覽至 **AutoMountHomeEFS** 區段。

1.  選擇 **Edit** (編輯)。

1.  從**編輯儲存設定**頁面中，關閉**從網域繼承設定**。這可讓使用者具有與為網域設定的預設值不同的值。  

1.  關閉**自動掛載 EFS 儲存體和資料**。

1.  選取**提交**。

### AWS CLI
<a name="studio-updated-automount-optout-user-existing-cli"></a>

 使用下列命令，在使用 AWS CLI更新現有使用者設定檔時，選擇退出 Amazon EFS 自動掛載。

```
aws --region region sagemaker update-user-profile \
--domain-id domain-id \
--user-profile-name user-profile-name \
--user-settings "AutoMountHomeEFS=DefaultAsDomain"
```