31

How To Resize/Grow VMware Linux Disks and Partitions


Posted by Artem Russakovskii on August 10th, 2007 in Linux
Share

Updated: January 18th, 2009

31 Responses to “How To Resize/Grow VMware Linux Disks and Partitions”

    31 Comments:
  1. pY says:

    Thanks a lot. Very clear and concise indications on how to procede. Exactly what i was looking for.

  2. Tomslin says:

    Thanks for the howto.I'll like to know how I can do this with my host being linux,as i see no tool like vdiskmanager on my linux vmware install.

  3. Tomslin, I just installed VMWare Workstation v6.0.3 on my Linux server and the following commands became available:

    vmware vmware-authd vmware-loop vmware-ping vmware-uninstall-vix.pl vmware-vdiskmanager vmware-acetool vmware-config.pl vmware-mount.pl vmware-tray vmware-uninstall.pl

    I needed to install the kernel-source package in order to complete the installation.

    Perhaps you're using the VMWare Player, which may or may not include vmware-vdiskmanager.

  4. Steven White says:

    Hello,

    I attempted what you've described but ran into a problem. When I boot up the LiveCD of gparted, after it boots into where my guest OS should be, gparted doesn't see any available devices.

    Is there a way to force gparted to look to the 'hard disk' that should contain my VM?

    system info…
    host OS: CentOS running VMWare server
    guest OS: Ubuntu 6.06

    My guest OS does boot properly and all apps will run across the network. Of course I didn't set aside a larger enough file system for my mail service. Which is why I'm here now.

    And I've already successfully enlarged the VM from 20GB to 40GB.

    I hope you can help.

    Cheers,
    Steven

  5. Steven, what gparted version are you using?

  6. Steven White says:

    I'm using 0.3.6-7. Any known problems w/this version?

  7. Steven, re-read #4A again, very carefully :P

  8. Roman says:

    Thanks a lot Artem,

    Your solution is brilliant. Worked fine for us and saved us a lot of time.

    Cheers,
    Roman

  9. Glad to be of service, Roman.

  10. Douglas Held says:

    On Mac OS X with VMWare Fusion 1.1.3, the utility is /Applications/VMWare\ Fusion.app/Contents/MacOS/diskTool , and the grow argument is big X, not little x.

    Thanks for the help, Artem.

  11. Carpii says:

    Hi, Im struggling a bit.

    GParted shows I have an ext3 partition (label /boot) of 100 meg, followed an unknown partition.

    The unknown partition should be appearing as etx3 too, its the root partition. But gparted wont recognise it, so I cant resize it :(

    Any ideas please? Im using gparted 0.3.4-5 as instructed

    Thanks

  12. Carpii, I'm afraid this is not something I personally can help you with and the question is better directed at the developers in their forum: http://gparted.sourceforge.net/forum.php.

    Good luck.

  13. Amski says:

    With VMWare Fusion (Mac), you can grow your disk size using the GUI. Select your VM machine, enter properties, select disk and resize. Of course VM machine must be shut down first (and you cannot have a snapshot attached to it).

    Also, for those of us who cannot press the F2 key fast enough during the VM machine's boot sequence to actually get BIOS instead of GRUB screen, you can edit the ".vfx" file and set "bios.bootDelay" property to some larger value. This makes VM machine wait longer at the initial boot screen, giving one more time in which to press F2.

    Artem, thanks for this write up. It was of great help :-)

  14. @Amski
    Thanks for the extra info for you fancy Mac people.

  15. M Hahn says:

    Hi,

    with VMWare 2 does not bring the BIOS (at least not for me). Rather you need to select: show BIOS at boot directly from VMServer

    Cheers,
    Matthias

  16. Vim Toutenhoofd says:

    I run Ubuntu 8.04 in a VMware Workstation virtual machine hosted by Windows XP on a ThinkPad G41. I had no luck with gparted-live-0.3.9-4.iso, which is an image of the current version of that utility. It made me wonder if that bug you referred to has not yet been fixed. I then tried the version which worked for you (gparted-livecd-0.3.4-5.iso), which indeed allowed me to enlarge the partitions on my virtual hard disk. Thanks for your article!

  17. Ed says:

    FFS.. I have followed the instructions.. and tried it with

    gparted-live-0.3.9-4.iso
    and
    gparted-live-0.3.4-5.iso
    and a couple others…

    and neither worked. I always get unrecognized FileSystem X\

    I'm trying to run a CentOS 5.2 VM on a Mac X\

  18. Michael says:

    Thanks for the information. Turns out that the latest version of gparted does not see VM partitions. Use the version you suggested and it works great. Once again, thank you.

  19. Keith says:

    Thanks, great article which helped me fix my problem!!!

  20. @Carpii, Ed, and others having a problem with GParted not seeing the partition (shows unknown)

    I just tried a default CentOS installation and realized I didn't give it enough space. Booting into any version of GParted showed the / partition as "unknown".

    Well, the problem is due to CentOS making it LVM by default. According to GParted, LVM is not supported. I've yet to find a solution. :(

  21. Tilman Schmidt says:

    You don't even need GParted with LVM. Instead, in step 3 you just use fdisk to create a new partition from the added space, pvcreate to make a PV from it, and vgextend to add it to your VG.

  22. luis benitez says:

    Sweet!!! Works like a charm.. thanks for the tip!

  23. Simon Shaw says:

    Tilman,
    I did what you said with LVM and I can see that the volume has increased in size from 7.5GB to 11.28GB as shown below, however when I run df -h the partition that I was originally trying to remains 7.2GB. Any ideas?

    lvdisplay
    — Logical volume —
    LV Name /dev/VolGroup00/LogVol00
    VG Name VolGroup00
    LV UUID qti2mM-XkDw-LPC1-ARJv-nLAs-YcTL-4zrCuP
    LV Write Access read/write
    LV Status available
    # open 1
    LV Size 11.28 GB
    Current LE 361
    Segments 2
    Allocation inherit
    Read ahead sectors auto
    – currently set to 256
    Block device 253:0

    df -h
    Filesystem Size Used Avail Use% Mounted on
    /dev/mapper/VolGroup00-LogVol00
    7.2G 6.3G 536M 93% /
    /dev/sda1 99M 18M 77M 19% /boot
    tmpfs 744M 0 744M 0% /dev/shm
    /dev/hdc 278M 278M 0 100% /media/New

  24. Taheireem says:

    hi,
    I followed the steps downloaded the same version of gparted LiveCD,after booting i can see inside the gparted window:
    Partition:Filesystem:Label:Size:Used;
    /dev/sda1:ext3:/boot:101MB:12MB;
    /dev/sda2:ext2:/:3.4GB:3.2GB;
    /dev/sda3:Linux-Swap: :500MB:120MB;
    unallocated:unallocated: : :–:–;

    but i cant resize the "/" partions,even this partition is unmounted.

  25. Taheireem says:

    i think i made it ,it was LINUXSWAP partitions in the middle of /dev/sda2 and unallocated space,anyway thanks for the above procedure.

  26. Vzzuv says:

    Thanks a lot! Great article, very helpful.

  27. cmg says:

    @Simon Shaw (or in fact anyone who is having similar LVM difficulties): I encountered the same problems. I managed to solve the problem eventually as follows (WARNING, there may be errors here. I can't retrace my steps precisely having done everything via liveCD. You should investigate all steps, command usage, etc. yourself. I also recommend backing up your virtual disk before proceeding, it saved me a lot of tears :-) Also, some parameters [e.g. /dev/sda/, VolGroup00] may differ for you):
    1) Change size of VMWare virtual disk through the VMWare interface
    2) Start your VM from a live CD. (Press esc on boot with centOS).
    3) Use fdisk to add a new LVM partition. ('n' to create a new partition, select 'p' for primary, 3 [or whatever] for 3rd primary partition, 't' to modify partition's system id to 8e [LVM]). Not sure if the modification of the partition's system id was necessary… did it anyway just to be safe.
    4) Use pvcreate to intialise this partition for use by LVM
    $ pvcreate /dev/sda3
    5) Use vgextend to add it to your volume group
    $ vgextend VolGroup00 /dev/sda3
    # Thanks is obviously due to Tilman Schmidt for the
    # above few steps
    6) Use lvextend to extend the LV:
    $ lvextend -L20G /dev/mapper/VolGroup00-LogVol00
    # extend to 20GB
    7) Unmount and resize fsg
    $ umount /dev/mapper/VolGroup00-LogVol00
    $ resize2fs /dev/mapper/VolGroup00-LogVol00
    # after trying resize2fs I was prompted to do a filesystem check before proceeding. If this happens, do this, and try again.

    # http://tldp.org/HOWTO/LVM-HOWTO/extendlv.html for last 2 steps

  28. Robson says:

    Hi

    I need to resize a Linux "/" filesystem but to reduce and recover disk space not to increase.
    The recovered disk space is to be used to create othe VMware machines on the same VMware host.
    The guest OS is Red Hat Enterprise Linux AS (v. 4 for 64-bit AMD64/Intel EM64T) the VMWare host is also Linux.
    I have read your article but dont know how to use it to reduce and use freed disk space.
    Thanks for any help

  29. Thanks for sharing.teknoloji

Leave a Reply

Connect with Facebook