Diskpart

From Omnia
Revision as of 22:17, 17 May 2019 by Kenneth (talk | contribs) (Created page with "== Commands == * DiskPart Command-Line Options (Windows Embedded Standard 7 Service Pack 1) - http://msdn.microsoft.com/en-us/library/ff794606%28v=winembedded.60%29.aspx * DI...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Commands

list:

DISK        - Display a list of disks. For example, LIST DISK.
PARTITION   - Display a list of partitions on the selected disk.
              For example, LIST PARTITION.
VOLUME      - Display a list of volumes. For example, LIST VOLUME.
VDISK       - Displays a list of virtual disks.

help:

ACTIVE      - Mark the selected partition as active.
ADD         - Add a mirror to a simple volume.
ASSIGN      - Assign a drive letter or mount point to the selected volume.
ATTRIBUTES  - Manipulate volume or disk attributes.
ATTACH      - Attaches a virtual disk file.
AUTOMOUNT   - Enable and disable automatic mounting of basic volumes.
BREAK       - Break a mirror set.
CLEAN       - Clear the configuration information, or all information, off the
              disk.
COMPACT     - Attempts to reduce the physical size of the file.
CONVERT     - Convert between different disk formats.
CREATE      - Create a volume, partition or virtual disk.
DELETE      - Delete an object.
DETAIL      - Provide details about an object.
DETACH      - Detaches a virtual disk file.
EXIT        - Exit DiskPart.
EXTEND      - Extend a volume.
EXPAND      - Expands the maximum size available on a virtual disk.
FILESYSTEMS - Display current and supported file systems on the volume.
FORMAT      - Format the volume or partition.
GPT         - Assign attributes to the selected GPT partition.
HELP        - Display a list of commands.
IMPORT      - Import a disk group.
INACTIVE    - Mark the selected partition as inactive.
LIST        - Display a list of objects.
MERGE       - Merges a child disk with its parents.
ONLINE      - Online an object that is currently marked as offline.
OFFLINE     - Offline an object that is currently marked as online.
RECOVER     - Refreshes the state of all disks in the selected pack.
              Attempts recovery on disks in the invalid pack, and
              resynchronizes mirrored volumes and RAID5 volumes
              that have stale plex or parity data.
REM         - Does nothing. This is used to comment scripts.
REMOVE      - Remove a drive letter or mount point assignment.
REPAIR      - Repair a RAID-5 volume with a failed member.
RESCAN      - Rescan the computer looking for disks and volumes.
RETAIN      - Place a retained partition under a simple volume.
SAN         - Display or set the SAN policy for the currently booted OS.
SELECT      - Shift the focus to an object.
SETID       - Change the partition type.
SHRINK      - Reduce the size of the selected volume.
UNIQUEID    - Displays or sets the GUID partition table (GPT) identifier or
              master boot record (MBR) signature of a disk.

Create standard partition

diskpart
list disk
rem  # DO NOT SELECT DISK 0
select disk 1
clean
create partition primary
list part
format fs=fat32 label="Data" quick
rem # for full disk - format fs fat32 quick
exit
DISKPART
LIST DISK
SELECT DISK 1
CLEAN
CREATE PARTITION PRIMARY
SELECT PARTITION 1
ACTIVE
FORMAT /Q FS=NTFS
ASSIGN
EXIT

Create a GUID Partition Table Partition on a Raw Disk

To create a GPT partition on a raw disk by using the Diskpart utility:

  1. At a command prompt, type: diskpart to start the Diskpart utility: "Diskpart version 0.0" is displayed as well as a Diskpart prompt.
  2. At the prompt, type: list to list the mounted hard drive volumes.
  3. At the prompt, type: select x (where x is the number of the hard disk drive that you want to convert to GPT). The following information is displayed: "Selected Disk = x".
  4. At the prompt, type: new gpt to add the GPT information into the non-volatile RAM (NVRAM).
    • NOTE: This step does not create the GPT partition information.
  5. At the prompt, type: create name="efi system partition" type=efisys Size=102 to create the Extensible Firmware Interface (EFI) partition.
    • NOTE: The name can be anything you want, but if the name has spaces in it, the name must have quotes around it. The type must equal either Efisys, Msres, or Msdata. If a size is not specified, the partition uses the remaining unpartitioned space. To install Windows XP, the Msdata partition must contain at least 2 gigabytes (GB) of free space.
  6. At the prompt, type: create name="microsoft reserved" type=msres Size=31 to create the MSR partition.
  7. At the prompt, type: create name="basic data" type=msdata to create a partition for the remaining unpartitioned space.
  8. At the prompt, type: inspect to display the partition information.
  9. At the prompt, type: exit to quit the Diskpart utility.
diskpart
list disk
REM  # DO NOT SELECT DISK 0:
select disk 1
clean
convert gpt
create partition primary
list part
select partition 1
format fs=fat32 label="EFI_1" quick
REM # note: not required, but you can specify drive letter: "assign letter=s"
assign
exit

You can create an official EFI partition, but this does not work on a USB drive:

create partition efi size=100

References:

keywords