[AWS] EC2 EBS 볼륨 추가하기

 

 

콘솔에서 EBS 볼륨 생성 후 EC2 인스터스에 연결

 

 

EC2 서비스에서 왼쪽 메뉴의

Elastic Block Store -> 볼륨을 눌러주세요

 

상단에 "볼륨 생성"을 눌러주세요

 

볼륨 유형을 선택해 주시고

크기와 가용영역을 선택해 주시고 생성을 하시면 됩니다.

 

볼륨 유형은 볼륨의 성능을 결정합니다.

유형을 특성은 아래 링크를 참고해 주시기 바랍니다

https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-volume-types.html?icmpid=docs_ec2_console

 

선택한 볼륨을 체크한 상태에서

상단의 작업 -> 볼륨 연결을 눌러주세요

 

볼륨을 연결할 인스턴스(서버)를 선택하는 단계입니다

선택 후 우측 하단의 연결을 눌러줍니다.

 

 

서버에서 EBS 볼륨 인식하기

 

lsblk 명령어로 추가된 디바이스 정보를 확인합니다

nvme1n1이 추가로 잡혔네요.

[root@ip-172-60-128-10 ec2-user]# lsblk
NAME          MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
nvme1n1       259:0    0  300G  0 disk
nvme0n1       259:1    0    8G  0 disk
├─nvme0n1p1   259:2    0    8G  0 part /
└─nvme0n1p128 259:3    0    1M  0 part

 

fdisk 명령어로 파티션을 생성합니다.

[root@ip-172-60-128-10 ec2-user]# fdisk /dev/nvme1n1

Welcome to fdisk (util-linux 2.30.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0x75db7828.

Command (m for help): n
Partition type
   p   primary (0 primary, 0 extended, 4 free)
   e   extended (container for logical partitions)
Select (default p): p
Partition number (1-4, default 1):
First sector (2048-629145599, default 2048):
Last sector, +sectors or +size{K,M,G,T,P} (2048-629145599, default 629145599):

Created a new partition 1 of type 'Linux' and of size 300 GiB.

Command (m for help): p
Disk /dev/nvme1n1: 300 GiB, 322122547200 bytes, 629145600 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x75db7828

Device         Boot Start       End   Sectors  Size Id Type
/dev/nvme1n1p1       2048 629145599 629143552  300G 83 Linux

Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.

 

파티션 생성 확인

[root@ip-172-60-128-10 ec2-user]# lsblk
NAME          MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
nvme1n1       259:0    0  300G  0 disk
└─nvme1n1p1   259:4    0  300G  0 part
nvme0n1       259:1    0    8G  0 disk
├─nvme0n1p1   259:2    0    8G  0 part /
└─nvme0n1p128 259:3    0    1M  0 part

 

xfs 파일시스템으로 포맷

[root@ip-172-60-128-10 ec2-user]# mkfs -t xfs /dev/nvme1n1p1

 

파티션 마운트 및 마운트 확인

[root@ip-172-60-128-10 ec2-user]# mkdir /test
[root@ip-172-60-128-10 ec2-user]# mount /dev/nvme1n1p1 /test
[root@ip-172-60-128-10 ec2-user]# df -h
Filesystem      Size  Used Avail Use% Mounted on
...
/dev/nvme0n1p1  8.0G  1.5G  6.6G  19% /
/dev/nvme1n1p1  300G  339M  300G   1% /test

댓글

Designed by JB FACTORY

loading