How To: Repartition Your Hard Drive For Free Without Formatting or Losing Data

Partitioning your hard drive has never been easier. Free options, including the Windows install disk, make this once monumental task a fairly simple two-click experience that many of us don’t spend nearly enough time thinking about when we first install our OS’s. It can sometimes be difficult to anticipate your storage needs up front, and many users just assume they are stuck with decisions they made long ago.

A typical user could have many reasons for breaking up a hard drive into multiple volumes, but partitioning your drive after installing an OS is typically a destructive proposition -- one that usually involves backing up your data, formatting, and starting clean. Commercial solutions such as Norton Partition Magic has existed for years and allows you to preserve your data while resizing volumes, but what if you’re working on a limited budget (or completely without one)? That’s where GParted comes into play. This free and open source disk partitioning tool was designed for Linux, but luckily for us Windows users, it comes bundled in a live CD or USB version called Parted Magic which takes care of the Linux requirement.

In this guide we will look at how to use the interface to resize, delete, or create new partitions, all without losing your data or starting over. This will come in handy if you made your Windows partition too large or too small, or if you’re happy with Windows XP, but want to give Vista a spin. Backups are still heavily advised, but with our help, and a bit of luck, you won’t need them. Read on!

What you'll Need:

* A PC With At Least 1 Disk Drive and 300 Megs Of RAM * A Backup of Your Data (Just a Precaution!) * 30 Minutes For Each 100 GB of Hard Drive Space Resized (Estimate)

To begin, we must convert our newly acquired iso file to a bootable CD. You can use either your existing CD burning software, or a free alternative such as InfraRecorder. Once this is completed the CD should be moved to the bootable optical drive on your PC. For the USB drive version simply unpack and copy the files over to your USB thumb drive. Make sure you have a backup of your important data and restart your machine.

Having trouble getting your system to boot from the CD/DVD or USB drive? Read below. Otherwise, skip to step 2.

Some computers are not set up to boot from the CD/DVD drive or USB. If your system fails to boot into the Parted Magic options menu (shown below) then there may be a few configuration issues you will need to review. You either need to invoke the boot selection menu (the F-key to access this should be shown at the top or bottom of your screen immediately after power up). A trip to the BIOS will otherwise be required to make a permanent change. Once you enter the BIOS, look for an option called “boot order”. In most cases you use the + or – key to advance the device of your choice up or down the priority list. Upon completion of the boot order change, make your way over to save option and reboot.

2. Boot Into Parted Magic

Select option #1 – Default settings (Runs from RAM / Ejects CD). After selecting this option, you will see the OS copy itself into your system memory and boot into the front end interface. Once it has fully finished booting, the CD tray will eject the disk and is now fully operating from RAM.

3. Use The Built in Partition Imager to Backup Your Files (Optional)

Click the Icon of the wrench and hammer and select Image Partition

The default Partition Imager interface is a bit clunky if you're accustomed to a sleek GUI. If you own an alternative solution such as one of the free suites offered by most hard drive manufacturers, feel free to use that instead. To navigate through the interface, use the arrow keys to select different options and the TAB key to move between fields. This will allow you to create a sector by sector clone of your volumes just in case something goes wrong with the partition. Keep in mind that you’ll want to save the images to a hard drive that you aren’t resizing. A USB hard drive does the trick quite nicely if you have one that's big enough. We prefer this method because we can backup my data and physically unplug the device, thereby removing it from harm’s way.

4. Launch GParted Partition Editor

Down in the lower tray you will find the various operating system functions, the one we are interested in is the GParted Partition Editor (circled in the image above). We now need to take a close look at our partition and what we can and cannot do, as well as what we should and should not do.

5.) How to Use the GParted Interface and Understand Your Drive Configuration

It’s important to understand your limitations when it comes to partitioning an active drive, especially one that contains a bootable OS. We will use examples in the above screenshot to explain these limitations. This screenshot represents an extreme scenario, a drive with 3 preexisting partitions, and two active operating systems. Before we go any further we need to understand what each section means.

1.) Hard Drive Selection - This is the Hard Drive currently selected for partitioning, which in this case is a 150 GB Western Digital Raptor. To Change to a different drive simply use the pull down menu and select the appropriate device (these can even be USB).

2.) Partition #1- This block represents the first preexisting partition which carries the designation /dev/sda1. By looking at the table below (Item #5) we can see the file system is NTFS, the label is Windows XP, and the used/unused space. The Windows XP label was set by me when the drive was formatted. If you have not assigned these labels you will need to figure out based on the size, what each preexisting partition is. Notice the small grey block beside this partition? Grey blocks represent unpartitioned space, it cannot be used by an OS until it is properly partitioned and formatted into a volume.

