vmtoolkit.com
The source for virtual machine tools and expertise
Welcome to vmToolkit Sign in | Join | Help
in Search

Extend Boot Partition in VHD

Last post 11-24-2009, 12:13 AM by newmagic. 13 replies.
Sort Posts: Previous Next
  •  03-09-2007, 1:19 PM 169

    Extend Boot Partition in VHD

    Hi 

     

     My VHD has reached the maximum disk size (15.9gb), and I used the VHDResize tool to create an extra 60gb of unallocated space.
    I need to extend the c: drive (boot), another volume does not meet my requirements.
    Running diskpart fails probably because it is the boot partition.

     I tried following the instructions here by slaving the VHD with another VPC.
    http://searchwincomputing.techtarget.com/originalContent/0,289142,sid68_gci1126671,00.html

    I ran diskpart 'extend size=50000' (and various other parameters) on the partition I want to extend and it says it completed successfully.
    But the partition does not extend, even after a reboot it is still at 15.9gb.

    So my questions is, has anyone successfully extended the boot partition on a VHD?

    TIA 

  •  03-27-2007, 12:28 AM 206 in reply to 169

    Re: Extend Boot Partition in VHD

    I have same question.
  •  04-20-2007, 7:20 AM 239 in reply to 169

    Re: Extend Boot Partition in VHD

    I know this is an old thread but I wanted to say I have actually been able to complete this task.  I extended a 16 GB boot partition to 18 GB and 36 GB. 
  •  04-25-2007, 9:30 AM 244 in reply to 239

    Re: Extend Boot Partition in VHD

    To add to Gamabyte's response; he has shared this link with us in another thread and I wanted to pass it around. A very nice simple explanation that I'm glad he shared.

    http://searchwincomputing.techtarget.com/originalContent/0,289142,sid68_gci1126671,00.html


    :: Paul
  •  05-31-2007, 4:26 AM 276 in reply to 244

    Re: Extend Boot Partition in VHD

    Another way is simply boot from a live cd-image (e.g. gparted-live-cd.iso) and expand your virtual hard disk.
  •  07-24-2007, 7:48 AM 331 in reply to 276

    Re: Extend Boot Partition in VHD

    I created a virtual image of Windows 2003 R2 with antivirus and service packs then burned it to DVD so I would have a base image without taking up HD space on the server (WAIK is probably better, but I haven’t tried it yet).  It seemed like a great idea until I realized that the VHD was setup for 50GB.  So I did some research and found a pretty simple way to deal with this issue:

     

    First, to make things easier on myself, I used VHDResizer to create a new VHD and copy the existing VHD into the new size.  This increases the HD size, but not the partition (keep the original around until you complete the process, just in case).

     

    Second, I used VHDmount to mount the VHD and used diskpart.exe from the host to expand the VHD’s partition.  Shut down the guest VM.  In the host, open the command prompt and type ‘cd Program Files\Microsoft Virtual Server\Vhdmount

     

    Mount the image

    C:\>Program Files\Microsoft Virtual Server\Vhdmount>vhdmount /m “C:Documents and Settings\All Users\Documents\Shared Virtual Machines\<server name>\<server name>.vhd” <drive letter>

    Start diskpart

    C:\>Program Files\Microsoft Virtual Server\Vhdmount>diskpart

    Expand the partition

    DISKPART>list disk

    DISKPART>select disk 3 -----check the number in the list

    DISKPART>list part

    DISKPART>select part 1 -----check the number in the list

    DISKPART>extend

    DISKPART>list part -----check the new size

    DISKPART>exit

    Dismount and save changes

    C:\>Program Files\Microsoft Virtual Server\Vhdmount>vhdmount /u /c “C:Documents and Settings\All Users\Documents\Shared Virtual Machines\<server>\<server>.vhd”

     

    After booting up the VHD again, you’ll be prompted to restart since Windows installed new hardware (your new HD).  After reboot, your new HD partition should be ready.

     

  •  07-31-2007, 7:05 AM 337 in reply to 169

    Re: Extend Boot Partition in VHD

    Hi all,

     I did this:

    shutdown VM

    start putty, goto your vmdk file and run vmkfstools -X disksize <path to vmdk>

    with ll you can see the result, this is simple he.

    Than reboot from cd-rom Partition Manager 8.5 > click on normal mode > choose PM8.5 ESE and click on resize > apply two times and reboot VM

    VM does a diskcheck, do not interrupt and you have an extended boot partition.

    If above didn't work, do it again, it definite works.

    Grzz,

    Ben

     

  •  09-12-2007, 8:05 AM 364 in reply to 337

    Re: Extend Boot Partition in VHD

    What I did was to create a new expanded drive using Resizer.  Next, go into virtual machines/configure.  Add the new vhd as a second drive in server and add this drive as primary channel (1).  Then start the virtual machine and run diskpart and expand the volume on that drive. 

    You should be able to expand the new drive because you didn't boot to it.  Then go back into Virtual Server and make the expanded drive the one it boots to and test it out.

     

     

  •  10-06-2007, 7:25 PM 382 in reply to 331

    Re: Extend Boot Partition in VHD

     

    Using diskpart works, as above. You can either use vhdmount and mount it to your host OS and then do the diskpart commands OR you can add it as a second disk to the VM, boot the VM, do diskpart commands there, shutdown, and relist the new hard disk as the primary disk. Done.

     

  •  11-25-2007, 6:34 AM 418 in reply to 169

    Re: Extend Boot Partition in VHD

    Has anyone run into the "disk read error" after using VHDResizer to increase the size. I get this no matter what I do (before diskpart, after diskpart, etc).
    Filed under:
  •  01-18-2008, 9:34 PM 449 in reply to 169

    Re: Extend Boot Partition in VHD

    The easiest way to do this (as long as you have enough hard drive space) is to extend your existing VHD using VHD Expander which gives you two VHD files.  The newly extended file will take the name of your existing VHD.  You might want to Defragment, Precompact, and Compact your VHD prior to extending your VHD.

    In Virtual PC 2007 go to Settings.

    • Select your OLD VHD as Hard Disk 1
    • Select your newly extended VHD as Hard Disk 2
    • Boot your VM
    • Open an Command Prompt
    • Run diskpart
    • From DISKPART>
      - Execute LIST VOLUME
      - Select your new VHD volume by executing SELECT VOLUME <N> where <N> is your new VHD most likely 2
      - Execute EXTEND
      - You should see a success message.  If not you may have to recreate your extended VHD due to an error in the process.
    • Quit Diskpart.exe by typing EXIT
    • Shut Down the VM
    • Remove both VHD files from the Hard Disks list
    • Add your newly extended VHD as Hard Disk 1
    • Boot your VM.
    • You will get a Windows Newly Added Hardware message after a short time.
    • Reboot the VM when prompted
    • Start using your newly extended VHD!

    Here is Microsoft's information on extending volumes using Diskpart.exe:  http://support.microsoft.com/kb/325590

    Enjoy!

  •  08-27-2009, 7:04 AM 806 in reply to 449

    Re: Extend Boot Partition in VHD

    Hmm - just trying to do this myself but Diskpart is seeing the first drive as "Boot" and the second drive as "System".  I am assuming this is the reason that it is failing telling me "The volume you have selected may not be extended".

    I am guessing I need to stop it being a System drive in some way.

    Any suggestions?

  •  09-22-2009, 12:30 AM 820 in reply to 806

    Re: Extend Boot Partition in VHD

    To extend the boot partition in your VHD without data loss here is a detailed tuorial:

    http://www.partition-tool.com/resource/resize-boot-partition-2.htm

     BTW, it also supports Windows Server, RAID and Dynamic disk.

  •  11-24-2009, 12:13 AM 864 in reply to 169

    Re: Extend Boot Partition in VHD

    I found an article how to resize windows 7 vhd

    to resize VHD, you may also use this free sw, very easy.

View as RSS news feed in XML
Powered by Community Server, by Telligent Systems sponsored by xcarab, inc