I have created a new CentOS Linux instance. I had selected 50 GB of root volume during creating of instance but when system comes online it was showing only 8 GB of disk is usable. I tried to resize root disk using resize2fs, I get the following message
So, I have following below steps and able to successfully resize volume to its full size selected during instance creation
Step 1. Take Backups
We strongly recommended to take full backup (AMI) of your instance before doing any changes. Also create a snapshot of root disk.
Step 2. Check Current Partitioning
Now check the disk partitioning using following command. You can see that /dev/xvda is 53.7 GB in size.
Step 3. Increase Size of Volume
Now start with the disk re partitioning using set of following commands. Execute all the commands carefully.
Now change the display units to sectors using u switch.
Now print the partition table to check for disk details
Now delete the first partition using following command.
Now create a new partition using following commands. For the first sector enter 2048 (as shows in above command output) and for last second just press enter to select all partition.
Print the partition table again. You will see that new partition has occupied all disk space.
Now set the bootable flag on partition 1.
Write disk partition permanently and exit.
Lets reboot your system after making all above changes.
Step 4. Verify Upgraded Disk
At this point your root volume has been resized successfully. Just verify your disk has been resizes properly.
Cheers$s$s guyZZZZ…. Yuppie…… Done!!!
OK, folks that’s it for this post. Have a nice day guys…… Stay tuned…..!!!!!
Don’t forget to like & share this post on social networks!!! I will keep on updating this blog. Please do follow!!!