How to Add New Volume to AWS Instance

aws ec2

We are going to attach a new disk on a existing VM. Please do follow the below steps.

Click on

Services>>EC2-Instances>>Volumes>>Create Volume

Create Volume

Volumes>>Create Volume

Please choose appropriate parameter according to your requirement. Please, note Availablity Zone must be same for your Instance Zone which with you attach volume.

Attach Volume

Select Volume>>Actions>>Attach Volume

Here it asks for confirmation. Click on Attach button.

Login to AWS instance and type lsblk to check if a drive is initialized on OS.

# lsblsk

Here it shows xvdf (50GB) is available for a mount.

You can also fdisk -l command for same.

Mount your volume using below command.

# mkfs.ext4 /dev/xvdf

Create a new directory and mount a new volume with each.

# mkdir /test
# mount /dev/xvdf /test

Now check disk fragmentation.

# df -h

Add an entry in /etc/fstab for mounting it automatically after reboot.

# vim /etc/fstab

Add this line at the end of a file.

/dev/xvdf /test ext4 defaults,nofail 0

Save and Reboot system.

AmritMatti

I’m the owner of “DevOpsTechy.online” and been in the industry for almost 5 years. What I’ve noticed particularly about the industry is that it reacts slowly to the rapidly changing world of technology. I’ve done my best to introduce new technology into the community with the hopes that more technology can be utilized to serve our customers. I’m going to educate and at times demonstrate that technology can help businesses innovate and thrive. Throwing in a little bit of fun and entertainment couldn’t hurt right?

AmritMatti

I’m the owner of “DevOpsTechy.online” and been in the industry for almost 5 years. What I’ve noticed particularly about the industry is that it reacts slowly to the rapidly changing world of technology. I’ve done my best to introduce new technology into the community with the hopes that more technology can be utilized to serve our customers. I’m going to educate and at times demonstrate that technology can help businesses innovate and thrive. Throwing in a little bit of fun and entertainment couldn’t hurt right?

View all posts by AmritMatti →

Leave a Reply

Your email address will not be published. Required fields are marked *