0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

IBM Cloud: VSI for VPCで250GB以上を利用している場合のCドライブの拡張方法

0
Posted at

1. はじめに

sdp profileがサポートされることにより、250GB以上のboot diskもサポートされるようになりました。 試しに1500GBで注文したサーバーが以下の通り。

  • 注文時のBoot Volumeの構成(1500GB)image.png

でも、、、

  • あれ、1500GBはどこに行った?image.png
  • Cドライブは100GBしか認識していない。その後ろは割り当てされていない領域や、Dドライブやリカバリー領域など、混在している。image.png

Cドライブを拡張しようとしても、後ろにDドライブやリカバリー領域があるため、Windowsの標準機能ではそのままでは拡張できません(3rd Partyツールであればサポートしているものもあるようです)。正直綺麗とは言い難い構成です。なお、DドライブはUEFIブートのための領域のようです。単体のイメージでBIOS/MBRとUEFI/GPTをサポートするためにこういう構成になっているのでしょう。

なんじゃこりゃ!?って思ったら、以下のようなdocsの記述と手順がありました。どうやらDドライブやRecovery領域は削除し、Cドライブを拡張した後に、再度Recovery領域を作成すれば良いようです。しかし、このdocsの通りやってもRecovery領域を回復できないので、事前にRecovery領域をコピーしておくといったアレンジをしてみました。
https://cloud.ibm.com/docs/vpc?topic=vpc-troubleshooting-unexpandable-c-drive

方針は以下の通りです。

  • Dドライブを削除(sdp profileを使っている場合、本稿執筆時点ではBIOS/MBRで起動してきている。少なくとも2TB以内であればUEFI/GPTにする必要はない。将来的にsecure bootなどがサポートされるようになったらまた再考が必要だが、少なくとも本稿執筆時点ではsdp profileではsecure bootはサポートされていない。)
  • Recovery Partitionをバックアップをしておき、Cドライブを広げた後に、再構築

2. 拡張手順

Recovery領域の確認
PS C:\> reagentc /info
Windows Recovery Environment (Windows RE) and system reset configuration
Information:

    Windows RE status:         Enabled
    Windows RE location:       \\?\GLOBALROOT\device\harddisk0\partition4\Recovery\WindowsRE
    Boot Configuration Data (BCD) identifier: 31a07952-4143-11f0-9c1d-0800277b2ea2
    Recovery image location:
    Recovery image index:      0
    Custom image location:
    Custom image index:        0

REAGENTC.EXE: Operation Successful.s
DISK構成の確認
PS C:\> Get-Disk | sort Number | ft -Auto

Number Friendly Name      Serial Number                        HealthStatus OperationalStatus Total Size Partition Style
------ -------------      -------------                        ------------ ----------------- ---------- ---------------
0      Red Hat VirtIO     02e7-32b820fe-8db2-4                 Healthy      Online               1.46 TB MBR
1      Red Hat VirtIO     cloud-init-                          Healthy      Online                 44 KB RAW
2      QEMU QEMU HARDDISK cloud-init-02e7_5058d21c-c282-4b80-9 Healthy      Online                380 KB RAW

PS C:\> diskpart

Microsoft DiskPart version 10.0.26100.1150

Copyright (C) Microsoft Corporation.
On computer: SYASUDA-WIN25

DISKPART> list disk

  Disk ###  Status         Size     Free     Dyn  Gpt
  --------  -------------  -------  -------  ---  ---
  Disk 0    Online         1500 GB      0 B
  Disk 1    Online           44 KB    44 KB
  Disk 2    Online          380 KB   380 KB

DISKPART> select disk 0

Disk 0 is now the selected disk.

DISKPART> list volume

  Volume ###  Ltr  Label        Fs     Type        Size     Status     Info
  ----------  ---  -----------  -----  ----------  -------  ---------  --------
  Volume 0                      NTFS   Partition    100 MB  Healthy    System
  Volume 1     C                NTFS   Partition     98 GB  Healthy    Boot
  Volume 2     D                FAT32  Partition    200 MB  Healthy
  Volume 3         Windows RE   NTFS   Partition    887 MB  Healthy    Hidden

