Are you running low on Space (Storage) attached to your AWS Windows Server and looking for a solution that can scale the volume with zero downtime?
This article with give you a direct approach of expanding your Windows EC2 volume without having a downtime.
An EC2 Windows instance launched with an Amazon Machine Image (AMI) has a 30-GiB General Purpose SSD (gp2) root volume by default. You can expand the disk space of your EBS volume attached to your Windows EC2 instance by following these steps:
- Expand the EBS volume's size by through the Amazon EC2 console or the AWS Command Line Interface (AWS CLI).
- Extend the EBS volume's file system space at the operating system level with Disk Management or PowerShell. Expand the EBS volume's size Use the Amazon EC2 console or the AWS CLI to expand the size of your EBS volume. Use the EC2 console to expand the EBS volume
- Open the EC2 console.
- In the navigation pane, choose Instances, and then select your instance.
- Choose the Storage tab, and then select your volume.
- In the Volumes pane, select the check box for the volume you want to expand.
- From Actions, choose Modify volume.
- Under Volume details, enter the Size and IOPS based on the volume type.
- Choose Modify, and then choose Modify in the dialog box.
- In the Volumes pane, see the volume's optimizing progress under Volume state. Refresh the Volumes pane to see progress updates.
- When the Volume state shows that the volume is optimizing, you can extend the EBS volume's file system.
Extend the file system after resizing an EBS volume using Powershell. To extend a file system using PowerShell
- Before extending a file system that contains valuable data, it is a best practice to create a snapshot of the volume that contains it in case you need to roll back your changes. For more information, see Create Amazon EBS snapshots.
- Log in to your Windows instance using Remote Desktop.
- Run PowerShell as an administrator.
- Run the Get-Partition command. PowerShell returns the corresponding partition number for each partition, the drive letter, offset, size, and type. Note the drive letter of the partition to extend.
- Run the following command to rescan the disk. "rescan" | diskpart Run the following command, using the drive letter you noted in step 4 in place of . PowerShell returns the minimum and maximum size of the partition allowed, in bytes. Get-PartitionSupportedSize -DriveLetter To extend the partition to the maximum available size, run the following command. Resize-Partition -DriveLetter -Size $(Get-PartitionSupportedSize -DriveLetter ).SizeMax
The following PowerShell commands show the complete command and response flow for extending a file system to the maximum available size.
Top comments (0)