Resizing and Adding Partitions using GParted Live
Andrew Lambert
- February 23, 2009
- Read 116,509 times
Table of Contents
- Introduction
- Prerequisites and Assumptions
- Preparing your computer to use the GParted Live CD
- Using the GParted Live CD to resize your partitions
- Creating a new partition with GParted
- Conclusion
This tutorial focuses on using GParted, or Gnome Partition Editor, a free and open source partition editor. To use GParted, you must first download the CD Image file (.iso file) of GParted Live for this program. Instructions on where to find and how to burn the GParted ISO file are covered in the Preparation step. In this tutorial we will be using Microsoft Windows XP for certain steps. If you use a different version of Windows, some of these steps and screens may be a bit different.
This tutorial outlines the process of changing the volume structure of your hard drives and therefore has the potential of damaging the data stored on them. With this said, the actions and methods described in this tutorial can be potentially dangerous. While this tutorial endeavors to instruct you on how to safely resize your partitions with no data loss, it is important to read and follow all instructions carefully.
This tutorial also assumes that you, the reader, have a basic understanding of computers and are comfortable with using system management tools. Also, a basic understanding of the terminology is required. For those who need a primer on this material, an introduction to Hard Disk Partitions can be found in the Understanding Hard Disk Partitions tutorial.
When you purchase a computer it is not uncommon for the computer's partitions to be setup in a way that you have a small C: drive and a large D: drive. Over time you will quickly find that you do not have any free space on your C: drive, but your D: drive has plenty of space available. As most programs, by default, are installed in the C drive and because you need space on your C: drive for certain Windows functions, like printing, you find that your lack of space has become a problem. What is frustrating is that you have all of this space on your other partition, but can't use it.
Thankfully, this is not true. In fact, it is possible to resize partitions so that you can take space away from one partition that has a lot of free space and add it to another that does not. This tutorial will walk you through resizing your computer's partitions using the GParted program. GParted, or Gnome Partition Editor, is an open source partition editor that allows you to manipulate a computer's partition tables, including resizing them, and can be used on almost all partitions created by Windows or Linux. In this tutorial we will use the GParted Live CD, which allows you to create a bootable CD that contains the GParted programs. As already stated, this tutorial should only be used by advanced users who understand the technology behind volumes, partitions, file systems, and bootable CDs. If you feel comfortable with this material, please continue.
Preparing your computer to use the GParted Live CD
The first step is to download the latest version of GParted Live. GParted is distributed as a CD image, or ISO, file that needs to be burned onto a CD. For information about ISO files and how to write them to a CD please read the How to write a CD/DVD image or ISO tutorial. The latest version of GParted as of this writing is 0.4.1-2 and can be downloaded from the following link:
Once the file is downloaded please burn the image to a CD and then store the CD in a safe place. We first need to perform some basic maintenance on the hard drive before we use GParted. These steps will make the entire process safer, smoother, and faster.
The first maintenance task is to run chkdsk or fsck to repair any errors that may currently be present in the file system. Even under ordinary use your average file system gets errors. Normally, operating systems such as Windows or Linux are able to either correct these errors silently, or ignore them altogether. When this is not the case, though, chkdsk for Windows or or fsck for Linux will be forced to run at boot time in order to attempt to repair these errors. Another important reasons to do a disk check before we run GParted is that GParted will usually refuse to do anything to a partition whose file system has errors or is damaged.
To perform a full disk check in Windows 2000/XP do the following:
-
Open My Computer
-
Right-click on the drive you want to perform the check on.
-
Select Properties from the menu
-
In the Drive Properties window, click on the the Tools tab
-
On the Tools tab, click on the Check Now button.
-
In the window that pops up, put a checkmark in both of the checkboxes and the click on the Start button.
-
You should get a message that the check could not be done because the disk is in use. It will then ask if you wish to perform a boot-time check. You should allow this to happen.
-
Repeat steps 2 through 7 for each drive you would like to perform a check on.
- When you have performed these steps on each of the drive letters, restart your computer to initiate the check. Depending on the size of you disk, this can take a while. Go get a cup of tea and relax until it completes.
Figure 1. Setting Up The Disk Check
Figure 2: Windows XP performing Check Disk on the C: Drive
When the operating system finishes perform the disk check it will continue booting like normal. Therefore, when you are at your desktop or login prompt, you know the disk check has been completed. If you would like to know what was found during the CHKDSK, you can open the Event Viewer to see a log of the activity. To access the event viewer, open your Control Panel, and then double-click on the Administrative Tools folder. In this folder you will find the Event Viewer program. Double-click on that program to start it, and when it opens, click on the Applications category. In the panel on the right click on the latest entry that has a source of Winlogon. This will open up the log for the latest Chkdsk scan.
The next step is to defragment the partitions that we will be resizing. Defragmenting will reduce the time required to resize significantly. For more information on defragmenting and why you should do it, you can read The Importance of Disk Defragmentation tutorial.
To start the Defragmenter utility in Windows 2000/XP, do the following:
-
Open My Computer
-
Right-click on the drive you want to defragment.
-
Select Properties from the menu
-
In the Drive Properties window, click the Tools tab.
-
On the Tools tab, click on the Defragment Now button
-
The Disk Defragmenter utility will launch. Click the Defragment button to initiate the degragmentation process.
Figure3: Defragmenting Under Windows XP
When it has finished you can close the Disk Defragmenter program and continue with the rest of the tutorial.
Using the GParted Live CD to resize your partitions
By now you should have defragmented and run checkdisk on the hard drives you want to resize. You should now insert the GParted Live CD you created in the previous steps into your CD/DVD drive and restart your computer.
Note: You may need to change the boot sequence in you BIOS to boot from the CD drive.
Once you boot from the CD, you'll see the GParted boot menu, as shown in the Figure below.
Figure 4: GParted Boot Menu
For most computers, you can simply press the Enter key here to accept the defaults.
From here GParted gets to work on creating a mini-Linux setup that runs entirely in memory and from the CD itself. You'll be asked about two things during this period: your keymap and language.
The default settings for these are a standard QWERTY keyboard and US English respectively. To use these, simple press Enter when asked (see Figures 5 and 6.)
Figure 5. Selecting the keymap
Next, it will ask you for your language.
Figure 6: Select Language
After selecting your keymap and language preferences, wait for GParted to finish booting. When it's finished, you should see a screen similar to Figure 7 below.
Figure 7: GParted is ready
This is the main screen of GParted. Note the green-edged box. This represents the Primary Master hard drive (hda) and all the partitions currently on it. At this point, there is only one partition on our example drive. Your drive may have more.
Note: If you are going to be working on a disk other than the Primary Master, you should select the appropriate drive from the drop-down menu on the upper right as shown designated by the red arrow. On a standard system with two drives connected to the Primary IDE channel, the drives should be labeled hda (master) and hdb (slave). For more information on determining which drive is which, see here.
Now that you have selected the drive you want to work on, it's time to get to work.
Unless your hard drive is brand new, your hard drive likely already has one or more partitions on it. In order to add a partition, or enlarge an existing one, you must first shrink one to create some free space. Right-click on the partition you want to shrink, as shown in figure 8 below, and select Resize/Move.
Figure 8: Right-click menu
This will open a smaller window with another box which represents your hard drive as seen in the figure below.
Figure 9: GParted's Representation of Your Hard Drive
At this screen there are two ways in which you can change the size of the existing partition. The first is by by clicking and dragging either of the black arrows to make the partition smaller or larger, or by manually entering the new size of the partition. in the New Size (MiB) field. These methods are shown in Figure 10 below.
Figure 10: Resizing
When you have finished adjusting the size, click the Resize/Move button. This will close the Resizing window and bring you back to the main window. At this point, no changes have been made. In order to make these changes effective you must first click on the Apply button. Notice, in the example above we are shrinking the existing partition from 4,793 MB to 3,614 MB. When it has completed, this will give us an additional 1,179 MB to use as we see fit.
Figure 11: last chance!
Once you click the Apply button, GParted will start resizing your partition as shown in Figure 12.
Figure 12: GParted doing its thing.
The resize process can take a while depending on how big your drive is and how much the partition's size was changed. So, you may want to go and get a nice cup of tea and relax.
Now that there is some free space on the drive we can either make another partition larger, or we can add a new partition to it.
Using the GParted Live CD to resize your partitions
In this tutorial we are going to take the free space we just created and allocate it towards a new partition.
To do this, right-click on the Unallocated part of the drive and click New as shown in Figure 13.
Figure 13: Creating a New Partition in the Unallocated Space
This will open the Create new Partition window as shown in Figure 14 below.
Figure 14: The New Partition Window
Using the black arrows, or by entering a number in the New Size (MiB) box, you can adjust the size of the new partition. By default, the new partition will use all available contiguous space. Once you are happy with the size of your new partition, you need to select the file system it will use. GParted supports many different file systems, as shown in Figure 15.
Figure 15: Selecting a File System
Unless you have a reason not to, for example if you needed to create a logical volume within an extended partition, you can leave the Partition type alone.
After selecting your file system, click the Add button. As before, nothing is done until you click the Apply button as shown in Figure 16.
Figure 16: Ready to go
Creating the new partition should go much faster than resizing the original one, so no time for tea I'm afraid.
Figure 17: All Done!
You now have two partitions where once was one. Simply click the Exit button to reboot your computer.
Now that you see how easy it is to resize your computer's partitions, you should never have to worry about have not enough space in one partition and too much in another. Using the GParted Live CD allows you to easily resize, create, move, and delete partitions on your computer. If you need help with resizing tutorials, please post your question in the forums.