Increase Disk Size
Increasing the disk size of your virtual machine
CloudShare supports editing your virtual machine hardware and increasing the disk, RAM or number of CPUs. To access this functionality, bring up your environment and navigate to the ‘Edit hardware’ page:
Once you are in the edit hardware page, you can edit the available resources. Click on the Disk edit icon, then use the slider to reallocate more drive space. Use this cautiously and do this in small increments when you need the space as you can not shrink the volume once the changes are saved:
Then, click ‘Save changes’ and your environment will begin updating.
Remember: if you edit your disk size, you will have to partition your hard drive accordingly.
For windows: access the ‘Disk Management’ utility, right-click on the main partition and select ‘Extend volume…’
Windows Server 2012 has relocated the option for Computer Management:
Select the size you wish to allocate and click ‘Next’:
Finish the process and you will see the extra space assigned to your main partition.
Finally, take a snapshot to ensure your new settings are saved.
Comments
7 comments
Trying to resize a partition in XP / 2003?
Switch to Console view
Reboot the system and watch closely for the VMWare splash screen when it reboots
The reboot screen is very brief, when you see the VMWare splash screen quickly press F8, then select Safe Mode with Networking
Once logged into Windows, install a great free tool: Dell's Extpart.
_After installing Extpart: _
From the Start Menu select Run.
Type 'cmd' and click OK to run the command line utility.
Change directories to c:\dell\ExtPart or the location the utility extpart.exe was extracted.
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 *
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?
Hello Scott. What about the Windows Server 2012? Thanks.
-Constantin
Ah, the same command: discmgmt.msc. Sorry for disturbing.
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?
@ Fred, here you go!
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.