compacting an Ubuntu partition

Colin Law clanlaw at googlemail.com
Wed Jun 8 15:27:40 UTC 2011


On 8 June 2011 15:34, Karl Auer <kauer at biplane.com.au> wrote:
> Hi all.
>
> I have an 80GB HDD with about 5GB used. There used to be more like 75GB
> in use, but I have moved most of that to another disk. Now I want to
> virtualise the HDD. The HDD contains a bootable Linux system, all in one
> partition (except swap, of course).
>
> Virtualising 75GB of unused space is a waste of time and disk space, so
> I want to compact the HDD down to around 10GB, and virtualise that.
>
> gparted looks like it will do the job, but after reading the manual and
> various help pages it is still not clear to me whether gparted will
> preserve and compact the data on the HDD as part of the resizing
> operation.
>
> Can I use gparted in this way? Will it preserve the 5GB of data as it
> resizes the partition?

Yes, but note that you cannot resize a partition that is mounted.
Either unmount the disk (which can be done from within gparted) or, if
the partition contains the active OS, boot off an ubuntu live cd and
run from there, or download a bootable gparted image and boot off
that.

Make sure you have everything backed up first of course, whether your
data would survive a power fail during a resize, for example, I do not
know.

Colin




More information about the ubuntu-users mailing list