DISKPART> list partition

  Partition ###  Type              Size     Offset
  -------------  ----------------  -------  -------
  Partition 1    Primary            100 MB  1024 KB
  Partition 2    Primary             98 GB   101 MB
  Partition 3    Primary            200 MB    98 GB
  Partition 4    Recovery           887 MB    99 GB
Recovery領域にDrive Letter Rを割り当てる
DISKPART> select partition 4

Partition 4 is now the selected partition.

DISKPART> assign Letter=R

DiskPart successfully assigned the drive letter or mount point.

DISKPART> list volume

  Volume ###  Ltr  Label        Fs     Type        Size     Status     Info
  ----------  ---  -----------  -----  ----------  -------  ---------  --------
  Volume 0                      NTFS   Partition    100 MB  Healthy    System
  Volume 1     C                NTFS   Partition     98 GB  Healthy    Boot
  Volume 2     D                FAT32  Partition    200 MB  Healthy
* Volume 3     R   Windows RE   NTFS   Partition    887 MB  Healthy    Hidden

DISKPART> exit

リカバリー領域のコピー

PS C:\> mkdir C:\backup


    Directory: C:\


Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d-----          6/5/2026   4:03 AM                backup


PS C:\> mkdir C:\backup\WindowsRE


    Directory: C:\backup


Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d-----          6/5/2026   4:03 AM                WindowsRE


PS C:\> robocopy R:\Recovery\WindowsRE C:\backup\WindowsRE /E /COPYALL /R:1 /W:1

-------------------------------------------------------------------------------
   ROBOCOPY     ::     Robust File Copy for Windows
-------------------------------------------------------------------------------

  Started : Friday, June 5, 2026 4:04:04 AM
   Source : R:\Recovery\WindowsRE\
     Dest : C:\backup\WindowsRE\

    Files : *.*

  Options : *.* /S /E /COPYALL /R:1 /W:1

------------------------------------------------------------------------------

                           4    R:\Recovery\WindowsRE\
100%        New File               3.0 m        boot.sdi
100%        New File                1155        ReAgent.xml
            New File                   0        SrSettings.ini
100%        New File             659.5 m        winre.wim

------------------------------------------------------------------------------

               Total    Copied   Skipped  Mismatch    FAILED    Extras
    Dirs :         1         0         1         0         0         0
   Files :         4         4         0         0         0         0
   Bytes :  662.56 m  662.56 m         0         0         0         0
   Times :   0:00:09   0:00:09                       0:00:00   0:00:00


   Speed :           73,386,382 Bytes/sec.
   Speed :            4,199.203 MegaBytes/min.
   Ended : Friday, June 5, 2026 4:04:14 AM

PS C:\> dir C:\backup\WindowsRE -Force


    Directory: C:\backup\WindowsRE


Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
---hs-          4/1/2024   2:00 AM        3170304 boot.sdi
---hs-          6/5/2026   3:34 AM           1155 ReAgent.xml
---hs-        10/14/2025  11:11 PM              0 SrSettings.ini
---hs-         5/15/2026   6:25 AM      691577427 winre.wim
Recovery 領域の無効化
PS C:\> reagentc /disable
REAGENTC.EXE: Operation Successful.

PS C:\> reagentc /info
Windows Recovery Environment (Windows RE) and system reset configuration
Information:

    Windows RE status:         Disabled
    Windows RE location:
    Boot Configuration Data (BCD) identifier: 00000000-0000-0000-0000-000000000000
    Recovery image location:
    Recovery image index:      0
    Custom image location:
    Custom image index:        0

REAGENTC.EXE: Operation Successful.

PS C:\> reagentc /info
Windows Recovery Environment (Windows RE) and system reset configuration
Information:

    Windows RE status:         Enabled
    Windows RE location:       \\?\GLOBALROOT\device\harddisk0\partition4\Recovery\WindowsRE
    Boot Configuration Data (BCD) identifier: 31a07952-4143-11f0-9c1d-0800277b2ea2
    Recovery image location:
    Recovery image index:      0
    Custom image location:
    Custom image index:        0

REAGENTC.EXE: Operation Successful.
パーティション4(リカバリー領域の削除)
PS C:\> diskpart

Microsoft DiskPart version 10.0.26100.1150

