Skip to content

How to Connect EBS Volume to AWS Instance

Nir edited this page Jul 27, 2016 · 13 revisions

How to add EBS volume using AWS GUI

This wiki describe how to add EBS to an instance and copy the data between instances

  1. Create EBS volume using AWS GUI - make sure to notice the availability zone.
  2. Attach the EBS volume to the instance using GUI
  3. SSH to the instance
  4. Run lsblk to see available mount disks

$ lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNT POINT xvda1 202:80 0 10G 0 disk xvdf 202:1 0 8G 0 disk

Here the EBS is 8GB size

  1. Run $ sudo file -s /dev/xvdf /dev/xvdf: data - meaning that there is no file system on the EBS
  2. Run $ sudo mkfs -t xfs device_name For example $ sudo mkfs -t xfs /dev/xvdf
  3. Create new folder $ mkdir <your_folder> $ mkdir scylla_data
  4. Mount the new directory $ mount /dev/xvdf scylla_folder
  5. Run all the needed commands: copy / delete etc
  6. Once done, umout is needed for the mounted folder $ umount scylla_folder
  7. Go to AWS GUI
  8. Detach the EBS (right click on the volume), Wait till the volume become available (it may take some time)
  9. Attach the EBS volume to the instance that you want to work with (it may take some time)
  10. Run lsblk to see available mount disks $ lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNT POINT xvda1 202:80 0 10G 0 disk xvdm 202:1 0 8G 0 disk
  11. Create new folder
  12. $ mkdir new_scylla_data
  13. Mount the EBS volume to the new folder that you created $ mount /dev/xvdm new_scylla_data

EBS Location US East (N. Virginia)

https://console.aws.amazon.com/ec2/v2/home?region=us-east-1#Volumes:search=bench;sort=tag:Name Volume name Benchmark_data - Don't delete Snapshot Benchmark_snap_dont_delete_25.7

Please take snapshots if you are doing any changes. Also deattach and attach are long process - make sure not to do hasty action (it can ruin the EBS - it happens to me one time on small volume).

Clone this wiki locally