Resizing an Amazon EBS Volume

Amazon EBS volume size ์กฐ์ •ํ•˜๊ธฐ

1. EBS Volume ํฌ๊ธฐ ์กฐ์ •

: AWS Console์—์„œ ํ•ด๋‹น disk๋ฅผ ํ•„์š”ํ•œ ์‚ฌ์ด์ฆˆ๋กœ modify volume์„ ํ•œ๋‹ค

2. Linux file system ํ™•์žฅ

  • EBS volume ํฌ๊ธฐ๋ฅผ ๋Š˜๋ฆฌ๊ณ  ๋‚œ ํ›„์—๋Š” linux file system์˜ ํฌ๊ธฐ๋ฅผ ๋Š˜๋ ค์ค˜์•ผํ•œ๋‹ค

  • AWS console์—์„œ volume status๊ฐ€ optimizing ์ƒํƒœ๊ฐ€ ๋˜๋ฉด file system ํฌ๊ธฐ ์กฐ์ •์„ ์‹œ์ž‘ ํ•  ์ˆ˜ ์žˆ๋‹ค

2-1. ํ•ด๋‹น Instance์— ์ ‘์†ํ•˜์—ฌ file system์„ ํ™•์ธํ•œ๋‹ค

[root@scouter ~]# df -alh 
Filesystem      Size  Used Avail Use% Mounted on
/dev/nvme1n1     20G   20G  880M  96% /home/appuser/scouter
binfmt_misc        0     0     0    - /proc/sys/fs/binfmt_misc
  • df -alh

    • df

      • disk free command

    • -alh

      • -a

        • all

      • -l

        • local

      • -h

        • human-readable

2-2. xfs_growfs ๋ช…๋ น์„ ์‚ฌ์šฉํ•˜์—ฌ ํ•ด๋‹น volume์—์„œ file system ์„ ํ™•์žฅํ•œ๋‹ค

[root@scouter ~]# xfs_growfs /dev/nvme1n1
  • /dev/nvme1n1 ํŒŒํ‹ฐ์…˜์˜ volume์„ ๋Š˜๋ ค์ฃผ๋Š” ๋ช…๋ น์–ด๋‹ค

2-3. ๋‹ค์‹œ file system ํฌ๊ธฐ๋ฅผ ํ™•์ธํ•œ๋‹ค

[root@scouter ~]# df -alh
Filesystem      Size  Used Avail Use% Mounted on
/dev/nvme1n1     30G   20G   11G  64% /home/appuser/scouter
binfmt_misc        0     0     0    - /proc/sys/fs/binfmt_misc
  • 30G ๋กœ file system์— ๋Š˜์–ด๋‚œ ๋ณผ๋ฅจ ํฌ๊ธฐ๊ฐ€ ๋ฐ˜์˜๋œ ๊ฒƒ์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋‹ค

๋~!

Last updated