Lab Exercise 2: Attaching AWS EBS VOLUME TO AMAZON EC2
Hi all today I am share my experience on how to attach a EBS volume to an EC2 machine following are the pre-requisites required to attach an EBS volume
- An EC2 Linux instance
Steps followed are as follows
- At first to attach an EBS volume we have to create one so to create a volume head over to ec2 service from navigation pane
- Next choose volumes and on choose create volume
3. Create a volume as per your needs and also ensure that the created volume is in the same region as that of ec2 instance created
4. Now again from volumes tab right click on the newly created volume and attach it to the ec2 instance that have been previously created
5. Now head over to Putty (I am using windows) and connect to ec2 instance remotely(In case of any doubts ref to my previous blog)
6. After that type the following commands as given below to mount the attached volume with the instance
7. First list the available disks using the following command
lsblk
8. Check if the volume has any data using the following command.
sudo file -s /dev/xvdf
If the above command output shows “/dev/xvdf: data
“, it means your volume is empty.
9. Format the volume to the ext4
filesystem using the following command.
sudo mkfs -t ext4 /dev/xvdf
newvolume
“. You can name it something meaningful to you.cd
into newvolume
directory and check the disk space to validate the volume mount.cd /newvolume
df -h .
newvolume
directory.
Comments
Post a Comment