Today on Blogcritics
Home » Culture and Society » Science and Technology » Non-Destructive Partitioning with GParted

Non-Destructive Partitioning with GParted

"Grandpa, tell me a story."

"Okay, little Percival, let me tell you what partitioning was like in the old days. If you already had information on your hard drive, but wanted to re-partition it, all your data would be erased. There were programs available that would partition your drive without erasing all your stuff, but they cost money."

"Gee, Grandpa, that story sure did suck."

It's true. That story did suck. But it's also true that, unless you really, really knew what you were doing and were willing to spend a lot of time on it, repartitioning your hard drive would destroy your data. Commercial programs were (and still are) available to partition your drive without data loss, but they cost money. If repartitioning your hard drive is something you only do once in rare while (and for most of us it is) free tools may be a better option.

Let's back up a bit. What is partitioning and why would you want to repartition? In the simplest terms, partitions are separate areas on your hard drive. In Windows a single hard drive can be partitioned to look like separate drives, so that what appears to be drive C:, drive D:, and drive E: may all be separate areas of a single physical drive. In Linux they may appear as hda1, hda2, and so on. There are many reasons why a hard drive may be partitioned, but a very common one is to keep the operating system and user data separate. In this way if the operating system is to be upgraded or restored the user's data doesn't have to be touched, lessening the risk of data loss. Another reason is to control damage from runaway files. In Linux most log files are kept in the /var folder. Sometimes servers are set up to put /var in a separate partition. If a runaway process starts filling up a log file it can only fill up the partition /var is on, leaving the free space on the other partitions untouched.

GParted is a free utility that allows you to partition your hard drive without destroying your data. It is a Linux program, but can be used to partition filesystems for Windows (FAT16, FAT32, NTFS) and Mac OS X (HFS, HFS+) as well. A full listing of the filesystems and operations available can be found here.

GParted does many checks and is very safe, but keep in mind that the partitioning process is only non-destructive if everything goes well. I think GParted says it best with the message it gives you if you try to run as a regular user: Since GParted is a weapon of mass destruction only root may run it. Always back up your data before major operations on your hard drive.

Even if you're not running Linux on your computer you can still use GParted by booting from the LiveCD. The LiveCD is a small image (about 50 MB) that contains a stripped down version of the Gentoo Linux operating system, the Fluxbox window manager, and GParted. It's probably the easiest way to partition your hard drive, as you won't have to worry about unmounting partitions. It is dangerous to modify a mounted partition, and using the LiveCD ensures all partitions are unmounted unless you explicitly mount them.

Download the iso image and burn it to a CD. If you're running Windows your CD burning program should have an option to "Burn Image to Disc" or something similar. Don't just burn it as a data disk; it won't work. In Linux, if you're using Gnome, just right click the iso image and select "Write to Disc." With KDE right click the image and select "Actions," then "Write CD Image with K3B." Burn the CD, put it in the CD tray, and reboot.

About Steve R.

  • linuser

    Oh, it’s now actually possible to move the beginning of an ext3 partition when resizing it? Great, I didn’t know that, but very useful!

  • Steve Wild

    Thanks. Yes, open source repartitioning has come a long way in a short time. I was surprised at how much is possible to do. GParted can also do a lot more than was covered in the article, like cloning partitions.

  • Sunil

    OK, here’s something that happened. I needed space for my new distro. I’ve already got Windows XP and OpenSuSE 10.2. Since I had lot of space on the ext3 partition of linux, I resized the /home partition by shrinking it. But, ‘unfortunately’ it made is a unallocated partition. How do I make the new distro identify this new unallocated partition?

  • Barry

    Is that the same Percival from Lord of the Flies?