brunch
매거진 NCE

NCE-7.리눅스 서버에 디스크 추가하기-7/24

by Master Seo


리눅스 서버 디스크 용량이 부족할 때 디스크 추가가 필요하다.

DISK 추가해보자



<1> 용량 확인과 디스크 추가

<2> 마운트 디렉터리 만들기, 파티셔닝, 포맷하기, 사용하기

<3> 서버 반납은 추가된 스토리지를 삭제한 후에 서버 반납이 가능하다.




<1> 용량 확인과 디스크 추가


1

Server > Storage 가면 용량을 확인할 수 있다.

리눅스는 디폴트로 50GB 할당이다.


2

디스크 추가는 Sever > 해당 서버 클릭

서버 관리 및 설정 변경 > 스토리지 생성에서 SSD, HDD 중 선택해 만든다.

ssh-disk1


최소 10기가 ~ 최대 2 테라까지 가능하다.

10기가로 추가하자



3

확인?

Server에서 확인 가능

서버 > 스토리지에서 확인 가능하다.





<2> 마운트 디렉터리 만들기, 파티셔닝, 포맷하기, 사용하기


1

마운트 디렉터리 만들기

root (/) 아래에 만든다.

[root@ssh-login ~]# mkdir /disk1



2

파티셔닝

[root@ssh-login ~]# fdisk /dev/xvdb

Welcome to fdisk (util-linux 2.23.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

Building a new DOS disklabel with disk identifier 0x4 b64 ec74.


Command (m for help): n

Partition type:

p primary (0 primary, 0 extended, 4 free)

e extended

Select (default p): p

Partition number (1-4, default 1): 1

First sector (2048-20971519, default 2048):

Using default value 2048

Last sector, +sectors or +size {K, M, G} (2048-20971519, default 20971519):

Using default value 20971519

Partition 1 of type Linux and of size 10 GiB is set


Command (m for help): w

The partition table has been altered!


Calling ioctl() to re-read partition table.

Syncing disks.



3

포맷하기

[root@ssh-login ~]# mkfs.ext4 /dev/xvdb1



4

마운트 하기

[root@ssh-login ~]# mount /dev/xvdb1 /disk1


[root@ssh-login ~]# df -h

Filesystem Size Used Avail Use% Mounted on

devtmpfs 1.9G 0 1.9G 0% /dev

tmpfs 1.9G 0 1.9G 0% /dev/shm

tmpfs 1.9G 9.2M 1.9G 1% /run

tmpfs 1.9G 0 1.9G 0% /sys/fs/cgroup

/dev/xvda2 49G 2.4G 47G 5% /

/dev/xvda1 1014M 183M 832M 18% /boot

tmpfs 378M 0 378M 0% /run/user/0

tmpfs 378M 0 378M 0% /run/user/1001

/dev/xvdb1 9.8G 37M 9.2G 1% /disk1



5

사용하기

[root@ssh-login ~]# cd /disk1

[root@ssh-login disk1]# touch test

[root@ssh-login disk1]# ls -al

total 20

drwxr-xr-x 3 root root 4096 Dec 27 11:19.

dr-xr-xr-x. 19 root root 270 Dec 27 11:18..

drwx------ 2 root root 16384 Dec 27 11:19 lost+found

-rw-r--r-- 1 root root 0 Dec 27 11:19 test


아래는 20G추가 경우





<3> 서버 반납은 추가된 스토리지를 삭제한 후에 서버 반납이 가능하다.


Server > Storage 에서 추가된 스토리지를 삭제한 후에 서버 반납이 가능하다.


100 추가한 스토리지 반납후 서버 삭제 가능.png



다음은

운영중인 서버로 이미지 서버 만들고, 해당 이미지로 서버 만들어 보자


https://brunch.co.kr/@topasvga/2052


keyword
매거진의 이전글NCE-6.리눅스 서버 로그 수집하자-6/24