<1> was 에 data 볼륨 만들어 사용해보자.
<2> 파티션 확인 및 포맷
<3> 볼륨 마운트
<1> was 에 data 볼륨 만들어 사용해보자.
was는 데이터를 많이 저장 하므로 data 디스크가 더 필요할수 있다.
추가해보자.
1
computing > virtual machine > volume > 해당 was선택 > 볼륨 만들기
add-volume 기본 10G
: 에서 볼륨 연결 설정 > 인스턴스 지정
2
# 추가볼륨 인식되는지 확인
lsblk | grep vdb
vdb 252:16 0 10G 0 disk
3
# fdisk를 이용하여 파티션 생성 (기본값 적용)
sudo fdisk /dev/vdb
Welcome to fdisk (util-linux 2.34).
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 0x32b9e60c.
Command (m for help): n
3
Partition type
p primary (0 primary, 0 extended, 4 free)
e extended (container for logical partitions)
Select (default p): (엔터)
4
Partition number (1-4, default 1): (엔터)
5
First sector (2048-20971519, default 2048): (엔터)
6
Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-20971519, default 20971519): (엔터)
7
Created a new partition 1 of type 'Linux' and of size 10 GiB.
Command (m for help): w
<2> 파티션 확인 및 포맷
1
# 파티션 확인
lsblk | grep vdb
vdb 252:16 0 10G 0 disk
└─vdb1 252:17 0 10G 0 part
2
# 파티션 xfs로 포맷
sudo mkfs -t xfs /dev/vdb1
meta-data=/dev/vdb1 isize=512 agcount=4, agsize=655296 blks
= sectsz=512 attr=2, projid32bit=1
= crc=1 finobt=1, sparse=1, rmapbt=0
= reflink=1
data = bsize=4096 blocks=2621184, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0, ftype=1
log =internal log bsize=4096 blocks=2560, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
<3> 볼륨 마운트
1
# 볼륨을 연결할 디렉터리 생성
sudo mkdir -p /data/logs
2
# 생성한 디렉터리에 볼륨 연결
sudo mount /dev/vdb1 /data/logs
3
# 마운트 확인
lsblk | grep vdb
4
# 이후 애플리케이션 설치를 위해 소유자 변경 , 우분트인 경우 아래
sudo chown -R ubuntu:ubuntu /data
centos 경우
sudo chown -R centos:centos /data
5
확인
[centos@host-172-16-132-67 ~]$ df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 3.8G 0 3.8G 0% /dev
tmpfs 3.8G 0 3.8G 0% /dev/shm
tmpfs 3.8G 8.5M 3.8G 1% /run
tmpfs 3.8G 0 3.8G 0% /sys/fs/cgroup
/dev/vda1 20G 1.6G 19G 8% /
tmpfs 777M 0 777M 0% /run/user/1000
/dev/vdb1 10G 104M 9.9G 2% /data/logs
[centos@host-172-16-132-67 ~]$ cd /
감사합니다.
[centos@host-172-16-132-67 /]$ sudo chown -R centos:centos /data
[centos@host-172-16-132-67 /]$ ls -al
total 16
dr-xr-xr-x. 18 root root 236 Apr 4 04:12 .
dr-xr-xr-x. 18 root root 236 Apr 4 04:12 ..
lrwxrwxrwx. 1 root root 7 Jun 22 2021 bin -> usr/bin
dr-xr-xr-x. 6 root root 4096 Apr 4 03:30 boot
drwxr-xr-x. 3 centos centos 18 Apr 4 04:12 data
drwxr-xr-x. 18 root root 2740 Apr 4 04:11 dev
drwxr-xr-x. 93 root root 8192 Apr 4 03:29 etc
drwxr-xr-x. 3 root root 20 Apr 4 03:29 home
lrwxrwxrwx. 1 root root 7 Jun 22 2021 lib -> usr/lib
lrwxrwxrwx. 1 root root 9 Jun 22 2021 lib64 -> usr/lib64
drwxr-xr-x. 2 root root 6 Jun 22 2021 media
drwxr-xr-x. 2 root root 6 Jun 22 2021 mnt
drwxr-xr-x. 2 root root 6 Jun 22 2021 opt
dr-xr-xr-x. 117 root root 0 Apr 4 03:29 proc
dr-xr-x---. 3 root root 126 Apr 4 03:29 root
drwxr-xr-x. 27 root root 860 Apr 4 03:29 run
lrwxrwxrwx. 1 root root 8 Jun 22 2021 sbin -> usr/sbin
drwxr-xr-x. 2 root root 6 Jun 22 2021 srv
dr-xr-xr-x. 13 root root 0 Apr 4 03:29 sys
drwxrwxrwt. 8 root root 172 Apr 4 03:46 tmp
drwxr-xr-x. 13 root root 158 Jan 25 2022 usr
drwxr-xr-x. 20 root root 278 Apr 4 03:29 var
[centos@host-172-16-132-67 /]$
다음
https://brunch.co.kr/@topasvga/3116
감사합니다.