Over the past year or so there have been a few times where I’ve need to expand a disk attached to a Debian system. Now this isn’t a hard task by any means, and may not even warrant a blog post, but the matter of it is that I always seem to forget the steps I need to take to get that unallocated space that I’ve added next to my actual EXT3 partition since the swap partition is always in the way! So, I thought I would just throw up how I’ve done it in the past in hopes to maybe help a few others that visit, but more-so for myself and my memory (or lack there of). Now keep in mind I’m sure there are ways to perform this exact same thing without taking the VM online, or I’m sure there are other ‘better’ ways to achieve the same results, but this way has worked for me consistently so it’s what I chose to do. Any other suggestions are certainly welcome in the comment box below.First off, you will need to expand your drive from within the vSphere Client, not rocket science here, pretty simple to do. Next, get yourself a copy of gparted and mount the ISO to your VM and reboot booting into the gparted interface (accept all defaults for keymap, X, and resolutions, unless of course you like playing…). So the first thing you will notice inside gparted is that the swap partition is right smack in the middle of your EXT3 partition and the unallocated space. Normally, you could just resize the EXT3 partition and consume the unallocated space, but with swap there you can’t.
Source: Expanding a Linux disk with gparted (and getting swap out of the way) | mwpreston.net