fdisk -lu
: 디스크 정보 확인. 여기서 gpt version 인지 확인하고, 다음으로 /dev/sda의 세 번째 partition을 늘림
apt-get update
type growpart || apt-get install -y cloud-guest-utils
type sgdisk || apt-get install -y gdisk
LC_ALL=en_US.UTF-8 growpart /dev/sda 3
/dev/sda
ㄴ sda1
ㄴ sda2
ㄴ da3 <-- 이거 늘리는거
(* 클라우드에서 공간 늘릴 때는 위 명령어를 다 입력했는데 서버 가상머신에서 공간 늘릴 때는 아래 볼드 처리한 명령어만 입력해도 됐다)
df -Th
: 위와 같은 disk configuration은 이 명령어로 확인 가능
growpart /dev/sda 3
: 여기서 CHANGED가 나와야 성공적으로 공간 크기 늘린 것
resize2fs /dev/sda 3
: extend file system
이후 df -Th로 제대로 늘어났는지 확인 가능
Extend the partitions and file systems of disks on a Linux instance - Elastic Compute Service - Alibaba Cloud Documentation Cent
When a disk of an Elastic Compute Service (ECS) instance is resized in the ECS console, the partitions and file systems on the disk are not automatically extended together with the disk. You must manually extend partitions and file systems on the disk into
www.alibabacloud.com
**
하위-하위 디스크 공간 늘릴 때
/dev/sda
ㄴ sda1
ㄴ sda2
ㄴ sda3
ㄴ ubuntu--vg-ubuntu--lv <-- 이거 늘릴 때
sudo vgdisplay
sudo pvresize /dev/sda3
sudo lvextend -l +100%FREE /dev/mapper/ubuntu--vg-ubuntu--lv
sudo resize2fs /dev/mapper/ubuntu--vg-ubuntu--lv
'Server & Cloud' 카테고리의 다른 글
AWS Lambda에 zip 형태로 코드 업로드 (0) | 2025.01.13 |
---|---|
[AWS Lambda] docker image로 Lambda 생성 (0) | 2024.11.12 |
nmap installation (0) | 2024.07.07 |
[KVM] virsh console에서 Escape character is ^] 문제 해결 (1) | 2023.12.04 |