Use DiskPart to Create the OS Partition on Clean Install.

Page 1 of 2 12 LastLast

  1. Posts : 18,044
    Win 10 Pro 64-bit v1909 - Build 18363 Custom ISO Install
       #1

    Use DiskPart to Create the OS Partition on Clean Install.


    I have a Laptop HDD [ my preferred option as opposed to an SSD on this Laptop ] arriving on Friday and I want to use DiskPart to Setup the size of the OS Partition. The main reason I want to do it this way is because DiskPart can create an exact 30 GB Partition [ my OCD ] for example. Here are the steps that I tried the other day which did NOT work . . .

    • Boot from the install USB.
    • On the Windows Installation Screen press Shift + F10.
    • diskpart
    • list disk
    • select disk 0
    • clean
    • create partition primary size=30000
    • exit
    • exit

    I intend to leave assign AND format fs=ntfs for Windows to perform as normal during the installation.

    Thanks.
      My Computer


  2. Posts : 4,595
    several
       #2

    If you are using windows setup, you would be better creating the partitioning that setup is happy with.

    If your example above is for mbr, mark the 30gb partition active.

    For gpt, you could use diskpart to create at least the esp partition as well as your 30gb.
      My Computer


  3. Posts : 18,044
    Win 10 Pro 64-bit v1909 - Build 18363 Custom ISO Install
    Thread Starter
       #3

    SIW2 said:
    If you are using windows setup, you would be better creating the partitioning that setup is happy with.

    If your example above is for mbr, mark the 30gb partition active.

    For gpt, you could use diskpart to create at least the esp partition as well as your 30gb

    Yes, it is MBR.
      My Computer


  4. Posts : 4,595
    several
       #4

    In that case format the 30gb and mark it active. Otherwise setup will do its own thing.
      My Computer


  5. Posts : 18,044
    Win 10 Pro 64-bit v1909 - Build 18363 Custom ISO Install
    Thread Starter
       #5

    Like this . . .

    • diskpart
    • list disk
    • select disk 0
    • clean
    • create partition primary size=30000
    • Active
    • format fs=ntfs
    • exit
    • exit
      My Computer


  6. Posts : 7,607
    Windows 10 Home 20H2
       #6

    Code:
    Microsoft Windows [Version 10.0.19042.746]
    (c) 2020 Microsoft Corporation. All rights reserved.
    
    C:\Windows\system32>DiskPart
    
    Microsoft DiskPart version 10.0.19041.610
    
    Copyright (C) Microsoft Corporation.
    On computer: DESKTOP
    
    DISKPART> List Disk
    
      Disk ###  Status         Size     Free     Dyn  Gpt
      --------  -------------  -------  -------  ---  ---
      Disk 0    Online          465 GB      0 B        *
      Disk 1    Online           60 GB      0 B
      Disk 2    Online         7388 MB      0 B
      Disk 3    No Media           0 B      0 B
      Disk 4    Online           28 GB      0 B
    
    DISKPART> Select Disk 1
    
    Disk 1 is now the selected disk.
    
    DISKPART> Clean
    
    DiskPart succeeded in cleaning the disk.
    
    DISKPART> Convert MBR
    
    DiskPart successfully converted the selected disk to MBR format.
    
    DISKPART> Create partition primary size=30000
    
    DiskPart succeeded in creating the specified partition.
    
    DISKPART> Active
    
    DiskPart marked the current partition as active.
    
    DISKPART> Detail Disk
    
    MI XMUP01QM USB Device
    Disk ID: 0EBAC1E0
    Type   : USB
    Status : Online
    Path   : 0
    Target : 0
    LUN ID : 0
    Location Path : UNAVAILABLE
    Current Read-only State : No
    Read-only  : No
    Boot Disk  : No
    Pagefile Disk  : No
    Hibernation File Disk  : No
    Crashdump Disk  : No
    Clustered Disk  : No
    
      Volume ###  Ltr  Label        Fs     Type        Size     Status     Info
      ----------  ---  -----------  -----  ----------  -------  ---------  --------
    * Volume 5     T                RAW    Removable     29 GB  Healthy
    
    DISKPART> List partition
    
      Partition ###  Type              Size     Offset
      -------------  ----------------  -------  -------
    * Partition 1    Primary             29 GB  1024 KB
    
    DISKPART>
    Use DiskPart to Create the OS Partition on Clean Install.-disk-1.jpg
      My Computer


  7. Posts : 18,044
    Win 10 Pro 64-bit v1909 - Build 18363 Custom ISO Install
    Thread Starter
       #7

    Matthew Wai said:
    Code:
    Microsoft Windows [Version 10.0.19042.746]
    (c) 2020 Microsoft Corporation. All rights reserved.
    
    C:\Windows\system32>DiskPart
    
    Microsoft DiskPart version 10.0.19041.610
    
    Copyright (C) Microsoft Corporation.
    On computer: DESKTOP
    
    DISKPART> List Disk
    
      Disk ###  Status         Size     Free     Dyn  Gpt
      --------  -------------  -------  -------  ---  ---
      Disk 0    Online          465 GB      0 B        *
      Disk 1    Online           60 GB      0 B
      Disk 2    Online         7388 MB      0 B
      Disk 3    No Media           0 B      0 B
      Disk 4    Online           28 GB      0 B
    
    DISKPART> Select Disk 1
    
    Disk 1 is now the selected disk.
    
    DISKPART> Clean
    
    DiskPart succeeded in cleaning the disk.
    
    DISKPART> Convert MBR
    
    DiskPart successfully converted the selected disk to MBR format.
    
    DISKPART> Create partition primary size=30000
    
    DiskPart succeeded in creating the specified partition.
    
    DISKPART> Active
    
    DiskPart marked the current partition as active.
    
    DISKPART> Detail Disk
    
    MI XMUP01QM USB Device
    Disk ID: 0EBAC1E0
    Type   : USB
    Status : Online
    Path   : 0
    Target : 0
    LUN ID : 0
    Location Path : UNAVAILABLE
    Current Read-only State : No
    Read-only  : No
    Boot Disk  : No
    Pagefile Disk  : No
    Hibernation File Disk  : No
    Crashdump Disk  : No
    Clustered Disk  : No
    
      Volume ###  Ltr  Label        Fs     Type        Size     Status     Info
      ----------  ---  -----------  -----  ----------  -------  ---------  --------
    * Volume 5     T                RAW    Removable     29 GB  Healthy
    
    DISKPART> List partition
    
      Partition ###  Type              Size     Offset
      -------------  ----------------  -------  -------
    * Partition 1    Primary             29 GB  1024 KB
    
    DISKPART>
    Use DiskPart to Create the OS Partition on Clean Install.-disk-1.jpg
    Brilliant, thanks Matthew.

    What would the MBs be then to get EXACTLY 30 GBs?
    Something like 30480 MBs?
      My Computer


  8. Posts : 7,607
    Windows 10 Home 20H2
       #8

    Paul Black said:
    Brilliant, thanks Matthew.

    What would the MBs be then to get EXACTLY 30 GBs?
    Something like 30480 MBs?
    1024 ✖ 30 =30720

    BTW, the USB device shown in my above post contained three files, all of which have been recovered by DiskGenius from the RAW partition.
      My Computer


  9. Posts : 18,044
    Win 10 Pro 64-bit v1909 - Build 18363 Custom ISO Install
    Thread Starter
       #9

    Matthew Wai said:
    1024 ✖ 30 =30720

    BTW, the USB device shown in my above post contained three files, all of which have been recovered by DiskGenius from the RAW partition.

    OK, thanks.

    I wondered why it was NOT exactly 30 GBs. I think there are two standards for this, one being Decimal and the other being Binary.

    I found this => GB to MB Conversion

    From your above post, DiskPart uses Decimal then.

    If DiskPart uses Binary, then the answer is 30000 MB.
    If DiskPart uses Decimal, then the answer is 30720 MB.

    Is there nothing else to Add for the Reserved / Recovery Partition?
      My Computer


  10. Posts : 7,607
    Windows 10 Home 20H2
       #10

    The following refers to my GPT hard disk.

    Code:
    DISKPART> list partition
    
      Partition ###  Type              Size     Offset
      -------------  ----------------  -------  -------
      Partition 1    System             100 MB  1024 KB
      Partition 2    Reserved            16 MB   101 MB
      Partition 3    Primary             80 GB   117 MB
      Partition 4    Recovery           499 MB    80 GB
      Partition 5    Primary            384 GB    81 GB
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 18:08.
Find Us




Windows 10 Forums