- Alright so now let's run through a demo
of mounting an EBS volume to an existing Linux EC2 instance.
From the Amazon web services console,
I'm gonna go back to EC2.
I'm gonna go to my volumes.
This is where we're gonna choose this particular volume.
It doesn't really matter which one.
For the sake of this demo, we're gonna
choose the provisioned iops volume.
I'm going to click attach volume.
I'm going to choose the Linux server.
I'm going to mount it at devsdf.
Of course we could go from sdf through devsdp.
I'm gonna go ahead and hit attach.
We'll see that now the volume is labeled as in use.
But down here the attachment says
that it's currently attaching.
So we're waiting for it to become fully attached.
We can hit the refresh button.
Now we see that the volume is attached.
I'm going to open an SSH shell into that instance.
From here I'm going to list the block devices that I have.
You can see here that here is our root volume
with our partition on slash.
Then xvdf is how it got renamed.
We actually mounted it, or attached it, within the console
as sdf but the operating system
renamed it to xvdf and that's okay.
So you can see we have the 100 gig volume
and it just a disk.
We don't have a partition on that yet.
From here I'm going to format this...
As ext4 and I'm going to use /dev/xvdf,
and there we go.
Just like that, super easy.
We were able to format that with ext4.
Now I want to create a mount point.
I'm going to create a folder called,
let me make sure that we have that /mnt/data.
So that's gonna be our mount point.
Now I want to mount the volume to that mount point.
So I'm gonna say sudo mount /dev/xvdf
will be mounted to /mount/data.
Now if I were to do a df,
we can see now that /mount data is mounted
to the devxvdf device.
We have just about 100 gigs available.
So that is mounting an EBS volume to a Linux instance.