Skip to content

Instantly share code, notes, and snippets.

@saginadir
Last active February 25, 2016 10:15
Show Gist options
  • Save saginadir/682656bfa1304d933e80 to your computer and use it in GitHub Desktop.
Save saginadir/682656bfa1304d933e80 to your computer and use it in GitHub Desktop.
Attache new EBS to instance after it was created

Attach EBS To Instance AWS Amazon

Quicky!

Step 1

Create Volume using AWS and attach it to instance

Step 2

  • ssh to the server
  • Run the following commands
sudo su - root
lsblk
sudo file -s /dev/xvdf 
mkfs -t ext4 /dev/xvdf # will format the volume
sudo mkdir /data # create new folder for volume
sudo mount /dev/xvdf /data
cp /etc/fstab /etc/fstab.backup
echo "/dev/xvdf   /data  ext4  defaults,nofail  0  2" >> /etc/fstab
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment