TroubleShooting
[EBS] 2TiB 이상 증설 안되는 이슈 해결방법
이슈
EBS 볼륨이 MBR 방식으로 파티셔닝 되어있어 2TiB 이상 증설이 불가능한 현상이 확인되었다.
에러문구
sudo growpart /dev/nvme1n1 1
WARNING: MBR/dos partitioned disk is larger than 2TB. Additional space will go unused.
NOCHANGE: partition 1 could only be grown by 33 [fudge=2048]
해결방안
#GPT 파티션 테이블을 검사
root@ip-10-200-12-222:~# gdisk -l /dev/nvme1n1
GPT fdisk (gdisk) version 0.8.10
Partition table scan:
MBR: MBR only
BSD: not present
APM: not present
GPT: not present
***************************************************************
Found invalid GPT and valid MBR; converting MBR to GPT format
in memory.
***************************************************************
Disk /dev/nvme1n1: 8388608000 sectors, 3.9 TiB
Logical sector size: 512 bytes
Disk identifier (GUID): 69EC9E7C-4564-4EBE-85F6-361907C0C708
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 8388607966
Partitions will be aligned on 2048-sector boundaries
Total free space is 4093642718 sectors (1.9 TiB)
Number Start (sector) End (sector) Size Code Name
1 2048 4294967262 2.0 TiB 8300 Linux filesystem
# MBR(Master Boot Record) 파티션 테이블을 GPT 파티션 테이블로 변환
root@ip-10-200-12-222:~# sgdisk -g /dev/nvme1n1
***************************************************************
Found invalid GPT and valid MBR; converting MBR to GPT format
in memory.
***************************************************************
The operation has completed successfully.
# 변환된 GPT 파티션 테이블을 검사
root@ip-10-200-12-222:logs# gdisk -l /dev/nvme1n1
GPT fdisk (gdisk) version 0.8.10
Partition table scan:
MBR: protective
BSD: not present
APM: not present
GPT: present
Found valid GPT with protective MBR; using GPT.
Disk /dev/nvme1n1: 8388608000 sectors, 3.9 TiB
Logical sector size: 512 bytes
Disk identifier (GUID): 2489F2B6-1CB1-4710-AEB8-EC89D1EB85C2
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 8388607966
Partitions will be aligned on 2048-sector boundaries
Total free space is 4093642718 sectors (1.9 TiB)
Number Start (sector) End (sector) Size Code Name
1 2048 4294967262 2.0 TiB 8300 Linux filesystem
# 첫 번째 파티션(/dev/nvme1n1p1)의 크기를 늘려서 디스크의 남은 공간을 모두 사용하도록 확장
root@ip-10-200-12-222:~# growpart /dev/nvme1n1 1
[ 3409.283323] nvme1n1: p1
CHANGED: partition=1 start=2048 old: size=4294965215 end=4294967263 new: size=6442448863 end=6442450911
root@ip-10-200-12-222:data# resize2fs /dev/nvme1n1p1
resize2fs 1.42.9 (28-Dec-2013)
Filesystem at /dev/nvme1n1p1 is mounted on /data; on-line resizing required
old_desc_blocks = 256, new_desc_blocks = 500
The filesystem on /dev/nvme1n1p1 is now 1048575739 blocks long.
root@ip-10-200-12-222:data# df -hT
Filesystem Type Size Used Avail Use% Mounted on
devtmpfs devtmpfs 970M 0 970M 0% /dev
tmpfs tmpfs 978M 0 978M 0% /dev/shm
tmpfs tmpfs 978M 436K 977M 1% /run
tmpfs tmpfs 978M 0 978M 0% /sys/fs/cgroup
/dev/nvme0n1p1 xfs 30G 4.4G 26G 15% /
overlay overlay 30G 4.4G 26G 15% /var/lib/docker/overlay2/d27b8a70b59ea7254cdf791fbc496effa0829219e48c9c83e3d87b84eab594d8/merged
shm tmpfs 64M 0 64M 0% /var/lib/docker/containers/440e8e0383bdd3221fbcb1503c9538d564e5253be39aebb4d63443e750ed7560/mounts/shm
tmpfs tmpfs 196M 0 196M 0% /run/user/0
/dev/nvme1n1p1 ext4 3.9T 1.6T 2.2T 43% /data
Reference
[1] Constraints on the size and configuration of an EBS volume https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/volume_constraints.html
[2] https://linux.die.net/man/8/gdisk
[3] https://linux.die.net/man/8/sgdisk
[4] https://repost.aws/knowledge-center/ec2-ubuntu-convert-mbr-to-gpt
[5] MBR vs GPT 차이점
https://4ddig.tenorshare.com/kr/hard-drive/mbr-vs-gpt.html#p3
[6] Convert an MBR disk into a GPT disk in Linux
https://medium.com/@ahmedmansouri/convert-an-mbr-disk-into-a-gpt-disk-in-linux-161ded50697a
댓글