3.) Partition #2 - This block represents the middle preexisting partition which carries the designation /dev/sda2. By looking at the table below (Item #5) we can see all features of this block including the label Windows Vista. It is important to note that this partition follows /dev/sda1. The importance of this will be clear by the time we finish this section.

4.) Partition #3 - This final preexisting partition carries the designation /dev/sda3 and represents the trailing sectors on the hard drive.

5.) Partition Information – This is where you will see the details of your partitions, review this information carefully to help you identify what is on each.

Lets look at bit more closely at the different scenarios you may encounter based on the above configuration. If you only have one partition on your hard drive (represented by a solid block), your task is a simple one. You will simply be breaking off a chunk from the end of your main partition and formatting it with a file system. It’s simple, and carries minimal risk. But if you have multiple partitions, with two or more bootable OS’s (such as the above scenario), the recommendations below are targeted at you.

What If I want to resize the first block /dev/sda1? – (Label: Windows XP)

When dealing with bootable partitions we will always want to protect the front sectors when resizing whenever possible. In the above scenario the first two blocks /dev/sda1 and /dev/sda2 represent operating system partitions, Windows XP, and Vista respectively. The third partition /dev/sda3 is a mostly empty swap volume for both operating systems. If I want to add space to the first partition it will need to come from the unallocated grey block directly to the right of it (which in this case is only 5 MB), or from the beginning of /dev/sda2 (Windows Vista). Sectors cannot be taken from /dev/sda3 (OS Shared) because it would not be contiguous.

What If I want to resize the second block /dev/sda2? – (Label = Windows Vista)

Sectors removed from the front of this partition can be added to /dev/sda1 and sectors removed from the back can be added to /dev/sda3. In either scenario, the space could also be use used to form a new partition. If we wish to add space to this partition we will first need to free up sectors from either of the other two volumes.

What if I want to resize the third block /dev/sda3? – (Label= OS Shared)

If we remove sectors from this partition, they can either be added to /dev/sda2 (Windows Vista) or formatted into a new separate partition. They cannot be added to /dev/sda1 since partitions need to be contiguous. If we wanted to add to this partition, the space could only come from /dev/sda2 (Windows Vista).

6. Resize Your Partition

At this point we assume you have studied step 4 and understand the limitations of working with an active drive and can clearly define where you will take the space from, and what you will do with it. To resize your partition simply double click on the appropriate partition and manipulate the various options.

Free Space Preceding – Take sectors from the beginning of the partition which can be attached to any partition directly to the left of it, or formatted into its own volume.

New Size – Space remaining on the partition once all other fields are manipulated. You can enter a number in here if you know exactly how much space you wish to have remaining.

Free Space Following – Take sectors from the end of the partition which can be attached to any partition directly to the right of it, or formatted into it’s own volume.

Create As: - This is only seen if you are creating a new partition using unallocated space. Select Primary Partition if you plan on having fewer than 4 partitions on this particular drive, or if you plan on installing an operating system on it.

Filesystem: - If you’re a Windows user you’ll likely want to choose NTFS. If the drive will be used for Linux instead choose either EX2 or EX3. If you pick the wrong one don’t panic you can always format it with a different file system later on.

Lets assume I want to delete the third partition /dev/sda3 (OS Shared) and add these sectors to /dev/sda2 (Windows Vista). Highlight the partition and click the delete icon at the top. The screen shots below shows the transition.

/dev/sda3 (OS Shared) is now represented as grey unallocated space that can be added to /dev/sda2 or broken into multiple additional partitions. From here I double click the /dev/sda2 partition and increase the size to use up the unallocated space.

/dev/sda2 (Windows Vista) size has now increased from 68.35 GB to 109.74 GB.

Once you are satisfied with the changes click apply (Circled Above) and kick back while GParted moves your data out of harm’s way and resizes the partitions to the new configuration. Note that absolutely nothing happens until you click apply. If you cancel out using the X in the top right, the changes are abandoned and you are back where you started. Additionally, make sure you pay your hydro bill in advance and use a UPS if possible. A power outage during this procedure can cause all sorts of problems that you may, or may not be able to fix without starting over and reinstalling Windows. We hope you took our earlier advice and made a backup!

7. Repair Operating System Partitions That Will Not Boot (Hopefully Optional)

It is very common for Windows to report a problem on boot up after resizing the partition it is installed on. In most cases it will run a check disk and inform you all is well. But what if you OS won’t boot at all? This happens most often when you remove sectors from the front of your bootable partition. Common errors are typically related to boot.ini. The quickest, and easiest way to solve this problem is to pop in your Windows CD and follow the repair this computer option. During my testing, we weren’t able to cause any boot issues that the Windows repair tool couldn’t solve.