This topic describes how to extend the partitions and file systems of a disk on a Windows Elastic Compute Service (ECS) instance.
Scenario
After you resize a disk in the ECS console, the file systems of the partitions on the disk also need to be extended. You must connect to the ECS instance to extend the file systems of the disk. In this topic, two methods are provided to extend partitions: Use the incremental capacity of the disk to extend an existing partition or create additional partitions.
In this example, a Windows Server 2012 R2 64-bit public image is used and the disk is resized from 40 GB to 60 GB within the instance. Operations vary based on actual scenarios.
Prerequisites
A disk of the instance is resized in the ECS console. For more information, see Step 1: Resize a disk to extend its capacity.
(Recommended) A snapshot of the disk is created to back up disk data. For more information, see Create a snapshot of a disk.
NoteIn most cases, extending partitions and file systems does not cause data loss. To prevent data loss or exceptions caused by accidental operations, we recommend that you create snapshots to back up disk data.
The Windows instance meets the following requirements:
The instance does not run Windows Server 2003 images.
The version of the Red Hat virtio-scsi driver is later than 58011. For more information, see Update Red Hat virtio drivers of Windows instances.
Step 1: Check whether the partitions of a disk need to be converted
If the disk does not exceed 2 TiB in size or if the disk uses the GUID Partition Table (GPT) partition style, skip this step.
If the disk is larger than 2 TiB in size and uses the master boot record (MBR) partition style, convert the partition style to GPT and extend the partitions and file systems of the disk. For more information, see Convert a data disk on a Windows instance from MBR to GPT and Step 2: Extend partitions and file systems.
Step 2: Extend partitions and file systems
Extend an existing partition and file system
This section describes how to add incremental storage capacity to an existing partition to resize the system disk within an ECS instance. In this example, the system disk (C drive) is used.
Connect to the ECS instance.
For more information, see Connect to a Windows instance by using a password or key.
On the Windows Server desktop, right-click the
icon and select Disk Management.
In the Disk Management dialog box, choose to view the unallocated disk capacity.
The following figure shows that the Disk 0 (C:) is the system disk and Disk 1 (D:) is a data disk.
Right-click the blank space in the disk (such as Disk 0) section and select Extend Volume...
NoteIf you want to resize a data disk, right-click the blank space in the data disk (such as Disk 1) section. If a disk has multiple partitions, we recommend that you extend the partition that is adjacent to the left of an unallocated partition. Otherwise, Windows converts the selected basic disk into a dynamic disk.
Extend the volume as instructed in Extend Volume Wizard.
After you extend the partition, the incremental storage capacity is automatically added to the C drive. The following figure shows that the C drive has 60 GB of available capacity.
After you extend file systems, check whether the file system sizes are the same as the specified values.
If the file system sizes are increased to the specified values and business applications on the instance can run as expected, the file systems are extended.
If the file system sizes are not increased to the specified values, use the snapshots that you created to roll back the disk. For more information, see Roll back a disk by using a snapshot.
Create an additional partition
This section describes how to create an additional partition for a data disk to allocate the incremental storage capacity within an ECS instance. In this example, the E drive is used.
Connect to the ECS instance.
For more information, see Connect to a Windows instance by using a password or key.
On the Windows Server desktop, right-click the
icon and select Disk Management.
In the Disk Management dialog box, choose to view the unallocated disk capacity.
The following figure shows that the Disk 0 (C:) is the system disk and Disk 1 (D:) is a data disk.
Right-click the blank space in the unallocated section of Disk 1 and select New Simple Volume...
Extend the volume as instructed in New Simple Volume Wizard.
After you create the E drive to allocate the incremental storage capacity, the E drive has 20 GB of available capacity.
After you extend file systems, check whether the file system sizes are the same as the specified values.
If the file system sizes are increased to the specified values and business applications on the instance can run as expected, the file systems are extended.
If the file system sizes are not increased to the specified values, use the snapshots that you created to roll back the disk. For more information, see Roll back a disk by using a snapshot.