- Check the volume is attached to your instance
- Format it as a filesystem
- Mount it to a path
- Check the mounting was successful
Some kinds of EC2 Instances only support EBS datastores. If you plan on using one of these, you will need to format the volume (so it can be used as a filesystem) and them mount it to a path in your system.
Before mounting, you need to create an EBS volume and attach it to your instance. Then it will be available for mounting.
Check the volume is attached to your instance
$ sudo lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT xvda 202:0 0 8G 0 disk `-xvda1 202:1 0 8G 0 part / xvdb 202:16 0 80G 0 disk /data
in my case, the volume name is
xvfb. It might be different in your case
Format it as a filesystem
$ sudo mkfs -t ext4 /dev/xvfb
xvfb with you own volume name in case it's different
Only if it's an empty EBS Volume! Skip this step if your volume already has data in it.
Mount it to a path
$ sudo mkdir /data $ sudo mount /dev/xvfb /data
Check the mounting was successful
$ sudo df -h /data Filesystem Size Used Avail Use% Mounted on /dev/xvdb 79G 21G 54G 29% /data
The volume is only mounted until the end of your session. You can redo the last step after reboot (your data will be there).