Another way How to Extend a Windows Partition on OpenStack Instance

### Environment
– OpenStack Newton (KVM)
– Instance OS Windows Server 2012 R2
– Disk = 1TB [C:] 200GB [D:] 800GB
– Add Disk 1TB to [D:] Partition

### Compute OpenStack

cd /var/lib/nova/instance/a1b2c3e4f5gxxxxxx
qemu-img create -f qcow2 disk-new.qcow2 2040G
virt-resize disk disk-new.qcow2 --expand /dev/sda2
[root@openstack a1b2c3e4f5gxxxxxx]# virt-resize disk disk-new.qcow2 --expand /dev/sda2

Output:

[   0.0] Examining disk
**********

Summary of changes:

/dev/sda1: This partition will be left alone.

/dev/sda2: This partition will be resized from 824.0G to 1840.0G.

**********
[   3.8] Setting up initial partition table on disk-new.qcow2
[   4.0] Copying /dev/sda1
 100% ⟦▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒⟧ 00:00
[ 865.4] Copying /dev/sda2
100% ⟦▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒⟧ 00:00
Resize operation completed with no errors.  Before deleting the old disk,
carefully check that the resized disk boots and works correctly.
[root@openstack a1b2c3e4f5gxxxxxx]# cp -v disk-new.qcow2 disk

### Windows Powel Shell

C:\>chkdsk D:
C:\>diskpart 
DISKPART> list volume 
DISKPART> select volume 1 
DISKPART> extend filesystem

DiskPart successfully extended the file system on the volume.
DISKPART> list volume

  Volume ###  Ltr  Label        Fs     Type        Size     Status     Info
  ----------  ---  -----------  -----  ----------  -------  ---------  --------
  Volume 0     C   WINSRV2012R  NTFS   Partition    200 GB  Healthy    System
  Volume 1     D   DATA         NTFS   Partition   1839 GB  Healthy
DISKPART> exit

Refrensi: https://support.microsoft.com/en-us/help/832316/the-partition-size-is-extended-but-the-file-system-remains-the-origina

Comments