the steps showed in http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/console-modify.html are very complex.
Basically to resize EBS, I need to:
- modify volumn size
expand partition
2-1. detach root device from original EC2 and attach it to another EC2
2-2. login another EC2: sudo umount / sudo parted /dev/xvda
(parted) unit s
(parted) print
'Ignore' to all questions
(parted) rm 1 ...... sudo e2fsck -f /dev/xvda1
2-3.To return an expanded root partition to its original instance: Detach the expanded partition from its secondary instance Reattach the volume to the primary instance using the device name that you identified: /dev/xvda
Start the primary instance.
Terminate the second EC2
Extend linux FS:
sudo resize2fs /dev/xvda1
df -h to see the result
is there easy and safe way to expand EBS size?
-------- update with more information
My EC2 is ubuntu 16.04
~$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
xvda 202:0 0 200G 0 disk
└─xvda1 202:1 0 100G 0 part /
based on http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/recognize-expanded-volume-linux.html and my lsblk output, I need to expand partition. then based on #5 and #6 of http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/expand-linux-partition.html, I need to detach then attache the partition from the original EC2. and then based on http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-detaching-volume.html, I need to first umount -d /dev/xvda, detach partition from original EC2, then attach it to a new EC2, expand partition using parted....

