How to resize volume on EC2 - CentOS?

故事扮演 提交于 2019-12-11 08:54:26

问题


I created EMR on AWS and ssh to a name node. Noticed there was a space issue and increased volume in AWS console from 200GB -> 500GB.
Then rebooted instance and it is showing that there is no change:

df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/xvda1      197G  187G  3.1M 100% /
tmpfs            32G     0   32G   0% /dev/shm
cm_processes     32G     0   32G   0% /var/run/cloudera-scm-agent/process

Tried to check partitions and this is what is showing:

lsblk
NAME    MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
xvda    202:0    0  500G  0 disk
└─xvda1 202:1    0  200G  0 part /

Then did resize2fs but is showning nothing to do:

sudo resize2fs /dev/xvda1
resize2fs 1.41.12 (17-May-2010)
The filesystem is already 52428544 blocks long.  Nothing to do!

Size did not change.
What should I do next?

Thanks.


回答1:


  1. Snapshot all ebs volumes you care about before doing any resize operations on them.

  2. Install growpart sudo yum install cloud-utils-growpart

  3. Resize partiongrowpart /dev/xdva 1

  4. Reboot reboot now

  5. Run lsblk and verify that the partition is now the full disk size

  6. You may still have to run sudo resize2fs /dev/xvda1 to expand the filesystem



来源:https://stackoverflow.com/questions/50836533/how-to-resize-volume-on-ec2-centos

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!