Tag: gpt

Windows Server 2019 USB Drive

Create a USB Drive for Windows Server 2019 Installation

This blog post covers how you can create a bootable USB media drive to install Windows Server 2019 on a physical server. This blog post will not use any third party tools, it only uses build in tools which you can find on Windows 10 or Windows Server. Depending on your system you will need it to install it on a BIOS system or a UEFI based system, which is slightly different since UEFI will use GPT disks and BIOS will use a MBR disk.

Getting ready to create a USB Drive for a Windows Server 2019 Installation

First you will need to have all prerequisites in place.

  • Download the Windows Server 2019 ISO File
  • A USB Drive with at least 8GB size



diskpart fat32 and gpt

How to create Windows Server bootable USB media for deployment on UEFI based systems

When you were create a USB media for PCs, notebooks and servers which were using BIOS you could use several tools to do this. Now most of the tools do not really create a USB media drive which can be used to boot and install Windows or Windows Server on a UEFI based system such a new servers and for example the Surface Pro line. But it is very simple to do this now, just follow this steps:

  • The USB drive has to be formatted in FAT32
  • The USB needs to be GPT and not MBR
  • Copy all files from the ISO to the USB drive

diskpart fat32 and gpt

PowerShell to create a Windows Server USB drive

This is it, and here is how you do it:

First plugin your USB drive to your computer. The USB drive should be bigger than 4GB.

Open a CMD prompt or PowerShell using the Run as Administrator option and open diskpart. Now you can do list all this by using

Select the USB disk, in my case this was disk 1

Clean the disk. Be careful this will remove all files and partitions on the USB media.

Now convert it to GPT

Create a new primary partition. But make sure the partition is not greater than 16GB otherwise it can be formatted with FAT32.

Format the partition with FAT32

Assign a drive letter to the volume

now you can exit the diskpart and copy all files from the Windows or Windows Server to the USB drive and boot it. This works with Windows 8, Windows 8.1, Windows 10, Windows Server 2012, Windows Server 2012 R2 and Windows Server 2016 or even Hyper-V Server in the same editions.

 



Replace Diskpart with Windows PowerShell – Basic Storage cmdlets

Windows Server 8

Last week I made a blog post about how you can create a USB drive for Windows To Go. In my post I used diskpart.exe to format the USB drive. Now we don’t live in the stone age anymore, so I did the same with the new version of Windows PowerShell coming in Windows 8 and Windows Server 8.

Now here some basic cmdlets to do some simple storage operations, like clean a disk, create a partition and so on.

Lets start simple

List all disks

get-disk

Now get all partitions

get-partition

Now get all partitions of disk 0

get-partitiondisk

Clear a Disk

clear-disk

Create a new partition

new-partition

Format this volume

format-volume

Create new partition and format it with the label “USB”:

format-volume1

Change driveletter

set-partition

Set a partition active

set-partition1

Remove a partition

remove-partition

Bring a disk online

Remove Readonly flag

Initialize Disk with GPT

online disk

This is some basic knowledge about the storage module in PowerShell v3. Lets see how we can change the commands from using diskpart to Windows PowerShell.

Diskpart.exe

PowerShell:

replace-diskpart



Cheatsheet: Using Diskpart on a Server Core installation #4

Using Diskpart on a Server Core installation. Disk Administration or Partition a disk.

Create a new partition and format a partition

SELECT DISK 0
CREATE PARTITION PRIMARY
ASSIGN LETTER=E
SELECT PARTITION 1
FORMAT FS=NTFS LABEL="New Volume" QUICK
EXIT

Commands you may then issue at the DISKPART prompt:

LIST Disk
LIST Partition
LIST Volume

SELECT Disk n
SELECT Volume n
SELECT Partition n

DETAIL Disk
DETAIL Partition
DETAIL volume

HELP
REM (remark/comment)
EXIT

Commands to Manage Basic Disks:

(set the current in-focus partition to be the system partition)

ASSIGN (allocate the next free drive letter)
ASSIGN LETTER=l (Choose a free letter)

CREATE PARTITION Primary Size=50000 (50 GB)
CREATE PARTITION Extended Size=25000
CREATE PARTITION logical Size=25000

DELETE Partition

EXTEND Size=10000

REMOVE letter=l (Remove drive letter l from the in-focus partition)
REMOVE /ALL (Remove ALL current drive letters and mount points)

Commands to Manage Dynamic Disks:

(set the current in-focus partition to be the system partition)

ASSIGN (allocate the next free drive letter)
ASSIGN LETTER=l (Choose a free letter)

ADD disk=n (Add a mirror to the in-focus SIMPLE volume on the specified disk.)

BREAK disk=n (Break the current in-focus mirror)

CREATE VOLUME Simple Size=n Disk=n
CREATE VOLUME Stripe Size=n Disk=n,n,...
CREATE VOLUME Raid Size=n Disk=n,n,...

DELETE DISK
DELETE PARTITION
DELETE VOLUME

EXTEND disk=n [Size=n]
IMPORT
ONLINE

REMOVE letter=l (Remove drive letter l from the in-focus volume)
REMOVE /ALL (Remove ALL current drive letters and mount points)
RETAIN

Commands to Convert Disks:

CONVERT mbr
CONVERT gpt
CONVERT dynamic
CONVERT basic

CLEAN ALL (remove all partition and volume info from the hard drive)
RESCAN