VMware Cloud Community
sboyce
Contributor
Contributor

shrinking .vmdk disk files, ESX 3.5, Other Linux guest

Ok, so I'm working with this piece of software - which has a Linux kernel and no command line.

This software has astronomical disk space requirements that I currently do not have space for, but I barely managed to install it on VMware ESX Server 3.5 Update 2.

I am able to reduce the partitions using GParted, but I need to shrink the .vmdk file itself. When I use the virtual infrastructure client, I am unable to reduce the size of the disk. When I use VMware converter, I am not allowed to shrink it that way either.

Does anybody know how I can shrink the actual .vmdk file of an "Other Linux" type on the host ESX system?

Any help would be greatly appreciated.

Thanks in advance,

Sean

0 Kudos
5 Replies
kastro
Enthusiast
Enthusiast

You can not shrink VMDK disks anymore (it was possible in ESX 2.x). You could create new smaller VMDK, attached it to VM and then clone (ghost, acronis,...) OS from biger to smaller VMDK and afterwards remove the big VMDK.

Texiwill
Leadership
Leadership

Hello,

Moved to Virtual Machine and Guest OS forum.

If you use VMware Converter 4, there may be a chance you can shrink the disk. The other option is to create a new VMDK that is smaller then dd the image to the new VMDK from the old.


Best regards,
Edward L. Haletky
VMware Communities User Moderator, VMware vExpert 2009
====
Author of the book 'VMWare ESX Server in the Enterprise: Planning and Securing Virtualization Servers', Copyright 2008 Pearson Education.
Blue Gears and SearchVMware Pro Blogs -- Top Virtualization Security Links -- Virtualization Security Round Table Podcast

--
Edward L. Haletky
vExpert XIV: 2009-2023,
VMTN Community Moderator
vSphere Upgrade Saga: https://www.astroarch.com/blogs
GitHub Repo: https://github.com/Texiwill
sboyce
Contributor
Contributor

VMware Converter 4 won't allow me to shrink the disk.

Can you explain the dd process in more detail?

Thanks in advance

0 Kudos
Texiwill
Leadership
Leadership

Hello,

For the VM in question

1) create a second VMDK of the appropriate size.

2) Boot VM using some form of Live Media that allows you to access local disks

3) Partition the new VMDK to match the partition scheme on the original VMDK

4) For each partition run:

dd if=/dev/sda? of=/dev/sdb?

Note the ? should be the appropriate partition number

Do not forget to mark the appropriate partition on /dev/sdb as bootable.


Best regards,
Edward L. Haletky
VMware Communities User Moderator, VMware vExpert 2009
====
Author of the book 'VMWare ESX Server in the Enterprise: Planning and Securing Virtualization Servers', Copyright 2008 Pearson Education.
Blue Gears and SearchVMware Pro Blogs -- Top Virtualization Security Links -- Virtualization Security Round Table Podcast

--
Edward L. Haletky
vExpert XIV: 2009-2023,
VMTN Community Moderator
vSphere Upgrade Saga: https://www.astroarch.com/blogs
GitHub Repo: https://github.com/Texiwill
0 Kudos
BASCII
Contributor
Contributor

Hi, I have a linux guest (.vmdk) on a ESX3i server that i want to shrink to a low size....

I read your suggestion but i don't clear understand what you suggest...would you mind explain more deeply?

Thanks you very much.

Luca

0 Kudos