Copyright (C) Microsoft Corporation.
On computer: SYASUDA-WIN25

DISKPART> select disk 0

Disk 0 is now the selected disk.

DISKPART> list partition

  Partition ###  Type              Size     Offset
  -------------  ----------------  -------  -------
  Partition 1    Primary            100 MB  1024 KB
  Partition 2    Primary             98 GB   101 MB
  Partition 3    Primary            200 MB    98 GB
  Partition 4    Recovery           887 MB    99 GB

DISKPART> select partition 4

Partition 4 is now the selected partition.

DISKPART> delete partition override

DiskPart successfully deleted the selected partition.
パーティション3(Dドライブ)の削除
DISKPART> select partition 3

Partition 3 is now the selected partition.

DISKPART> delete partition override

DiskPart successfully deleted the selected partition.

DISKPART> list partition

  Partition ###  Type              Size     Offset
  -------------  ----------------  -------  -------
  Partition 1    Primary            100 MB  1024 KB
  Partition 2    Primary             98 GB   101 MB
Cドライブ(パーティション2)の拡張
DISKPART> select partition 2

Partition 2 is now the selected partition.

DISKPART> extend

DiskPart successfully extended the volume.

DISKPART> list partition

  Partition ###  Type              Size     Offset
  -------------  ----------------  -------  -------
  Partition 1    Primary            100 MB  1024 KB
* Partition 2    Primary           1499 GB   101 MB

DISKPART> list volume

  Volume ###  Ltr  Label        Fs     Type        Size     Status     Info
  ----------  ---  -----------  -----  ----------  -------  ---------  --------
  Volume 0                      NTFS   Partition    100 MB  Healthy    System
* Volume 1     C                NTFS   Partition   1499 GB  Healthy    Boot
Cドライブから1000MB割り当ててRecovery領域を作成
DISKPART> shrink minimum=1000

DiskPart successfully shrunk the volume by: 1000 MB

DISKPART> create partition primary

DiskPart succeeded in creating the specified partition.

DISKPART> format quick fs=ntfs label=Recovery

  100 percent completed

DiskPart successfully formatted the volume.

DISKPART> set id=27

DiskPart successfully set the partition ID.

DISKPART> list partition

  Partition ###  Type              Size     Offset
  -------------  ----------------  -------  -------
  Partition 1    Primary            100 MB  1024 KB
  Partition 2    Primary           1498 GB   101 MB
* Partition 3    Recovery          1000 MB  1499 GB

DISKPART> list volume

  Volume ###  Ltr  Label        Fs     Type        Size     Status     Info
  ----------  ---  -----------  -----  ----------  -------  ---------  --------
  Volume 0                      NTFS   Partition    100 MB  Healthy    System
  Volume 1     C                NTFS   Partition   1498 GB  Healthy    Boot
* Volume 2         Recovery     NTFS   Partition   1000 MB  Healthy    Hidden
Drive Letter Rを割り当ててリストアを実施
DISKPART> assign letter=R

DiskPart successfully assigned the drive letter or mount point.

DISKPART> list volume

  Volume ###  Ltr  Label        Fs     Type        Size     Status     Info
  ----------  ---  -----------  -----  ----------  -------  ---------  --------
  Volume 0                      NTFS   Partition    100 MB  Healthy    System
  Volume 1     C                NTFS   Partition   1498 GB  Healthy    Boot
* Volume 2     R   Recovery     NTFS   Partition   1000 MB  Healthy    Hidden

DISKPART> exit

PS C:\> robocopy C:\backup\WindowsRE R:\Recovery\WindowsRE /E /COPYALL /R:1 /W:1

-------------------------------------------------------------------------------
   ROBOCOPY     ::     Robust File Copy for Windows
-------------------------------------------------------------------------------

  Started : Friday, June 5, 2026 4:17:01 AM
   Source : C:\backup\WindowsRE\
     Dest : R:\Recovery\WindowsRE\

    Files : *.*

  Options : *.* /S /E /COPYALL /R:1 /W:1

------------------------------------------------------------------------------

          New Dir          4    C:\backup\WindowsRE\
100%        New File               3.0 m        boot.sdi
100%        New File                1155        ReAgent.xml
            New File                   0        SrSettings.ini
