

Here, the defaults,nobootwait section is very important. The fourth section is the options for the mount. If you didn’t format this volume previously it would crate problems for OS when it tried to load in your volume from this file. This is where you specify the file system type or device to be mounted. The second parameter specifies where to mount the volume to (/data) and is referred to as the dir field. The first parameter is the location of the volume (/dev/xvdf) and is referred to as the file_system field. I will break down the various components here. The entry is pretty easy to follow but may be confusing for those who are not familiar with how fstab works. dev/xvdf /data ext4 defaults,nobootwait 0 0 But if you want your mount to persist and to survive a reboot then you just add an entry to your /etc/fstab file to make sure the /data directory gets the volume mounted to it after a reboot. At this point it would be fine to be done if you just needed temporary access to the storage on this device. Here you will create the directory (if it doesn’t already exist) to mount the volume to and then mount it. If you need to resize the filesystem for whatever reason, you can use the resize2fs command. sudo mkfs.ext4 /dev/xvdfĪfter the volume has been formatted you can mount it to your OS. So use the following command to format it. In this instance I am formatting the disk as ext4. If you run fdisk -l you will notice that the device is empty, so you will need to format the disk.
EASYFIND FOR EXTERNAL VOLUMES UPDATE
Feel free to reach out if you are interested in the cli tool and I can update this post. It is probably easier but for the sake of time and illustration I am leaving those steps out. It is worth pointing out that all of the steps in the AWS console can alternatively be done with the aws-cli tool.

In this example I am choosing to attach the EBS volume as /dev/xvdf, but you could name it differently if it corresponds to your setup.Īfter the volume has been mounted you can check that it has been picked up by the OS by either checking the /dev directory or by running fdisk -l and looking for the size of the disk you just attached. This part is important because the changes could break your OS volume if you write to your fstab file incorrectly. In the AWS EC2 console choose the type of volume this will be (SSD or magnetic), availability zone, and any other options here.Īfter your volume has been created you will want to attach it to an instance. I’m sure there are other ways to accomplish this but I don’t think it is necessary to cover everything here.
EASYFIND FOR EXTERNAL VOLUMES HOW TO
There is good documentation for how to do this but there are a lot of separate steps so consolidating the components might be helpful to readers who stumble across this. So, having said that, I think it is probably worth writing a post about how to do it because it happens just enough that I have trouble getting everything straight, and I’m sure others run in to this as well, so that’s what I will be writing about today. Creating and attaching external volumes is one of those things in administration that is really nice to know how to do but for me is also one that doesn’t happen every day so it is really easy to forget how to do which makes it a little bit more painful, especially with deadlines and people watching over your shoulder.
