Creating and mounting an EBS volume to a Windows Amazon EC2 Instance

If you’re reading this post you probably already know about Amazon Elastic Block Store, aka Amazon EBS, one of the many services provided by the Amazon Web Services (AWS) ecosystem.

An EBS volume can range from 1GB to 1TB and can be mounted to an Amazon EC2 instance as a device, each EBS volume can be mounted to one instance but multiple volumes can be mounted to the same instance. To mount an EBS volume to an instance you have to first log into the AWS Management Console and follow a few simple steps.

Creating a new volume

1. Once inside the AWS Management Console, click the Volumes link under Elastic Block Store in the Navigation panel:image

2. Click the ‘Create Volume‘ button:

image

3. In the pop-up form, choose the size of the EBS volume you want to create and select the availability zone (remember, the EBS volume needs to be in the same availability zone as the instance it needs to be attached to):

image

Click “Create” to create a new EBS volume.

Attaching an EBS Volume to an Instance

1. Once the EBS volume is created and its status changed to ‘available’, select it, and click the “Attach Volume” button:

image

2. In the following pop-up, choose the instance you want to attach the volume:

image

Mount the EBS Volume as a drive

1. Now that the EBS volume is attached to the instance, remote connect to the instance, go to Start –> Run, and enter “diskmgmt.msc” to start the Disk Management tool:

image

2. In the Disk Management tool, right click on the new disk, which is “Offline” right now and bring it “Online“:

image

3. The disk then needs to be initialized, right click again and select “Initialize Disk“:

image

4. Choose whether to initialize the disk with MBR or GPT:

image

5. You’re almost there! Right click on the unallocated space in the initialized disk and create a “New Simple Volume“:

image

and follow the steps in the wizard.

6. A 10GB volume will probably take 5 ~ 10 mins to format, and once it’s done you’ll be able to see the drive:

image

image

Parting thoughts…

As mentioned in Membase’s documentation here, when using an Amazon EC2 instance as a Membase cache server you can use an EBS volume to alleviate the risk of losing your data when an instance fails because the EBS volume can be attached to another instance to effectively restore the node.

Another fun fact about EBS and Amazon EC2 is that Windows 2008 instances are backed and run directly from an EBS volume because of the sheer size of the images themselves! Which is why for every Windows Server 2008 instance you are running you’ll find a 30GB EBS volume attached to that instance, and every AMI you create will have a matching EBS snapshot. And the implication of this is that, if you’re using a Windows instance to run Membase, you won’t need to create additional EBS volumes to store the Membase sqlite files. BUT, there’s a catch, if you terminate the instance manually or through a scaling down event the EBS volume will be deleted too, so be sure to take this into consideration when deriving your strategy for deploying and scaling your Membase cache clusters.

Liked this article? Support me on Patreon and get direct help from me via a private Slack channel or 1-2-1 mentoring.
Subscribe to my newsletter


Hi, I’m Yan. I’m an AWS Serverless Hero and the author of Production-Ready Serverless.

I specialise in rapidly transitioning teams to serverless and building production-ready services on AWS.

Are you struggling with serverless or need guidance on best practices? Do you want someone to review your architecture and help you avoid costly mistakes down the line? Whatever the case, I’m here to help.

Hire me.


Check out my new course, Complete Guide to AWS Step Functions. In this course, we’ll cover everything you need to know to use AWS Step Functions service effectively. Including basic concepts, HTTP and event triggers, activities, callbacks, nested workflows, design patterns and best practices.

Get Your Copy