Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am getting an error while trying to resize System Partition for Windows 2003 Server (this is a VM on a Hyper-v Windows Server 2008) using GParted Live CD ISO.

Followed this tutorial: http://malaysiavm.com/blog/how-to-resize-windows-2003-server-virtual-disk-on-vmware-esx/ and GParted Doc http://gparted.sourceforge.net/larry/resize/resizing.htm (They are very similar)

The VM has a Dynamic VHD file, I have already increased it using Hyper-v. GParted doesn't give any clues or details for the error. Just simply errors when trying to grow the partition. Any ideas what I can do? Thanks!

Using version of Gparted: gparted-live-0.13.1-2

share|improve this question
add comment

3 Answers

up vote 1 down vote accepted

As @TheCleaner says, use diskpart from a Windows 2008+ install .iso. I always prefer to use Microsoft-supported tools and processes when messing with partitions and disks.

Assuming you've expanded .vhd inside Hyper-V console:

  1. Attach a Vista/win2008 or newer install .iso to the VM settings
  2. Boot to the .iso and once you're at setup prompts, hit shift-f10 to get Command Prompt
  3. diskpart
  4. something similar to:
    1. list disk
    2. select disk 0
    3. list partition
    4. select partition 1
    5. extend
    6. exit
  5. now reboot and windows should have all the space you expanded the .vhd for

P.S. If you have more then one partition in that .vhd and you're wanting to extend any other then the last one, it's a no go with diskpart (TMK).

share|improve this answer
    
Using a newer version of Windows actually corrupted the VHD file - which has was Windows Server 2003 –  Dina Oct 1 '12 at 23:18
    
Not sure why that would happen. Have done this exact thing on a few dozen production servers. It's actually the only Microsoft-supported way to expand a .VHD (that I know of). –  Bret Fisher Oct 2 '12 at 4:13
    
Since your answer was the only one that let me expand the drive (even though it corrupted it), I'll mark it as the answer. I think I'm facing some anomaly anyway. –  Dina Oct 2 '12 at 14:17
    
Have you tried mounting the .vhd as a 2nd drive on another VM and running chkdsk on it? –  Bret Fisher Oct 2 '12 at 20:26
add comment

I've used the following method with VMware VM"s many times. I'm assuming it will work with Hyper-V VM's as well:

  1. Shut down the VM in question.

  2. Attach the VHD from this VM to a second VM. Extend the volume from within the OS of the second VM.

  3. Detach (do not delete) the VHD from the second VM.

  4. Power on the original VM.

Please make sure you have a recent, reliable backup first. As I said, I've used this method for VMware VM's but never for a Hyper-V VM.

share|improve this answer
    
Sounds interesting & worth a try, does it being a system/boot partition matter? And thanks!! –  Dina Sep 13 '12 at 21:20
    
same here but using diskpart and not the gui. System/boot partitions will work this way. Again same as joe, only done it in vmware. –  TheCleaner Sep 13 '12 at 21:26
    
@Dina, That's precisley why I did it... because it was the system partition and couldn't be extended in the Disk Management MMC or using diskpart. I've used Gparted before but always wind up getting errors so I gave up on that and have used this method ever since. –  joeqwerty Sep 13 '12 at 21:29
    
Well, Windows (2nd VM) is telling me that this is a System disk & cannot be extended. –  Dina Sep 13 '12 at 21:42
1  
You resized the VM disk in hyper-v first right? Then use diskpart (on a 2nd machine like Joe said, and select the volume, extend. –  TheCleaner Sep 14 '12 at 0:19
show 10 more comments

By "Hyper-V Windows Server 2008" do you mean Windows Server 2008 with the Hyper-V role installed, or do you mean Hyper-V Server 2008? In case of the former do this:

  • Shut down the VM.
  • Start diskmgmt.msc on the hypervisor.
  • Click Action > Attach VHD and select the VHD file.
  • Right-click the volume, select Extend volume... and click through the wizard.
  • Right-click on the info box left of the volume and select Detach VHD.
  • Start the VM.

On Server 2008 you could attach the VHD file with a couple lines VBScript:

Set wmi = GetObject("winmgmts://./root/virtualization")
Set vhdSvc = wmi.ExecQuery("SELECT * FROM Msvm_ImageManagementService").ItemIndex(0)
vhdsvc.mount("C:\PATH\TO\your.vhd")     ' attach
vhdsvc.unmount("C:\PATH\TO\your.vhd")   ' detach

and then try diskpart to set the disk online and extend the volume.

share|improve this answer
    
"By "Hyper-V Windows Server 2008" do you mean Windows Server 2008 with the Hyper-V role installed" Yes. The Option "Action > Attach VHD" is not available to me. Using 2008 and not 2008 R2 and therefore I don't think this is available to me. –  Dina Sep 14 '12 at 14:37
    
Updated answer. –  Ansgar Wiechers Sep 14 '12 at 15:30
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.