DEV Community

Cover image for Optimizing Your AWS EC2 Windows Instance: A Comprehensive Guide to Extending Root Volumes and Adding Extra Storage
Shamim Ansari
Shamim Ansari

Posted on

Optimizing Your AWS EC2 Windows Instance: A Comprehensive Guide to Extending Root Volumes and Adding Extra Storage

Extending the root volume of an EC2 Windows instance and attaching an additional volume is a multi-step process. Here's a step-by-step guide to achieve this:

Step 1: Launch an EC2 Windows Instance

  • Log in to the AWS Management Console.

aws console

  • Navigate to the EC2 Dashboard.

  • Click "Launch Instance" to create a new EC2 instance.

  • Choose a Windows AMI (Amazon Machine Image) and select an instance type.

  • In the "Add Storage" section, configure the root volume size according to your requirements.

  • Complete the instance launch wizard, including security group and key pair settings.

  • Launch the instance.

ec2

Step 2: Connect to the EC2 Instance

  • Once the instance is running, right-click it in the EC2 Dashboard, and select "Connect."

ec2-connect

  • Follow the instructions to connect to the instance using Remote Desktop Protocol (RDP).

remote-server-desktop

Step 3: Extend the Root Volume

  • Inside the EC2 Windows instance, open the "Disk Management" utility under Computer Management.

Disk Management

  • Locate the root volume, which is typically labeled as "C:." and you can see current storage as 30 GB (We will try to extend this volume)

drive C

  • Go to AWS console -> Volume -> Select volume -> Click on action -> 'Modify Volume' and change it to 40 GB

volume

  • Go to EC2 Windows instance, open the "Disk Management" utility under Computer Management.

Note: You can see in the snip as total 40 GB online out of which 10 GB Unallocated

disk

  • Right-click on disk and choose 'Extend Volume'

Validation:

  • You can see extended volume in below snip

extended disk

extended disk2

Step 4: Attach an Additional EBS Volume

  • In the AWS Console, navigate to the EC2 Dashboard and click on "Volumes" in the left navigation pane.

volume

  • Create a new EBS volume with the desired size (e.g., 30GB). Note the availability zone.

  • Back in the EC2 Dashboard, stop the Windows instance to attach the new volume.

stopped instance

  • Go to Volume and select it and choose 'Attache Volume' from 'Action'

  • Select instance ID & Create Volume

  • Back in the EC2 Dashboard

  • Start the instance.

  • Connect to the instance using RDP.

  • Open the "Disk Management" utility.

  • You will see the new volume listed. Initialize it and format it as needed.

extra volume

Step 5: Validate the Configuration

  • In Windows Explorer, verify that the root volume (C:) has been extended with the additional space.

file explore

  • Create and modify files on the extra volume to ensure it is functioning correctly.

  • You can also check the disk sizes and available space in the "File Explorer" or use the "Get-Volume" PowerShell command.

Big big congratulation for completing this hands on LAB

Don't forget to do cleanup of all these AWS services which can lead to extra charges

Follow me on Linkedin | Twitter for more such contents and Check out my Services

Top comments (0)