DEV Community

Vakeesa
Vakeesa

Posted on

Add Disk in AWS-Ubuntu instance

How to add a disk in AWS instance

Step 1: Create a new volume from the AWS dashboard. See the image below.
Image description
Step 2: Open the Volume instance and set the region and size based on your needs
Image description
Step 3: Attach the volume(disk) with the Ubuntu instance.

Image description

Image description

Step 4: Check whether the new volume shows in the instance by using "lsblk" command.
Image description
step 5: Create a new directory to map the new disk using "mkdir" command. "mkdir /data"
step 6: check whether the file is already mounted using the below command "sudo file -s /dev/xvdf"(xvdfcan be a different name in different systems)
step 6: create a file system and make ext4 format.
"mkfs -t ext4 /dev/xvdf"
step 7: Mount the filesystem into the newly created directory
mount /dev/xvdf /data
step 8: make a entry in /etc/fstab to make the mount permanent
"nano /etc/fstab"
"/dev/xvdf /data ext4 defaults,nofail 0 2"

Top comments (0)