100%        New File             659.5 m        winre.wim

------------------------------------------------------------------------------

               Total    Copied   Skipped  Mismatch    FAILED    Extras
    Dirs :         1         1         0         0         0         0
   Files :         4         4         0         0         0         0
   Bytes :  662.56 m  662.56 m         0         0         0         0
   Times :   0:00:10   0:00:10                       0:00:00   0:00:00


   Speed :           69,363,906 Bytes/sec.
   Speed :            3,969.035 MegaBytes/min.
   Ended : Friday, June 5, 2026 4:17:11 AM

PS C:\> dir R:\Recovery\WindowsRE -force


    Directory: R:\Recovery\WindowsRE


Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
---hs-          4/1/2024   2:00 AM        3170304 boot.sdi
---hs-          6/5/2026   3:34 AM           1155 ReAgent.xml
---hs-        10/14/2025  11:11 PM              0 SrSettings.ini
---hs-         5/15/2026   6:25 AM      691577427 winre.wim

PS C:\> reagentc /setreimage /path R:\Recovery\WindowsRE
Directory set to: \\?\GLOBALROOT\device\harddisk0\partition3\Recovery\WindowsRE

REAGENTC.EXE: Operation Successful.

PS C:\> reagentc /enable
REAGENTC.EXE: Operation Successful.

PS C:\> reagentc /info
Windows Recovery Environment (Windows RE) and system reset configuration
Information:

    Windows RE status:         Enabled
    Windows RE location:       \\?\GLOBALROOT\device\harddisk0\partition3\Recovery\WindowsRE
    Boot Configuration Data (BCD) identifier: 31a07954-4143-11f0-9c1d-0800277b2ea2
    Recovery image location:
    Recovery image index:      0
    Custom image location:
    Custom image index:        0

REAGENTC.EXE: Operation Successful.
Dirve Letterを削除
PS C:\> diskpart

Microsoft DiskPart version 10.0.26100.1150

Copyright (C) Microsoft Corporation.
On computer: SYASUDA-WIN25

DISKPART> list disk

  Disk ###  Status         Size     Free     Dyn  Gpt
  --------  -------------  -------  -------  ---  ---
  Disk 0    Online         1500 GB      0 B
  Disk 1    Online           44 KB    44 KB
  Disk 2    Online          380 KB   380 KB

DISKPART> select disk 0

Disk 0 is now the selected disk.

DISKPART> list volume

  Volume ###  Ltr  Label        Fs     Type        Size     Status     Info
  ----------  ---  -----------  -----  ----------  -------  ---------  --------
  Volume 0                      NTFS   Partition    100 MB  Healthy    System
  Volume 1     C                NTFS   Partition   1498 GB  Healthy    Boot
  Volume 2     R   Recovery     NTFS   Partition   1000 MB  Healthy    Hidden

DISKPART> list partition

  Partition ###  Type              Size     Offset
  -------------  ----------------  -------  -------
  Partition 1    Primary            100 MB  1024 KB
  Partition 2    Primary           1498 GB   101 MB
  Partition 3    Recovery          1000 MB  1499 GB

DISKPART> select partition 3

Partition 3 is now the selected partition.

DISKPART> remove letter=R

DiskPart successfully removed the drive letter or mount point.

DISKPART> list volume

  Volume ###  Ltr  Label        Fs     Type        Size     Status     Info
  ----------  ---  -----------  -----  ----------  -------  ---------  --------
  Volume 0                      NTFS   Partition    100 MB  Healthy    System
  Volume 1     C                NTFS   Partition   1498 GB  Healthy    Boot
* Volume 2         Recovery     NTFS   Partition   1000 MB  Healthy    Hidden

DISKPART> exit

Leaving DiskPart...

3. 最終完成系

Cドライブが拡張され、その一番最後にRecovery領域が作成されている。
image.png

4. Recovery領域の動作確認

次回起動時にRecovery領域を使ってBoot
PS C:\> reagentc /boottore
REAGENTC.EXE:  Operation Successful.
再起動
PS C:\> shudown /r /t 0

VNCコンソールでRecoveryモードになっていることを確認
image.png

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?