[AWS] Root volume (EBS) can now be expanded without stopping the service! ! !
table of contents
This is Yamada from the Systems Department.
An update to Amazon EBS was announced on February 14th.
Amazon EBS Update – New Elastic Volumes Changes Everything
You can now change the EBS volume type, size, and Iops from the console panel.
Until now, expanding EBS required stopping and detaching the instance, then attaching it to another instance, which was quite a hassle, so this is very convenient!
From now on, you can change EBS as needed while the service is running!
So, let's try it out right away
Expand the EBS size from the AWS console
First, select the EBS volume you want to expand.
In this example, we will change the 30GiB GP2 volume to 40GiB.
For now, ① select EBS and ② click “Actions”

. The status is of course in-use.
Then you will see the words "Modify Volume" in the menu!
Click it.

A subwindow will appear, allowing you to make various changes to the EBS.
This time, we're only changing the size, but if you change the volume type to "IO1," you'll also be able to change the Iops.

Once you've finished making changes, click "Modify."
A confirmation message will appear.
It will say that the process may affect performance and that you should allow the OS file system to recognize it.

Click "Yes" to begin changing the settings.
This time, it took about 10 minutes to complete.
Make the instance aware of the expanded volume area
Once you've made the changes, the next step is to have the OS recognize it!
Check the physical disk with lsblk. It's growing properly!!
[root@beyond ~]# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT xvda 202:0 0 40G 0 disk mqxvda1 202:1 0 30G 0 part /
But the root partition is still 30GB.
Let's expand it with the growpart command.
[root@beyond ~]# growpart /dev/xvda 1 CHANGED: disk=/dev/xvda partition=1: start=4096 old: size=62910430,end=62914526 new: size=83881950,end=83886046
The file system is not yet expandable
[root@beyond ~]# df -h Filesystem Size Used Avail Use% Mounted on /dev/xvda1 30G 24G 5.5G 82% /devtmpfs 992M 56K 992M 1% /dev tmpfs 1002M 0 1002M 0% /dev/shm
Resize the file system with the resize2fs command
[root@beyond ~]# resize2fs /dev/xvda1 resize2fs 1.42.12 (29-Aug-2014) Filesystem at /dev/xvda1 is mounted on /; on-line resizing required old_desc_blocks = 2, new_desc_blocks = 3 The filesystem on /dev/xvda1 is now 10485243 (4k) blocks long.
And guess what?! It was perfectly recognized without even a single reboot!! AWS is amazing!!!
[root@beyond ~]# df -h Filesystem Size Used Avail Use% Mounted on /dev/xvda1 40G 24G 16G 61% /devtmpfs 992M 56K 992M 1% /dev tmpfs 1002M 0 1002M 0% /dev/shm
supplement
If you get this error, you may have forgotten to run the growpart command when expanding the root volume.
That's what happened to me...
[root@beyond ~]# resize2fs /dev/xvda resize2fs 1.42.12 (29-Aug-2014) resize2fs: Device or resource busy while trying to open /dev/xvda Couldn't find valid filesystem superblock.
Conclusion
What did you think? I personally think this EBS update is a big hit as it is a great update that will greatly increase the flexibility of initial construction and operation.
If you are too busy to keep up with the increasingly convenient AWS information, you can leave it all to Beyond
0