To attach an EBS volume to an instance using the consoleOpen the Amazon EC2 console at https://console.aws.amazon.com/ec2/ . In the navigation pane, choose Elastic Block Store, Volumes. Select an available volume and choose Actions, Attach Volume. For Instance, start typing the name or ID of the instance.
In Step 1: Choose an Amazon Machine Image (AMI), select the AMI to use and choose Select. Follow the wizard to complete Step 1: Choose an Amazon Machine Image (AMI), Step 2: Choose an Instance Type, and Step 3: Configure Instance Details. In Step 4: Add Storage, modify the existing entries as needed.
To mount an attached EBS volume on every system reboot, add an entry for the device to the /etc/fstab file. You can use the device name, such as /dev/xvdf , in /etc/fstab , but we recommend using the device's 128-bit universally unique identifier (UUID) instead.
Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/ . In the navigation pane, choose Instances. Select the instance. In the Description tab, for Block devices, select the block device mapping and then choose the EBS ID to view additional details for the volume.
Since this is a new volume, you need to format the EBS volume (block device) with a file system between step 1 and step 2. So the entire process with your sample mount point is:
Create EBS volume.
Attach EBS volume to /dev/sdf
(EC2's external name for this particular device number).
Format file system /dev/xvdf
(Ubuntu's internal name for this particular device number):
sudo mkfs.ext4 /dev/xvdf
Only format the file system if this is a new volume with no data on it. Formatting will make it difficult or impossible to retrieve any data that was on this volume previously.
Mount file system (with update to /etc/fstab so it stays mounted on reboot):
sudo mkdir -m 000 /vol
echo "/dev/xvdf /vol auto noatime 0 0" | sudo tee -a /etc/fstab
sudo mount /vol
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With