1 00:00:06,705 --> 00:00:08,733 - Alright so now let's run through a demo 2 00:00:08,733 --> 00:00:12,900 of mounting an EBS volume to an existing Linux EC2 instance. 3 00:00:14,641 --> 00:00:17,255 From the Amazon web services console, 4 00:00:17,255 --> 00:00:19,338 I'm gonna go back to EC2. 5 00:00:20,792 --> 00:00:23,611 I'm gonna go to my volumes. 6 00:00:23,611 --> 00:00:26,151 This is where we're gonna choose this particular volume. 7 00:00:26,151 --> 00:00:27,821 It doesn't really matter which one. 8 00:00:27,821 --> 00:00:29,381 For the sake of this demo, we're gonna 9 00:00:29,381 --> 00:00:31,802 choose the provisioned iops volume. 10 00:00:31,802 --> 00:00:34,723 I'm going to click attach volume. 11 00:00:34,723 --> 00:00:38,151 I'm going to choose the Linux server. 12 00:00:38,151 --> 00:00:40,818 I'm going to mount it at devsdf. 13 00:00:43,041 --> 00:00:47,362 Of course we could go from sdf through devsdp. 14 00:00:47,362 --> 00:00:50,851 I'm gonna go ahead and hit attach. 15 00:00:50,851 --> 00:00:55,781 We'll see that now the volume is labeled as in use. 16 00:00:55,781 --> 00:00:58,232 But down here the attachment says 17 00:00:58,232 --> 00:01:00,121 that it's currently attaching. 18 00:01:00,121 --> 00:01:02,851 So we're waiting for it to become fully attached. 19 00:01:02,851 --> 00:01:04,548 We can hit the refresh button. 20 00:01:04,548 --> 00:01:08,296 Now we see that the volume is attached. 21 00:01:08,296 --> 00:01:12,463 I'm going to open an SSH shell into that instance. 22 00:01:15,356 --> 00:01:19,770 From here I'm going to list the block devices that I have. 23 00:01:19,770 --> 00:01:23,626 You can see here that here is our root volume 24 00:01:23,626 --> 00:01:26,326 with our partition on slash. 25 00:01:26,326 --> 00:01:29,347 Then xvdf is how it got renamed. 26 00:01:29,347 --> 00:01:32,736 We actually mounted it, or attached it, within the console 27 00:01:32,736 --> 00:01:35,136 as sdf but the operating system 28 00:01:35,136 --> 00:01:38,146 renamed it to xvdf and that's okay. 29 00:01:38,146 --> 00:01:40,346 So you can see we have the 100 gig volume 30 00:01:40,346 --> 00:01:41,777 and it just a disk. 31 00:01:41,777 --> 00:01:45,246 We don't have a partition on that yet. 32 00:01:45,246 --> 00:01:48,329 From here I'm going to format this... 33 00:01:52,036 --> 00:01:56,203 As ext4 and I'm going to use /dev/xvdf, 34 00:02:01,596 --> 00:02:03,307 and there we go. 35 00:02:03,307 --> 00:02:05,106 Just like that, super easy. 36 00:02:05,106 --> 00:02:08,477 We were able to format that with ext4. 37 00:02:08,477 --> 00:02:11,166 Now I want to create a mount point. 38 00:02:11,166 --> 00:02:14,626 I'm going to create a folder called, 39 00:02:14,626 --> 00:02:18,793 let me make sure that we have that /mnt/data. 40 00:02:22,836 --> 00:02:24,866 So that's gonna be our mount point. 41 00:02:24,866 --> 00:02:28,516 Now I want to mount the volume to that mount point. 42 00:02:28,516 --> 00:02:32,683 So I'm gonna say sudo mount /dev/xvdf 43 00:02:38,016 --> 00:02:42,346 will be mounted to /mount/data. 44 00:02:42,346 --> 00:02:44,429 Now if I were to do a df, 45 00:02:45,386 --> 00:02:49,553 we can see now that /mount data is mounted 46 00:02:50,736 --> 00:02:52,569 to the devxvdf device. 47 00:02:53,947 --> 00:02:57,867 We have just about 100 gigs available. 48 00:02:57,867 --> 00:03:02,034 So that is mounting an EBS volume to a Linux instance.