A Complete Guide: From Snapshot Removal to Partition Re-alignment

Running out of space on your Kali Linux VM? Increasing the disk size in VMware is only half the battle. You often find that the Swap partition (Extended) acts as a barrier, preventing you from expanding your main partition.

In this guide, we will walk through the entire process of expanding your disk from 50GB to 70GB, including how to handle VMware snapshots and re-create your Swap area.


📋 Prerequisites & Workflow

  1. VMware: Delete Snapshots (Required to unlock disk settings).
  2. VMware: Expand physical disk capacity to 70GB.
  3. Kali Linux: Use GParted to remove the existing Swap/Extended partitions.
  4. Kali Linux: Expand the Primary partition and recreate the Swap area.

1️⃣ VMware: Removing Snapshots 📸

VMware locks the “Expand” disk feature if any snapshots exist. You must consolidate them first.

  1. Shut down your Kali Linux VM.
  2. Go to VM > Snapshot > Snapshot Manager.
  3. Select your snapshots and click Delete (or Delete All to merge everything into the current state).
  • Note: This merges the data. If you want a safety net, manually copy the entire VM folder to an external drive before starting.

2️⃣ VMware: Expanding Physical Disk Size 📏

Once snapshots are gone, the “Expand” button will be active.

  1. Go to Virtual Machine Settings > Hard Disk.
  2. Click the Expand button.
  3. Change the “Maximum disk size” to 70GB and click Expand.
  4. Wait for the “Disk expansion successful” message.

3️⃣ Kali Linux: Cleaning Up Partitions with GParted 🛠️

Now, boot into Kali Linux. The OS sees the extra 20GB as “Unallocated Space,” but it is likely stuck behind an Extended partition.

  1. Launch GParted:
sudo apt update && sudo apt install gparted -y
sudo gparted
  1. Disable Swap: Right-click linux-swap and select Swapoff. (This removes the lock icon).
  2. Delete the Barrier:
  • Right-click linux-swapDelete.
  • Right-click the extended partition (the light-blue frame) ➡ Delete.

Result: You now have a large block of “Unallocated” space directly to the right of your main ext4 partition.


4️⃣ Expanding the Main Partition & Recreating Swap 🔄

  1. Resize Main Partition: Right-click your primary ext4 partition ➡ Resize/Move.
  • Drag the bar to the right, but leave about 2048MB (2GB) of unallocated space at the very end for a new swap.
  • Click Resize/Move.
  1. Create New Swap: Right-click the remaining unallocated space at the end ➡ New.
  • Create as: Primary Partition.
  • File system: linux-swap.
  • Click Add.
  1. Apply Changes: Click the Apply All Operations (Checkmark icon) in the toolbar.

5️⃣ Final Verification ✅

Open your terminal and run these commands to ensure everything is working:

  • Check Disk Space: df -h
  • Check Swap Status: free -h

💡 Pro-Tips

  • Fixing Boot Delay: If Kali takes a long time to boot after this, it’s because the Swap UUID changed. Update your /etc/fstab with the new UUID found via sudo blkid.
  • New Snapshot: Now that you have 70GB of breathing room, take a fresh snapshot as your new baseline! 📸✨

Enjoy your upgraded Kali Linux environment! If you run into any errors during the partition move, feel free to ask for help in the comments. 🚀