Partitioning a Windows drive?

I'd like to partition a hard drive with Windows installed on it (with bootcamp). I've tried using Disk Utility and GParted to do this, but unfortunately neither would let me. Are there any other programs I can use to partition the hard drive?


Solution 1:

A partition with a NTFS volume can be resized by booting to the Windows installation media. This can be in the form of a DVD, flash drive or partition on a drive. The type depends on the model/year of your Mac. The command to use is diskpart.

Update:

If you macOS is High Sierra or Mojave, you can make a bootable Windows USB flash drive by using any of methods outlined in this answer. I assume your Windows is installed to EFI boot. If not post a comment. I assume you know how to boot to the flash drive installer. If not post a comment.

If first window to appear after select to boot from the flash drive should be the same as the image shown below.

xx1

When the above window appears, press the shift+F10 keys. This will open a Command Prompt window.

If you are having problems with the Windows volume, you may want to try repairing with chkdsk. The command below checks drive C, but does not make repairs.

chkdsk c:

The command below will attempt repairs.

chkdsk c: /f

If you get the message shown below, then close and reopen the Command Prompt window. Try the command again.

Chkdsk cannot run because the volume is in use by another
process. Chkdsk may run if this volume is dismounted first.
Would you like to force to dismount on this volume? (Y/N)

You can also check the volume for physical defects in the sectors. If found, an attempt is made to mark the bad sectors as unusable. This type of checking takes a very very very long time to complete.

chkdsk c: /b

You can use the diskpart command to shrink the NTFS volume C:. After entering the command, you can get a list of all diskpart commands by entering help.

To get help for the shrink command enter the following.

help shrink

To see how small you can shrink volume C:, enter the following commands. If you get to small a value, then try booting to Windows and running the disk defragmenter.

select volume c
shrink querymax

To create a new 75 GB partition below volume C:, enter the following.

select volume c shrink desired=75000 create partition primary format fs=ntfs label="NewNTFS" quick

For ExFAT, substitute the following for the format command.

format fs=exfat label="NewExFAT" quick

If you want a FAT32 format, you probably will have to format with the macOS Disk Utility application.

When finished, close both windows.

Update 2

You can not enter all the commands on the same line. Entering the following will not work.

select volume c shrink desired=35000 create partition primary format fs=exfat label="NewExFat" quick

Instead enter the following

select volume c
shrink desired=35000
create partition primary
format fs=exfat label="NewExFat" quick

Below is an example where these commands are used.

Microsoft Windows [Version 10.0.17763.107]
(c) 2018 Microsoft Corporation. All rights reserved.

X:\Sources>diskpart

Microsoft DiskPart version 10.0.17763.1

Copyright (C) Microsoft Corporation.
On computer: MINWINPC

DISKPART> select volume c

Volume 1 is the selected volume.

DISKPART> shrink desired=35000

DiskPart successfully shrunk the volume by:   34 GB

DISKPART> create partition primary

DiskPart succeeded in creating the specified partition.

DISKPART> format fs=exfat label="NewExFat" quick

  100 percent completed

DiskPart successfully formatted the volume.

DISKPART> exit

Leaving DiskPart...

X:\Sources>

Let me know if you have any questions.