- Create & attach volume in AWS console (must be in same availability zone).
- From your ec2 instance, list attached volumes:
sudo fdisk -l
- Find the disk in the list and copy it's identifier to your clipboard, e.g.
- If it's a brand new volume, you probably need to format it:
Don't do this to a volume with data on it, or else it won't have data on it anymore. You can skip this step and come back to it if you get an error about
wrong fs typewhen trying to
For other available filesystem types, type
sudo mkfs.ext4 /dev/nvme1n1
mkfs.then tab-tab for autocomplete. See also Making an EBS Volume Available for use on Linux for more details, warnings, etc.
- Create an empty directory where you want to mount the volume, if it doesn't already exist:
- Mount the disk to that directory:
sudo mount /dev/nvme1n1 ~/extrastorage
- You probably need to give yourself permission to read & write from the mounted directory via some combination of the following:
In other words,
sudo chmod 775 ~/extrastorage sudo chown ubuntu ~/extrastorage sudo chgrp ubuntu ~/extrastorage
ls -g ~and then change the permissions to match the stuff you can access.
- You should now be able to access data on that volume as normal file structures nested under
Mount an EC2 volume