AWS EBS Tutorial: Create and Mount Encrypted EBS

Mount EBS on EC2

Create EBS, Mount it and EBS Encryption

In this tutorial i will show you how to create a new EBS, mount it on Linux system, learn what is EBS Encryption.

 

What is AWS EBS?

AWS EBS is a block storage which is very similar to normal drive that you attach to your server.

 

Create AWS EBS

  • Login to AWS Console.
  • Search for EC2 in the search bar.
  • Click on 'Volumes' under 'Elastic Block Store'
  • Select 'Create Volume'
  • Go through the wizard by choosing:
    • Volume type "which differ on transfer speed"
    • Size "from 1 GB to 16384 GB
    • IOPS "will be changing automatically based on size "based on 3 IOPS per GB"
    • Availability Zone "must be in the same availability zone of the sevrer to be attached"
    • Choose if encrypted or not

 

Mount AWS EBS on Linux Server

 

  • Attach EBS to desired server
    • Login to AWS Console.
    • Search for EC2 in the search bar.
    • Click on 'Volumes' under 'Elastic Block Store'
    • Right click desired EBS and select 'Attach Volume'
    • Choose the desired instance from 'Instance'
    • Leave Device as it is or change the device name if needed.
    • Select 'Attach'
  • Mount it on Linux
    • Connect to your Linux Instance
    • Run 'lsblk' to be sure that EBS was attached successfuly
      AWS EBS LSBLK
    • Create your own filesystem on this new block by running below command for EXT4
      mkfs -t ext4 /dev/xvdf
    • Confirm filesystem by running below command:
      file -s /dev/xvdf
    • Create folder to mount it to
      mkdir folderName
    • Mount the device
      mount /dev/xvdf /folderName
    • Confirm that mounting folder is pointed to EBS
    • To mount it permenantley use /etc/fstab and add the following
      /dev/xvdf /folderName ext4 defaults,nofail,0 0

 


Subscribe to
for video tutorials updates