Hello, and welcome back to CS615 System Administration. In this video, we're going to quickly run through one of the recommended warmup exercises for Week 2. I'll show you how to do the basic exercise in the hope that this will set you on the right track to then explore the other questions and dive a bit deeper into the topic at hand. The exercise itself is intended to get you familiar with the concept of cloud storage, and to visualize how we can use Elastic Block Store volumes just as if they were hard drives that we plug into a physical system. So let's see how we do this... Let's start by creating two instances. In the easier example, you create two instances of the same OS, but later I'm going to ask you to try two different operating systems to illustrate the requirement for filesystem support. Then, we create a new volume and attach it to one of the instances. We create a filesystem on the new disk and mount it... ...and write a file to the filesystem. Then we can terminate the first instance. Now note that any files stored on the root filesystem of this instance are lost to us, as they are not persisted anywhere, but since we're looking at our custom volume here, we are then still able to attach this volume to the other instance now and then retrieve the files from the volume via the second instance. Pretty straight forward, right? But this gives you an opportunity to practice the commands relating to filesystems and disks. But I bet you picked your favorite operating system for this exercise. So why not make it a little bit harder on yourself and pick an OS that you're not as familiar with. You should find similarities, but some of the tools will behave differently or you may need to use different tools altogether. And next, the more interesting question is: can you do this with two instances that do not run the same OS? That is, can you mount a disk with a filesystem created on one OS on another OS? Let's give this a try... So let's start with a NetBSD instance... ...and an Ubuntu instance. Now to create a volume, I have another shell function to avoid me having to type too much. It's called "new-volume", and it takes two optional arguments. That is, if a first argument is given, it should be the size of the volume in gigabytes; if a second argument is given, it'd be the availability zone. If neither is specified, we default to a 1 gig volume in us-east-1a. There. Now we attach this volume to our NetBSD instance. This one up here. Next, we ssh into the instance... ...and look at the dmesg output for our disks. There we are, xbd0 as the root disk, xbd1 as the newly added disk. We use the 'disklabel' tool to look at the partition table, which is shown here as a default with a single partition spanning the whole disk. So let's create a new filesystem on this disk. We use the default UFS filesystem version 2... ...and mount it under /mnt. There we go. Next, we create a file on the filesystem. So we can now unmount the disk again and exit. We then detach the volume from the instance and unceremoniously terminate our running NetBSD instance. Now... let's see what the instance-id was of the Ubuntu instance we started... There it is. So let's now attach the volume to this instance... ...and ssh to that instance. Here we are. Let's use the 'lsblk' command to show the disks in uses here. And there it is. Now we mount this disk. But since this disk contains a filesystem that's not the standard filesystem on Ubuntu Linux, we have to specify that this is a UFS filesystem, and we want to also specify the version. The Linux kernel only supports UFS in read-only mode, so we specify that mount option, too. And there is the file we had previously created on our NetBSD instance. And there you have it - we successfully moved a volume from one EC2 instance of one OS to another instance of another OS and were able to access the files. As I said, please give this a try and make sure you understand all the commands used here. Then repeat the exercise using different operating systems and see if you can go the other way, creating a filesystem on, say, Linux, and mounting it on FreeBSD, for example. Some of the links here may be useful for you in the process. If you run into problems or have any questions, don't hesitate to ask on the mailing list or in our class Slack. Thanks for watching, and good luck!