Ubuntu 18.04 (AWS) ext4 FS

Here’s how to add a new Volume to an existing ec2 and make it available for your Linux OS.

After on AWS you attach a volume to an ec2 instance, do the following to insert it into your filesystem

lsblk

is needed to get your device id like /dev/xvdf

mkfs.ext4 /dev/xvdf
mkdir /mnt2
mount /dev/xvdf /mnt2

Don’t forget to alter your /etc/fstab to make this change persistent

LABEL=cloudimg-rootfs    /    ext4   defaults,discard    0 0
/dev/xvdb /mnt ext4 defaults 0 0
/dev/xvdf /mnt2 ext4 defaults 0 0

If you need to resize your volume simply do so on the aws console and wait for the resize to finish. Then to make the new space usable, do

resize2fs /dev/xvdf

Leave a Reply

Your email address will not be published.