cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2027
Views
5
Helpful
3
Replies

Shrinking an ISE VM image

Arne Bier
VIP
VIP

#DearSanta

 

has anyone out there figured out how to shrink an ISE VM disk image (Thin Provisioned) to reduce the size of the .vmdk on the host?  A fresh install of ISE results in around 45GB disk image (for a Thin provisioned disk) - but after installing patches and upgrading, the disk starts growing.  I would not advocate this in a production environment but some of us lab users have SSD's and disk space is a bit previous :-)  Especiclaly when it's technically possible to reclaim all this wasted space.

it's quite easy with Windows OS because VMWare supports garbage collection (shrinking the unused space in the disk file).

In Linux OS you can do it with command

vmware-toolbox-cmd disk shrink /   (where  /  represents a particular mount point - can be run on any mount point)

 

But ... it requires the VMWare tools to be installed. 

And .. biggest challenge with ISE is even getting to the OS.  ###DearSanta :-)

My approach would be to stop the ISE application, then get to the root shell, and then put the OS into runlevel 1 (single user mode) - hopefully at that point all the processes are killed off and I can safely run the disk shrink.

 

In the past I tried mounting the .vmdk onto a CentOS system and then running the shrink command ... but it kind of killed the disk beyond repair.  Not sure why - in my opinion it should have worked.  Anyone tried that approach?

 

Any hints apreciated.  Please don't reply and say this is not supported etc - I know that already.  I am looking for some advice from the lab community. This is all at my own risk.  It's not for production use.

 

 

1 Accepted Solution

Accepted Solutions

Arne Bier
VIP
VIP

I had another go at shrinking my lab's ISE VM image and I was pleasantly surprised to find out that the following method actually works - I think I last time I tried this I accidentally mounted the partitions as ext3 and not as ext4, and that could have caused the corruption.

Here's what I did

Boot a VM running any Linux OS (I used CentOS 7)
Go to the Linux VM's settings and add another SCSI disk - choose all the defaults and select the ISE .vmdk that you want to shrink.
I used VMWare Workstation and I just selected Independent persistent mode

 

vmdisk.PNG

The disk will by recognised by the Linux OS - if you already have a SCSI disk mounted (it will be /dev/sda) then this second disk will be /dev/sdb - if in doubt, just run the command dmesg and then check which /dev/ was used for your newly added disk.

Now open a Linux terminal and become root user and make two directories

mkdir /mnt/ise2
mkdir /mnt/ise7

There are many partitions on the disk but the only two we care about are partition 2 and partition 7

Then mount the first of the partitions and then shrink the directory as follows

 

mount /dev/sdb2 /mnt/ise2
vmware-toolbox-cmd disk shrink /mnt/ise2


When that is done, the /dev/sdb7 partition is also worth shrinking

mount /dev/sdb7 /mnt/ise7
vmware-toolbox-cmd disk shrink /mnt/ise7

The shrinking speed is pretty slow. I am using Samsung EVO 860 SSD's and it was reading and writing at 1/10th of the normal speed (@50MB/s) - best to leave this running when you're not in a hurry.

Another tip - I discovered a lot of junk files lying around that I deleted and it made my ISE image a lot smaller. I won't go into a lot of detail here but suffice to say that my disk image is now around 32GB and still working really well. Before the shrinking operation, my disk was 110GB. That's quite a lot of SSD that got freed up :)

 

View solution in original post

3 Replies 3

Arne Bier
VIP
VIP

I had another go at shrinking my lab's ISE VM image and I was pleasantly surprised to find out that the following method actually works - I think I last time I tried this I accidentally mounted the partitions as ext3 and not as ext4, and that could have caused the corruption.

Here's what I did

Boot a VM running any Linux OS (I used CentOS 7)
Go to the Linux VM's settings and add another SCSI disk - choose all the defaults and select the ISE .vmdk that you want to shrink.
I used VMWare Workstation and I just selected Independent persistent mode

 

vmdisk.PNG

The disk will by recognised by the Linux OS - if you already have a SCSI disk mounted (it will be /dev/sda) then this second disk will be /dev/sdb - if in doubt, just run the command dmesg and then check which /dev/ was used for your newly added disk.

Now open a Linux terminal and become root user and make two directories

mkdir /mnt/ise2
mkdir /mnt/ise7

There are many partitions on the disk but the only two we care about are partition 2 and partition 7

Then mount the first of the partitions and then shrink the directory as follows

 

mount /dev/sdb2 /mnt/ise2
vmware-toolbox-cmd disk shrink /mnt/ise2


When that is done, the /dev/sdb7 partition is also worth shrinking

mount /dev/sdb7 /mnt/ise7
vmware-toolbox-cmd disk shrink /mnt/ise7

The shrinking speed is pretty slow. I am using Samsung EVO 860 SSD's and it was reading and writing at 1/10th of the normal speed (@50MB/s) - best to leave this running when you're not in a hurry.

Another tip - I discovered a lot of junk files lying around that I deleted and it made my ISE image a lot smaller. I won't go into a lot of detail here but suffice to say that my disk image is now around 32GB and still working really well. Before the shrinking operation, my disk was 110GB. That's quite a lot of SSD that got freed up :)

 

Nice guide, thanks for sharing!

Nice, i'm also going to give this a shot at home.  

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: