Let’s see the steps to add EBS Volume to Ubuntu EC2 Instance. Bobcares, as a part of our AWS Support Services, offers solutions to every query that comes our way.
Adding EBS Volume to Ubuntu EC2 Instance
Amazon EBS is an easy-to-use, high-performance block storage at any scale. For a variety of apps, Amazon EBS offers a variety of volume types. It allows us to optimize storage performance and cost. These volume types can be divided into two main groups: HDD-backed storage and SSD-backed storage.
The price for HDD-backed storage is $0.045/GB-month. And the price for SSD-backed storage is $0.125/GB-month.
What is an Amazon EBS–optimized EC2 instance?
An EBS-optimized EC2 instance uses an optimized configuration stack. It also provides additional, dedicated capacity for Amazon EBS I/O. This optimization provides the best performance for the EBS volumes by minimizing contention between Amazon EBS I/O and other traffic from the instance.
EBS-optimized instances provide Amazon EBS with dedicated bandwidth. We can use the EBSIOBalance%
and EBSByteBalance%
metrics to help us determine whether the instances are sized correctly.
Steps to Add EBS Volume to Ubuntu EC2 Instance
Here we need to mount /var into a new partition.
- Firstly create a new volume and leave the snapshot id empty.
- Then we must name the new volume [var-vol].
- Now attach the volume to an instance by right-clicking on volume/attach and choosing the EC2 instance.
- We must now format the instance. We can use an ssh terminal for this purpose.
mkfs.ext4 /dev/xvdv
- Mount the volume to the file system.
mkdir -m 000 /mnt/var.vol echo "/dev/xvdv /mnt/var.vol auto noatime 0 0" >> /etc/fstab mount /mnt/var.vol
- Then we should stop all the possible processes.
service --status-all |grep + to see what is running
- Then sync
/var
to/mnt/var.vol
using the below code.rsync -va /var/ /mnt/var.vol
- Also, change the name from
/var
into/var.old
.mv /var /var.old
- Now create a new var directory.
mkdir /var
- Then bind-mount the new
var.vol
to the new-empty/var
directory just created.mount -o bind /mnt/var.vol /var
- Now update
/etc/fstab
to make bind-mount permanent.echo "/mnt/var.vol /var none bind" >> /etc/fstab
- Finally, reboot the system to apply the changes.
[Looking for a solution to another issue? We’re available 24/7.]
Conclusion
In this post, we provide the steps to add EBS VOLUME to the Ubuntu EC2 Instance, along with a detailed description of the EBS-optimized EC2 instance.
PREVENT YOUR SERVER FROM CRASHING!
Never again lose customers to poor server speed! Let us help you.
Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.
var google_conversion_label = "owonCMyG5nEQ0aD71QM";
0 Comments