# EFS

## Task1 EFS 생성하기

### 1-1 EFS용 Security group 생성

VPC 메뉴의 Security Group으로 이동하여 \[Create security group]을 클릭합니다.

* Security group name - "EFS-SG" 입력
* Description - "IMD EFS SG" 입력
* VPC - "IMD-VPC" 선택
* Inbound roles - Type: NFS , Destination: Anywhere 선택
* Tag - Key: Name , Value: EFS-SG

<div align="left"><img src="/files/-MdWkcvIEP70iDHuHU4b" alt=""></div>

### 1-2 EFS 만들기

AWS 콘솔에서 EFS  검색하고, 선택합니다. \[Create file system]을 클릭합니다.

<div align="left"><img src="/files/-MdWkg1yz3AKdiDNSa38" alt=""></div>

* Name - "IMD-EFS-Regional" 입력
* VPC - "IMD-VPC" 생성
* Availability and Durability - Regional 선택
* \[Customize] 선택

![](/files/6j3mzc4FB8JAfyVXIsXj)

File system settings에서 \[Next]를 클릭합니다.

Network access에서 Subnet은 "Private-A" 와 "Private-C"를 확인하고 Security grups를 생성한 "EFS-SG"로 변경합니다.

![](/files/gojs70dKjJ7klDnQyBbI)

\[Next]로 EFS를 생성합니다.

생성된 EFS, "IMD-EFS-Regional"을 클릭합니다. 기본 설정을 확인하고 필요 시 \[Edit]로 변경 할 수 있습니다. 랩에서는 기본 설정으로 사용합니다.

<div align="left"><img src="/files/-MdWkmwJRFvLpOkHTVvo" alt=""></div>

### 1-3 EFS 마운트

생성된 EFS, "IMD-EFS-Regional"을 클릭 후, Netwok 탭을 확인합니다. VPC, "IMD-VPC", 내 Availability zone에 대한 ENI(Elastic Network Interface)가 구성되어 있습니다.

EFS에 접근할 EC2에 대해서도 NFS 인바운드 허용이 필요합니다. 랩에서는 "PRIVATE-EC2-A01" 과 "PRIVATE-EC2-C01" 에 Security group, "EFS-SG"를 적용합니다.

* 변경한 instance, "PRIVATE-EC2-A01" 선택
* \[Actions] > \[Security] > \[Change security groups]

![](/files/-MdWkv93PvSuJn3q-sPv)

* EFS-SG를 선택 후 "Add security group" 클릭

<div align="left"><img src="/files/-MdWky5yyemjj-X_zSjt" alt=""></div>

"PRIVATE-EC2-C01"에 대해서도 Security group "EFS-SG"를 추가합니다.

EFS 마운트를 위해 [Session manager](/aws-general-immersion-day/networking/vpc-endpoint.md#1-4-private-ec-2) 를 통하여 PRIVATE-EC2 인스턴스에 접속합니다.

EFS에 대한 마운트 명령어는 \[attach] 를 클릭하여 참고 할 수 있습니다.

<div align="left"><img src="/files/-MdWl2K8JmtlUyM8xWb6" alt=""></div>

각 instance에서 EFS를 마운트 합니다.

```bash
mkdir ~/efs
sudo yum install -y amazon-efs-utils
sudo mount -t efs <EFS ID>:/ efs
df -h
```

efs 디렉토리에 간단한 파일을 생성하여 인스턴스에서 확인합니다.

```bash
cd /home/ec2-user/efs
sudo touch efs1 efs2 efs3
```

<div align="left"><img src="/files/-MdWl66zEGV5Tqwz6las" alt=""></div>

Instance 양쪽에서 파일을 확인할 수 있습니다.

{% hint style="success" %}
&#x20;Storage Lab을 성공적으로 완료하였습니다.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://wjlee81.gitbook.io/aws-general-immersion-day/untitled/untitled-1.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
