Questions tagged [diskpart]

Diskpart is a scriptable Windows command-line tool which allows management of disk volumes including partitions and virtual disk (VHD/VHDX) files.

The Diskpart command allows command-line management of disk volumes including partitions and virtual disk (VHD/VHDX) files, both interactively and in a scripted fashion.

More information on the use of Diskpart can be found at http://support.microsoft.com/kb/300415.

51 questions
19
votes
2 answers

Is there any way to fix a corrupted LDM database?

TL;DR: Are there any tools/approaches to diagnosing and fixing LDM (Logical Disk Manager) metadata structures without recreating from scratch? Full description: I have two SSD drives set up with GPT + LDM (dynamic disk) in a state that seems…
Karol J. Piczak
  • 2,348
  • 1
  • 20
  • 22
8
votes
2 answers

Using Diskpart in a PowerShell script won't allow script to reuse drive letter

I built a script that mounts (attach) a VHD using Diskpart, cleans out some system files and then unmounts (detach) it. It uses a foreach loop and is suppose to clean multiple VHD using the same drive letter. However, after the 1st VHD it fails. …
Kyle
  • 121
  • 4
5
votes
1 answer

setting the 'hidden' attribute on a partion from Linux (parted) isnt respected by Windows?

when I set the 'hidden' flag on a GPT partition it's not respected by Windows 8.1 (Windows attempts to mound, throws UI, etc). However if I set the 'hidden' flag from diskpart.exe it is respected - are these two 'hiddens' different? how can I set…
stuck
  • 667
  • 2
  • 10
  • 23
5
votes
4 answers

command line for getting information about status of disk?

Here is the scenario, I have Windows Server 2003 and 2008 which is connected LUNs. I wanted to get status of the disk if disks are online or offline using command line. I'm trying to execute diskpart /s sample.txt and sample.txt contains SELECT…
4
votes
1 answer

Diskpart breaking drive letters after powershell script is run

I built a script that mounts (attach) a VHD using Diskpart, cleans out some system files and then unmounts (detach) it. It uses a foreach loop and is suppose to clean multiple VHD using the same drive letter. However, after the 1st VHD it fails. I…
Kyle
  • 121
  • 4
4
votes
4 answers

Resizing volume with DiskPart unsuccessful, while there's enough free space

I have a physical disk with two partitions, an old OS partition (with MBR) of 296GB and a RECOVERY partition of 2048MB (a default DELL recovery partition), both are not in use. I have successfully resized the OS partition from 296GB to 174GB with…
Abel
  • 1,007
  • 8
  • 20
  • 32
3
votes
0 answers

Windows Diskpart: How to select disk based on LUN ID

I have multiple LUNs attached to my Windows 2008 server from a SAN storage controller. Each LUN has a unique ID. However, it has no correlation to the disk number in the Windows. For example in the DiskPart utility I can see disk 1 has this property…
ARH
  • 131
  • 1
  • 3
3
votes
2 answers

Format disk with diskpart if not formatted

I'm trying to write a script to create and format a partition in Windows Server 2008R2. Now, when disk 1 is selected, I need to format it, only if it is not formatted already. This is what I have now: Run: diskpart /s script.txt Content of…
ccamacho
  • 203
  • 4
  • 10
2
votes
2 answers

Does `diskpart clean` send a TRIM command?

If I have a full SSD and clean it with diskpart clean, will the SSD controller receive a TRIM command (assuming I'm running in AHCI mode)? This would be crucial for performance or even healthiness of the SSD because otherwise it wouldn't know that…
TToni
  • 291
  • 2
  • 9
2
votes
2 answers

How to create a EFI partition using PowerShell?

I would like to automate a script that creates an EFI partition. Currently, one step is manual and requires to start DISKPART and execute these commands: create partition efi size=100 format fs=fat32 quick label=SYSTEM assign letter=S How can I…
SuperJMN
  • 151
  • 2
  • 9
2
votes
0 answers

Cannot recover from Windows Server Backup after expanded volume

I am running a Windows Server 2012 r2 instance on Hyper-v, I set up Windows Server Backup to run every night to incrementally back up a large folder. The folder sits on the same Virtual Hard Disc as the virtual server (Disk 0 : Volume C:) but the…
2
votes
1 answer

Copy EFI partition and BCD store to a second drive

I'm attempting to set up dynamic boot partition mirroring on GUID partition table (GPT) disks as part of making a bootable mirror of a Windows system drive. I am following Microsoft's KB951985 but I get stuck on the step which uses robocopy to copy…
travhue55
  • 21
  • 1
  • 2
2
votes
1 answer

Resizing partition with DiskPart using desired and minimum options is unsuccessful

I have a few systems I want to shrink the primary (and only) partition to about half of the disk and then create a new partition in the newly available space. The disks are 500GB. I want to script it, so I am using diskpart; however, I have issues…
Aaron
  • 21
  • 1
  • 2
2
votes
3 answers

what's the difference between a Volume and a Partition in Windows 7 diskpart

I was trying to follow the Intel guide for setting up iRST (Intel Rapid Start Technology) on my new laptop. The Intel manual says you need to create a *Volume that is as big or bigger than your available memory, set it to a specific id (id=84),…
user170232
  • 21
  • 1
  • 2
2
votes
4 answers

Extend disk with diskpart or Disk Management

I have a Win 2008 Server that won't let me extend a disk. I have used both the computer management and the diskpart tool and both tell me that I have less than 1MB free and can't extend. I show that I have 100GB of Unallocated space and 81.5gb…
jgardner04
  • 298
  • 2
  • 10
1
2 3 4