Increase Disk Size



  • Avatar
    Peter Franks

    Trying to resize a partition in XP / 2003?


    1. Switch to Console view

    2. Reboot the system and watch closely for the VMWare splash screen when it reboots

    3. The reboot screen is very brief, when you see the VMWare splash screen quickly press F8, then select Safe Mode with Networking

    4. Once logged into Windows, install a great free tool: Dell's Extpart

    _After installing Extpart: _

    1. From the Start Menu select Run.

    2. Type 'cmd' and click OK to run the command line utility.

    3. Change directories to c:\dell\ExtPart or the location the utility extpart.exe was extracted.

    4. To extend the partition, your command in the CLI will look like the following: extpart [volume:] [size]

    • extpart is the command

    • [volume:] is the volume to extend.  For example c:, f:, g:, etc (only basic volumes)

    • [size] is the size in megabytes by which to extend the volume.

    Example: To extend the C: volume by 1 GB (1024 MB) use the following command:

    *extpart g: 1024 *

  • Avatar
    Peter Franks

    What about resizing in Linux?

    There are different options available for resizing a HDD in Linux. There is an excellent guide located here.
    Consider the first step, 'How to expand disk capacity for vmware linux virtual machine' already completed when you add disk space from the CloudShare UI.

    Alternatively, you can use Parted or a similar application. 

    Here are some instructions for modifying Linux partitions.  First you must use the edit hardware option in the CloudShare Dashboard to increase the hard drive size as above

    Next you need to change the size available to the OS.  The exact steps will vary depending on your system configuration (with or without LVM):

    With LVM

    1. Use fdisk to create new partition(s), make sure to mark them as LVM parititions (8e)

    2. Format the partition(s) using mkfs

    3. Run the LVM commands:

    pvcreate /dev/<drive>

    vgextend VolGroup00 /dev/<partition>

    lvextend -L<size>G /dev/<path to logical volume> 

    ** EXAMPLE **

    Format the disk:

       fdisk /dev/sdb

       use n to create a new parition

       use t (select 8e for LVM)

       use w to write your new partition table

    Now create a file system on this parition:

       mkfs.ext3 /dev/sdb1

    Use LVM to add this space:

       pvcreate /dev/sdb1  (create physical volume)

       vgextend VolGroup00 /dev/sdb1  (extend your volume group onto the new drive)

       lvextend -L10G /dev/VolGroup00/LogVol01 (extend your logical volume by 10GB)

    Without LVM

    1. Create parition(s) using the fdisk command

    2. Format the new parition(s) using mkfs.ext3 (or other filesystem type if required)

    3. Mount the new filesystem

    4. Save the mount settings to /etc/fstab

    ** EXAMPLE **

    Format the disk:

       fdisk /dev/sdb

       use n to create a new parition

       (the type should be linux ext3)

       use w to write your new partition table

    Now create a file system on this partition:

       mkfs.ext3 /dev/sdb1

    Now mount this filesystem:

       mkdir /opt/new_space

       mount /dev/sdb1 /opt/new_space

    Finally edit /etc/fstab to automatically mount this when the system boots

       vi /etc/fstab

    add a line like:

       /dev/sdb1       /opt/new_space      ext3    defaults    1 1

    Interested in learning more on LVM?

  • Avatar
    Constantin Mineev

    Hello Scott. What about the Windows Server 2012? Thanks.


  • Avatar
    Constantin Mineev

    Ah, the same command: discmgmt.msc. Sorry for disturbing.

  • Avatar
    Fred Morrison

    Would you add a link on this page, perhaps under "Related Topics", to a page that describes how to ADD an additional disk to an environment, not just increase an EXISTING one?  For example, how do I add an additional Windows disk, say as the D:\ drive, to an existing Windows Server?

  • Avatar
    Peter Franks

    @ Fred, here you go!

  • Avatar
    Antonio Costa

    Nice article!

      May I suggest to look at /etc/fstab to see the filesystems<->logical volume mapping and avoid messing with your VM ?


      And don't forget to expand the filesystem as well, not only the logical volume.

      You can add -r parameter at lvextend command : lvextend -r -L<size>G /dev/<path to logical volume>


      If you already followed Peter's instructions but 'df -h' is not yet showing your filesystem expanded, you can run fsadm :

        fsadm -l resize /dev/<path to logical volume>


Please sign in to leave a comment.