Search Results

Search found 113 results on 5 pages for 'diskpart'.

Page 1/5 | 1 2 3 4 5  | Next Page >

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

    - by Kyle
    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 also noticed that when I try to manually attach a VHD with diskpart, diskpart succeeds, the Disk Manager shows the disk with the correct drive letter, but within the same PoSH instance I can not connect (set-location) to that drive. If I do a manual diskpart when I 1st open PoSH I can attach and detach all I want and I get the drive letter every time. Is there something I need to do to reset diskpart in the script? Here's a snippet of the script I'm using. function Mount-VHD { [CmdletBinding()] param ( [Parameter(Position=0,Mandatory=$true,ValueFromPipeline=$false)] [string]$Path, [Parameter(Position=1,Mandatory=$false,ValueFromPipeline=$false)] [string]$DL, [string]$DiskpartScript = "$env:SystemDrive\DiskpartScript.txt", [switch]$Rescan ) begin { function InvokeDiskpart { Diskpart.exe /s $DiskpartScript } ## Validate Operating System Version ## if (Get-WmiObject win32_OperatingSystem -Filter "Version < '6.1'") {throw "The script operation requires at least Windows 7 or Windows Server 2008 R2."} } process{ ## Diskpart Script Content ## Here-String statement purposefully not indented ## @" $(if ($Rescan) {'Rescan'}) Select VDisk File="$Path" `nAttach VDisk Exit "@ | Out-File -FilePath $DiskpartScript -Encoding ASCII -Force InvokeDiskpart Start-Sleep -Seconds 3 @" Select VDisk File="$Path"`nSelect partition 1 `nAssign Letter="$DL" Exit "@ | Out-File -FilePath $DiskpartScript -Encoding ASCII -Force InvokeDiskpart } end { Remove-Item -Path $DiskpartScript -Force ; "" Write-Host "The VHD ""$Path"" has been successfully mounted." ; "" } } function Dismount-VHD { [CmdletBinding()] param ( [Parameter(Position=0,Mandatory=$true,ValueFromPipeline=$false)] [string]$Path, [switch]$Remove, [switch]$NoConfirm, [string]$DiskpartScript = "$env:SystemDrive\DiskpartScript.txt", [switch]$Rescan ) begin { function InvokeDiskpart { Diskpart.exe /s $DiskpartScript } function RemoveVHD { switch ($NoConfirm) { $false { ## Prompt for confirmation to delete the VHD file ## "" ; Write-Warning "Are you sure you want to delete the file ""$Path""?" $Prompt = Read-Host "Type ""YES"" to continue or anything else to break" if ($Prompt -ceq 'YES') { Remove-Item -Path $Path -Force "" ; Write-Host "VHD ""$Path"" deleted!" ; "" } else { "" ; Write-Host "Script terminated without deleting the VHD file." ; "" } } $true { ## Confirmation prompt suppressed ## Remove-Item -Path $Path -Force "" ; Write-Host "VHD ""$Path"" deleted!" ; "" } } } ## Validate Operating System Version ## if (Get-WmiObject win32_OperatingSystem -Filter "Version < '6.1'") {throw "The script operation requires at least Windows 7 or Windows Server 2008 R2."} } process{ ## DiskPart Script Content ## Here-String statement purposefully not indented ## @" $(if ($Rescan) {'Rescan'}) Select VDisk File="$Path"`nDetach VDisk Exit "@ | Out-File -FilePath $DiskpartScript -Encoding ASCII -Force InvokeDiskpart Start-Sleep -Seconds 10 } end { if ($Remove) {RemoveVHD} Remove-Item -Path $DiskpartScript -Force ; "" } }

    Read the article

  • How long should diskpart take?

    - by sam
    I am using diskpart to extend a drive that is actually a VHD. I've already extended the VHD. It's on Windows 2003 and the C drive doesn't contain the swap file and the available space is contiguous. However didn't see the Note about the Resource Kit diskpart for download is not for Windows 2003. So I did the extend using the Windows 2000 version. Not sure if this is the reason but Diskpart is sitting there now for about 15 minutes or so and it's only gotta extend by 10GB. Should it be taking this long? Am I asking for trouble now that I've used a Windows 2000 version of diskpart on a Windows 2003 machine (VM)?

    Read the article

  • Format (remove) HDD volume that is visible in Windows 7 Disk Management but not diskpart.exe

    - by EntropyWins
    I'm trying to get iRST working on a SSD I installed in my lenovo u410. As part of that process, I created a hibernation partition and was fiddling around with RAID/AHCI settings. I managed to make my computer unbootable. No sweat, I just restored it with Lenovo's 1 key system. Now, however, I can't do anything with that hybernation partition! I can see it: (It's the 7.81 GB partition). But when I try to delete it in Diskpart.exe to reclaim the space and try the formatting again I only see this: I can't do anything with the partition in Disk Management either. Right clicking only shows the 'help' option. Can anyone suggest a way to edit these partitions with windows or, at least, reccomend a program that might help me fix this? Note, I'd rather not delete the 16 GB OEM partition that I believe holds the backup for this computer.

    Read the article

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

    - by user170232
    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), then go into the iRST tool and adjust some settings. Looking at the disk manager on the laptop, I see there is already a Partition labeled as "Hibernation Partition" which is a little bigger than the memory in my system. So it looks like iRST was already set up...BUT, it's a Partition, not a Volume. Here's what the manual says to do: (from: http://download.intel.com/support/motherboards/desktop/sb/rapid_start_technology_user_guide.pdf) diskpart list disk select disk x (where x is the disk to use, there's only one disk in this laptop) create partition primary size=X000 (where X000 is the size to create) detail disk (which lists details for the disk. This is where i get hung up) select volume Z (where Z is the *partition you created previously) ** it says the 'detail disk' command will list the volume #, but it doesn't. ** 'detail disk' only lists two "volumes" for Recovery and OS. ** if i do 'list partition', i see the 8 GB *partition labeled as "Hibernation Partition") ** so I can't continue with the following steps: set id=84 override exit The reason I went looking for the manual is because when iRST is enabled in the BIOS, the system won't resume from sleep. When it's disabled, it works fine, but the system goes into (legacy?) Hibernation mode and takes a while to come out of Hibernation. the iRST is supposed to resume from deep sleep very quickly. So, what's the difference between a Volume and a Partition? Should I delete the Hibernation Partition and create a Hibernation Volume? Anyone have any ideas? (if it matters, this is on a Dell XPS 13 with BIOS A08) Thanks! J

    Read the article

  • Win7 Install - diskpart shrink command

    - by chris
    I have an existing XP installation on a 160GB disk, with about 90 GB free. I'm trying to install Win7 on the same HDD, following directions from here. The question is: How long should it take to run the "shrink" command, given the above parameters? How much space will that free up for Win7?

    Read the article

  • Why does diskpart set the volume attributes on all volumes?

    - by Nick
    I was trying to migrate a Win7 OS from a HDD to a SSD. I've created 2 partition with 1024KB offset, with diskpart: 100MB System Reserved and a 60GB for C:. I've cloned their contents using Easeus Disk Copy. I've loaded the Windows 7 Boot DVD, and wanted to use diskpart to drop the letter for the System Reserved partition and make it hidden. select volume 0 detail volume attribute volume set nodefaultdriveletter attribute volume set hidden These 2 attribute set commands actioned on both volumes (0 and 1, MSR and C:) instead of the selected one, and viceversa. I've tried to clear these attributes from volume 1, but it cleared them also from volume 0. Why does DiskPart have this behaviour?

    Read the article

  • Cancelled a format using diskpart at 0%. Can I get the data back?

    - by Sudarshan
    I wanted to format my USB thumbdrive, but incorrectly did the following on my external HDD!! CMD -- Diskpart select disk 2 clean create partition primary select partition 1 active format fs=fat32 While it was still at 0% however, I cancelled the format and quit from CMD. I can no longer see the HDD in My computer though, and it shows up as below in diskpart Disk 1 Status - Online Size- 1800 GB Free - 0B Is there anything I can do to get the data and HDD back?

    Read the article

  • What do the readonly attributes in diskpart really mean?

    - by marzipan
    I am wondering exactly what the meaning is of the "Read-only" disk and volume attributes that you can twiddle in diskpart on Windows 7. I am trying to set up an external USB drive as an installation medium for my own software, so I'd like to protect it against casual or inadvertent changes by users who it is given to, so they don't screw up the installation files they might need in the future. From what I can tell by experimentation with diskpart, the volume read-only attribute is actually stored on the physical disk somewhere, because I can set it and it shows up when I take the drive to another machine. This is great because my users can't (easily) change any of the files on the volume, or format it from Windows explorer. However, the disk read-only attribute seems to be just an aspect of how the current machine is accessing the drive. When I set it I can no longer delete the volume in the disk via Disk Management, but when I take the drive to another machine, the attribute is no longer set and in Disk Management I can delete the volume on the disk. I guess I'm not that worried about my users doing that, but I am annoyed that I don't understand what these attributes are really doing. Another thing that I don't understand is that the "volume" read-only attribute actually seems to be global to the disk - if I have two volumes on the disk, and I set the readonly flag on one of them, then it gets set on the other one too. ?!? I have the feeling I'm not searching for the right docs - all I'm finding is diskpart docs that give the syntax for twiddling these attributes, not what they really mean. Any pointers would be very welcome! Thanks, Asa

    Read the article

  • Creating GPT partitions on EFI raw disk using diskpart

    - by kafka
    I've got a raw, blank GPT disk for use in a UEFI system. I need to create the partitions on it using diskpart. The only tutorial I've found so far is for diskpart.efi, which I believe is slightly different from the command-line diskpart. MS guide to GPT partitions with diskpart.efi Also the guide says to create a MSR of 32MB, but for a disk= 16GB I know it needs to be 128MB. I'm happy doing it with diskpart, just want to be sure I understand the fundamentals. I'm planning on installing, in this order: ESP partition, size 102 MB (create partition esp size=102) MSR partition, size 128 MB (create partition msr size=128) data partition, the remaining space (approx 460GB) Is this the correct thing to do, or is there anything I'm missing?

    Read the article

  • Unable to format disk: 'The system cannot find the file specified'

    - by ACarter
    I have a USB flash drive, which I may have mucked up, so I used DISKPART's CLEAN to clean it up. I created a simple volume, and tried to format it. (This is all using Windows' disk management.) I was told The system cannot find the file specified. So I tried using DISKPART (as an admin): DISKPART select volume 9 Volume 9 is the selected volume. DISKPART format recommended DiskPart has encountered an error: The system cannot find the file specified. See the System Event Log for more information. DISKPART As you can see, no luck. When I plug the drive in, the computer makes a beep noise as though it has recognised something, but nothing appears in My Computer How can I format the disk so I can use it again?

    Read the article

  • Cannot reactivate RAID-5 volume: The size of the plex member is invalid

    - by Ian Boyd
    We had a 3-drive Windows Server 2008 R2 RAID-5 fail (operating in redundancy mode): WDC 1 TB WDC 1 TB WDC 1 TB We removed the failed hard drive, and put a WDC 1 TB drive (that we had standing by) into the machine. When launched, Disk Manager, asked permission to "initialize" the disk as either: Master Boot Record (MBR) Guid Partition Table (GPT) We initialized the disk as GPT, converted it to dynamic, and tried to use the Repair Volume command - except it was greyed out. (which is a terrifying thing on a failed production server hosting 3 virtual servers) i tried from the diskpart command line tool. First we look for our RAID-5 volume that is in Failed Rd mode: DISKPART> list volume Volume ### Ltr Label Fs Type Size Status Info ---------- --- ----------- ----- ---------- ------- --------- -------- Volume 0 E VMs (Raid5) NTFS RAID-5 1863 GB Failed Rd Volume 1 D DVD-ROM 0 B No Media Volume 2 System Rese NTFS Partition 100 MB Healthy System Volume 3 C NTFS Partition 1862 GB Healthy Boot There, Volume 0. Make that our active context: DISKPART> select volume 0 Volume 0 is the selected volume. Now we need to find the disk we will be repairing the volume with: DISKPART> list disk Disk ### Status Size Free Dyn Gpt -------- ------------- ------- ------- --- --- Disk 0 Online 931 GB 0 B * Disk 1 Online 931 GB 931 GB * Disk 2 Online 1863 GB 0 B Disk 3 Online 931 GB 0 B * Disk M0 Missing 0 B 0 B * The disk with 931 GB free, Disk 1. Now we just need to repair the volume: DISKPART> repair disk=1 Virtual Disk Service error: The size of the plex member is invalid.

    Read the article

  • i dont see the option to save the partition table

    - by Bipin Neupane
    the issue is this Undo the CLEAN command on the portable hdd : DISKPART unfortunately at step no 10, i dont see the option to save the partition table.but there are options for: deeper search quit write a partition. wat should i do?plz help(i run testdrive 6.14) here is how this happened... I ran cmd then diskpart then selected the volume used 'CLEAN' command to clear the configuration (accidentally) does reinstalling my windows solve this ? will my hard drive work on other computers?

    Read the article

  • diskpart on RDM's ...

    - by karnash
    HI, We have ESXi cluster which is attached to clariion CX4 We have windows 2008 R2 as the guest OS. Attahed to this vm is 2 x 1.95T RDM's I select disk 1 create partition primary size=1 (1MB) then list partition Partition ### Type Size Offset * Partition 1 Primary 1024 KB 1024 KB Then I do the same for the other disk and offset is 1024KB I need to present 4T disk to this vm so I right click on disk 1 convert to simple volume then extend it by adding the second disk now when I do list partition, I see the off set is set to 31k. Can anyone please guide me. Thanks

    Read the article

  • How to create dynamic volume in stripe configuration, aligned to 1024?

    - by GregC
    I am trying to create a software stripe setup with two physical disks (underneath they are 128K stripe, RAID5 for each). I've read that one can use diskpart, but I am unable to come up with a command that works. This is on Server 2k3 SP2. I was trying create volume stripe disk=2,3 align=1024 Diskpart errors out: The arguments you specified for this command are not valid. P.S. Tried successfully with a basic disk and a primary partition. Please reply, -Greg

    Read the article

  • Windows 7 migration led to crashdump and hibernate problems

    - by MartyMacGyver
    Note: I'm using a Samsung 830 SSD (migrated OS from defunct PC) and other than these two (interrelated?) problems it's working fine. Surprisingly well actually. Motherboard is a ASUS P8Z77-V Deluxe. Problem 1: Crashdumps are not working. volmgr throws an event 45 "The system could not sucessfully load the crash dump driver." whenever you modify crashdump settings, or if a crashdump occurs. diskpart says that "Crashdump disk = no" which is peculiar. Problem 2: Hibernation isn't working. Again, volmgr throws the same event 45 if you try to hibernate. The screen blanks, then you're at the password prompt. No sleepage occurs. (Yes, I know I should avoid hibernation on SSDs but it's enabled and the hibernation file is definitely there so I'd like to know why it's failing). Diskpart claims "Hibernation file = no" which is again peculiar... it's plainly there and getting created by the system. The common factor appears to be volmgr and/or the crashdump "service" (if that's what it is). I'd much rather get this working than spend days reinstalling and reconfiguring the entire system, especially when it's working perfectly otherwise. Sleep works as well (as long as it's not hybrid sleep). So, what defines the flags "Crashdump disk" and "Hibernation file disk" in diskpart's output? And what might be going wrong that's breaking crashdumps in particular?

    Read the article

  • Windows 2008 R2: can't extend C drive, mystery partitions

    - by wfaulk
    I have a Windows 2008 R2 server running under VMware ESX 4.0.0. I have reallocated disk space to it in order to extend the C drive, but Disk Management has "Extend Volume" greyed out. DISKPART shows more partitions than Disk Management shows, including one after the volume I'm trying to extend, which would explain why Disk Management isn't allowing the extension. Disk Management shows: System Reserved / 100MB NTFS / Healthy (System) (C:) / 39.39 GB NTFS / Healthy (Boot, Page File, Crash Dump) 10.00 GB / Unallocated DISKPART shows: Partition 1 Dynamic Data 992 KB 31 KB Partition 2 Dynamic Data 100 MB 1024 KB Partition 3 Dynamic Data 39 GB 101 MB Partition 4 Dynamic Data 1024 KB 39 GB My question at this point is: what the heck are partitions 1 and 4, where did they come from, why doesn't Disk Management show them, and, most importantly, can I delete partition 4 in order to extend partition 3?

    Read the article

  • Windows 7 system drive says it is raw, but System Recovery starts without issues

    - by iulianchira
    I have been running Windows 7 RC1 since it was available a couple of months ago and had no issues whatsoever until today. When I start my laptop, Windows does not boot but instead Windows System Recovery starts. I've used diskpart to list the partitions on the drive and my system partition (c:) has a RAW filesystem. I really need to save all data on the disk as fast as I cant and I would really like not to have to reinstall my system.

    Read the article

  • Windows 7 system drive says it is raw, but System Recovery starts without issues

    - by Iulian Chira
    I have been running Windows 7 RC1 since it was available a couple of months ago and had no issues whatsoever until today. When I start my laptop, Windows does not boot but instead Windows System Recovery starts. I've used diskpart to list the partitions on the drive and my system partition (c:) has a RAW filesystem. I really need to save all data on the disk as fast as I cant and I would really like not to have to reinstall my system.

    Read the article

  • Extend volume where unallocated space lies ahead of it

    - by T3rm1
    I want to extend my volume. However the unallocated space lies ahead of the volume. Is it possible to extend this volume without converting it to a dynamic volume? I can't include images yet, so here you go: http://www.abload.de/img/unbenannttboxq.png I tried to use diskpart with the extend command but it doesn't work. Makes sense because the instructions says that the unallocated space has to be behind the volume.

    Read the article

  • Lost HDD partition to clean command, testdisk unresponsive

    - by Sujay Anjankar
    I accidentally cleaned my external HDD by the clean command in Diskpart and got a full sized heart attack after that. I did some research and I have tried a number of tools already. To name a few: Testdisk Recuva Partition Find and mount Eassos Recovery I have even tried some other dumb sounding tools, but none of them could find the lost partition. They just show "no partition found". Testdisk shows Partition sector doesn't have the endmark 0xAA55. The file recovery softwares list the files, but none of them seem to be able to restore the lost partition. I need to recover the disk as it was. Any help would be much appreciated!

    Read the article

  • Server 2008 R2 - Boot disk RAID 1 - migrate to larger disk

    - by William Hooper
    My group inherited several 2008 R2 servers with single 70GB RAID 1 boot/system disks. No other disks in the servers. We need larger boot / system disk. Plan is : to replace one disk with new 500 GB drive wait for resync replace other smaller disk with 2nd 500 GB drive wait for resysnc Now I should have 500 GB RAID 1 with original 70 GB partition Then I would like to extend the 70 GB partition to 200 GB and add D: drive partition with remaining 300 GB Can the above be done using Windows Disk Management and / or Windows DiskPart ?

    Read the article

  • Resizing Windows 7 bootcamp partition

    - by Charlie
    I've installed Windows 7 on my Mac using bootcamp but stupidly only allocated it 25gb which isn't enough once I've installed Visual Studio and other stuff. I was able to shrink the Mac partition using whatever tool it is in Mac OS Snow Leopard but it wouldn't let me increase the windows partition so I rebooted into Windows to try it but am still having problems: I coudn't extend it using the disk management tool because the option is greyed out so I tried diskpart.exe but when I use the extend command with my partition selected it says: Virtual Disk Service error: There is not enough usable space for this operation. I've got 19.69gb of unallocated space though so am not sure why I'm having the problem. I don't want to have to wipe my Windows partition, any ideas?

    Read the article

  • Best Easiest Fastest No Install USB Boot Disk in 4 Simple Steps :)

    - by PearlFactory
    USB Boot Disk When you look how to create USB Boot Disk on the web it is a nightmare   Here is the easiest I use that works for all MS prods At a computer running Windows Vista, Windows 7, or Windows Server 2008, run a command prompt as administrator and execute the following: Make Sure you have all explorer windows closed and nothing referencing the USB i.e a doc open in Word 1. C:\> diskpart DISKPART> list disk [Identify disk # of the USB key] DISKPART> sel disk 1 [assuming 1 was the # from above] DISKPART> clean [CAUTION—will wipe whichever disk is selected] DISKPART> cre part pri DISKPART> active DISKPART> assign DISKPART> format fs=ntfs quick DISKPART> exit C:\> exit 2. Copy the contents of the Windows Server 2008 R2 or any other MS OS  DVD/ISO to the USB key. 3. From the system tray, use the “Safely remove hardware” icon to safely remove the USB key from the computer. This helps ensure that all files have been fully written to the USB key. (Especially after the large file copy) 4. Restart,,,put usb in and Find reference from HP h20195.www2.hp.com/v2/GetPDF.aspx/4AA3-1317ENW.pdf

    Read the article

  • exFAT to NTFS formatting troubles

    - by user1083734
    I recently ran a chkdsk on 2.5" 230GB SATA HDD but the plug was pulled before the end of the chkdsk and since then it wouldn't boot up. Deciding to scrap all data on the HDD (no longer needed it), I then fitted it into an external HDD caddy and (in diskpart) cleaned the disk, created new partition and volume and tried to format it to NTFS. It couldn't do this on long or short formats and so I went with the less-appreciated alternative - exFAT (I run Win7). It quick formats to exFAT fine but encounters errors during long format. At the moment it is exFAT. Of course I would really like it to be NTFS as I will probably need to use it on Win XP too. Could anyone suggest a method of trying to reformat to NTFS? Do you think that, when chkdsk was interrupted first time, the disk was corrupted and is irretrievable? I find this situation slightly odd, as it HAS formatted to exFAT and DOES seem to work when I copy files across! Also, I CAN use disk management console to create several partitions: e.g. a 50GB partition and then a large 180GB partition. The 50GB and WILL long-format to NTFS but the 180GB will not! I'm thinking hardware fault, but then I notice that it WILL format to exfAT! Much confusion!

    Read the article

  • Windows 8.1 - Won't boot (0xc000000f), bcdedit fails

    - by user3014097
    I’m pretty much stuck at this point. So, backstory: Windows was installed on one of the SSDs currently in my tower. I bought a new SSD to install Windows (8.1 64 bit) on. Windows installation went fine, booted up, and formatted the old SSD from within Windows (this seems to have been a mistake, but I didn’t realize that at the time). Despite formatting the old SSD, whenever I tried to boot I was told that there were 2 Windows installations. Apparently, when I formatted the old drive, not all of the partitions were removed. So, I booted up with the repair utility, went into cmd, and deleted the non-primary partitions on the old SSD (there were 2 – think they were system and recovery, although I’m forgetting now). Reboot – computer won’t boot. Getting the 0xc000000f “The boot selection failed because a required device is inaccessible” error. Troubleshooting so far: Automatic repair doesn’t fix anything (I’ve never had luck with it though) If I go to install a new version of Windows, the drives and partitions are all there. The SSD is functioning, I at least know that. I’ve essentially gone through this guide: https://neosmart.net/wiki/recovering-windows-bootloader/ Unfortunately, I’m not getting anywhere. I’m not even entirely sure how to describe the errors I’m getting, so I’ve just included pictures of every step (I can't actually post them though so I just included a photobucket link). http://s319.photobucket.com/user/DGalt11/library/Computer%20Issue Am I completely screwed here (i.e. reformat and reinstall?)? Thanks

    Read the article

1 2 3 4 5  | Next Page >