HowTo: Resize a Windows partition (including C: drive) using a free Linux Boot CD

Discussion in 'General Software' started by HyRax1, Nov 15, 2009.

  1. HyRax1

    HyRax1 ¡Viva la Resolutión!

    Joined:
    Jun 28, 2001
    Messages:
    7,874
    Location:
    At a desk
    Purpose: To resize a Windows-formatted partition where Windows does not provide its own tools to do so or cannot resize because the partition is a system partition (eg: C: drive).

    Scenario: I see the questions over and over. "How do I resize my C: drive without reinstalling Windows?" and "I need to resize my Windows drive, but I don't want to pay for a commercial tool to do it."

    Solution: Well, here's a step by step guide on how to use a free open source Linux Live CD (in this case, Ubuntu 9.10) to do just that.

    Disclaimer: This tutorial makes physical changes to the geometry of your drive's partitions. If you make a mistake it is absolutely conceivable that you can lose data. Whilst GParted has proven to be an extremely reliable tool, before making any significant changes to your system, you should have complete backups of any personal data that cannot be replaced if lost. You follow this tutorial at your own risk. Read the entire tutorial first before embarking on any actions.

    1. First up, download yourself a Linux Live CD. This tutorial makes use of Ubuntu 9.10 which you can download from the Ubuntu Project's Homepage or from OCAU's favourite local mirror. The ISO image is roughly 700MB to download. Alternatively you can use the GParted Live CD which is just the GParted tool (residing in a cut-down bare-bones Linux environment) that we will be using in this tutorial, which is only about 200MB, but the Ubuntu CD has a myriad of other uses so it would be in your best interests to grab that.
      .
    2. Next, burn the ISO to a CD using your favourite CD burning application. If you do not have one, then you can use InfraRecorder which is a free, open source CD burning tool for Windows.
      .
    3. Once your ISO image has been burnt to a CD, reboot your PC with the CD inserted and allow your system to boot up on the disc. The Ubuntu Live CD will present you with the following language selection (English is already selected, so just hit Enter):
      .

      Click to view full size!

      .
    4. Once your preferred language is chosen, you are shown a boot menu. Choose the FIRST option "Try Ubuntu without any changes to your computer":
      .

      Click to view full size!

      .
    5. Wait a few minutes while the disc starts up. NOTE: The Live CD may not work on all machines. If you encounter any graphical problems such as a blank screen for more than a few seconds without seeing a boot screen, then reset your machine, let the CD menu appear again and then before you elect to "Try Ubuntu", press F4 and choose "Safe Graphics Mode" and then choose the first "Try Ubuntu" option again as per the previous step.
      .
    6. Once booted into the Ubuntu desktop, go to the System menu, followed by the Administration menu and choose "GParted" from the menu. NOTE: If you are using a version of Ubuntu earlier than 9.10, then you will need to choose "Partition Editor" instead.
      .

      Click to view full size!

      .
    7. When GParted starts, it will scan your available hard-drives and display them, along with how much space is used by each partition (indicated by the yellow area). In this tutorial, we have a 10GB hard-drive with a single partition formatted using NTFS which appears in Windows as C: drive and it's roughly 40% full. I'd like to resize the C: drive so that it is shrunk to 8GB, leaving 2GB for me to create a D: drive with.

      To do this, simply right-mouse-click on the partition you wish to resize and choose the "Resize/Move" option from the menu.
      .

      Click to view full size!

      .
      NOTE: By default GParted will display the first drive. If you are resizing a partition on another drive, choose that drive from the drop-down selection box at the top-right of the GParted window, then choose your partition. Linux identifies drives using "/dev/sd?" for SATA and SCSI drives and "/dev/hd?" for IDE drives. The "?" is a letter. "a" is the first hard drive, "b" is the second hard drive and so on. Individual partitions are numbered from 1 onwards after the drive's device name, so "/dev/sda1" refers to the first partition on the first drive (usually your C: drive), "/dev/sdd2" refers to the second partition on the fourth drive, etc.
      .
    8. A new dialog box will appear to allow you to define what changes you wish to make to the partition. You may use the mouse to grab the slider to resize the top end or bottom end of the partition, or you may type in specific values into the numeric text boxes.

      In this case, I am going to grab the bottom end (right-side) of the partition and drag it left so that I free up 2GB worth of space by taking it away from the existing partition. Note that you cannot resize the partition smaller than the already-occupied space of the partition (indicated by the yellow area).
      .

      Click to view full size!

      .
    9. Once dragged over, you will notice the numeric values underneath the partition graphic also change in real time to show you exactly what the new size of the partition will be and how much free space there will be before and after the partition you are resizing. Note also that when you free up space on the end, you can grab the entire partition with the mouse and move it left or right within the freed space too!
      .

      Click to view full size!

      .
    10. Once you are happy with your changes, press the "Resize/Move" button at the bottom-right of the window. You will be returned to the main GParted window where you can review your changes before you commit them. A summary of what will be changed is listed in the lower pane at the bottom of the GParted window.
      .

      Click to view full size!

      .
    11. When you are ready to commit your changed, simply click on the green tick icon in the toolbar at the top of the window. You will br prompted to confirm your changes. Once committed, there is no going back!
      .

      Click to view full size!

      .
    12. Now sit back and watch as your resize commences. Depending on the size of the partition and any fragmented data to move out of the freed zone into other areas of the shrunken partition, this can take anywhere between a few seconds to several minutes to complete. NOTE: Resize and move operations can be sped up if you defragment the partition in Windows prior to employing GParted.
      .

      Click to view full size!

      .
    13. When the process is complete, GParted will tell you so. Click the close button to show your new partition layout.
      .

      Click to view full size!

      .
    14. We are now done. Close GParted by clicking the close button in the top-right corner of the window and go to restart your PC by clicking on the "ubuntu" name in the top-right corner of the screen and then choose "Restart".
      .

      Click to view full size!

      .
    15. When Ubuntu shuts down, you will be prompted to remove the CD and press Enter. Allow your system to reboot into Windows as normal. Windows may advise that it is going to perform a CHKDSK on drive C:. Let it go ahead and do it. Once completed, Windows will reboot your PC automatically again.
      .
    16. Allow Windows to start up again. Once logged in, if you now review the "Disk Management" tool, you will now find your drive C: is indeed showing that it has been resized and that the freed up space is unallocated, ready for you to create a new partition there as drive D: or whatever letter of your choosing.
      .

      Click to view full size!

      .
    17. Pat yourself on the back. :)

    Special Notes:
    • You do not need to use 64-bit Linux to resize a partition containing a 64-bit Windows installation. Ubuntu 32-bit can resize a 64-bit Windows installation and vice-versa.
      .
    • I have not tested GParted on a Windows drive encrypted with BitLocker or TrueCrypt. EDIT: Alvarez confirmed that GParted does not work with BitLocker'ed drives.
      .
    • Whilst GParted can resize and move logical volumes within an extended partition, it cannot resize or move the start of an extended partition (but it can resize the bottom end of it. Not entirely useful, I know). In such instances, if you are trying to expand a primary partition by shrinking an extended partition, you will need to backup your data in the logical volume(s), delete the logical volumes, delete the extended partition, THEN resize the primary C: partition before redefining your extended partition and logical volumes again. This issue should not impact you so long as you do not have any more than three primary partitions (Windows 7 users will already have at least two primary partitions defined - Reserved and C:). A given drive may have four primary partitions only, or three primaries and one extended partition within which you may have many logical volumes.
      .
    • You CAN create new NTFS partitions in GParted (eg: the D: drive we wanted to create in this tutorial), but it's probably better that you do it in Windows anyway.
      .
    • Should you wish to review the content of a partition, or to back it up without having to reboot back into Windows, you may access those drives via the Ubuntu Places menu at the top-left of the screen. If your partitions have labels, the label will be used, otherwise you will see a general identification of the partition as "200GB volume" or similar. A single drive system with three partitions on it will see three entries for those partitions appear in the Places menu.
      .
    • You may connect a USB flash or hard-drive that is FAT or NTFS formatted and copy data without the need for Windows to be run. When done, remember to safely disconnect the USB drive by doing a right-mouse on the desktop and choose "Safely Remove Drive". When the icon and any "writing data" notification messages have disappeared, you may safely disconnect the drive from the system.
     
    Last edited: Nov 17, 2009
  2. ni9ht_5ta1k3r

    ni9ht_5ta1k3r Member

    Joined:
    Feb 11, 2006
    Messages:
    33,683
    Location:
    地球・オーストラリア・シドニー
    basically, you want to resize the partition without destroying in the install?
     
  3. OP
    OP
    HyRax1

    HyRax1 ¡Viva la Resolutión!

    Joined:
    Jun 28, 2001
    Messages:
    7,874
    Location:
    At a desk
    Essentially, yes.
     
  4. Glide

    Glide Member

    Joined:
    Aug 22, 2002
    Messages:
    1,151
    Location:
    Was: Sydney Now: USA
    Nice guide. We have been debaiting weather to use it for a mission critical financial server where c: was created as a small partition and the idiots decided to install mysql instances on it, and went unnoticed until in production.

    Consequenly the server now has 600mb free space, after about a year of updates and patches.

    Luckily, we are migrating the server to new hardware and virtualising will allow us to resize c: :)
     
  5. scrantic

    scrantic Member

    Joined:
    Apr 8, 2002
    Messages:
    1,700
    Location:
    3350
    Not to take away from your tutorial but could you just use the gparted live CD supplied on sourceforge saving half the trouble?
     
  6. alvarez

    alvarez Member

    Joined:
    Jun 25, 2006
    Messages:
    2,621
    Location:
    Geelong 3218
    I can confirm that bit locked drives do not play nice with gparted, Haven't tried true crypt but I would assume its the same.

    However vista and 7 have their own partitioning and resizing tools that seem more than adequate.
     
  7. CirCit

    CirCit Member

    Joined:
    Apr 4, 2002
    Messages:
    143
    what would cause gparted to take several hours for a simple resize?

    partition magic used to be bang done. but i managed to make gparted take 6 hrs for 1 partition resize...

    should there be such a big difference... it seemed to be "testing" the process instead of just doing it.
     
  8. LINUX

    LINUX Member

    Joined:
    Sep 18, 2001
    Messages:
    3,062
    Location:
    Dudley, Newcastle
    If it needs to move any data it'll take a long time. It's probably only instant if you're expanding into free space.
     
  9. GregDude

    GregDude Member

    Joined:
    Aug 12, 2002
    Messages:
    1,280
    Location:
    Brisbane
  10. CirCit

    CirCit Member

    Joined:
    Apr 4, 2002
    Messages:
    143
    what u cant do in win 7 and vista is make a partition smaller... and make it occupy the end of the space its in

    say a 50gb partition
    shrink to 25 but leave a 25gb hole then the 25gb partition
     
  11. OP
    OP
    HyRax1

    HyRax1 ¡Viva la Resolutión!

    Joined:
    Jun 28, 2001
    Messages:
    7,874
    Location:
    At a desk
    I mentioned that in the very first step... But besides, aside from the desktop type and launching GParted in general, the instruction is identical for the GParted Live CD.

    Having the Ubuntu CD is more than just GParted, though. It's also useful for restoring the standard Windows bootloader if you haven't got a Windows CD handy to run the recovery console. It's also handy for using dd to take an image of the drive or partition. It's also useful to fire up if Windows won't boot and you need to take an impromptu backup of files to a USB drive, it's useful for getting the machine on the 'net to download the Windows drivers if no other machine is available, etc.
     
  12. Rezin

    Rezin Member

    Joined:
    Oct 27, 2002
    Messages:
    9,488
    Why would you want to do that?
     
  13. pH@tTm@N

    pH@tTm@N Member

    Joined:
    Jun 27, 2001
    Messages:
    1,987
    Location:
    BRISBANE
    If you can live without a GUI, use the built in diskpart in windows. has worked great for me many times on servers and vista etc
     
  14. CirCit

    CirCit Member

    Joined:
    Apr 4, 2002
    Messages:
    143
    to push vista toi the middle of the disk so you could put 7 up frount
     
  15. tyga

    tyga Member

    Joined:
    Mar 22, 2002
    Messages:
    58
    Location:
    Melbourne
    I prefer to use the partedmagic live cd from http://partedmagic.com/

    It has some nice features like gparted live cd but also includes test disk http://www.cgsecurity.org/wiki/TestDisk which is an absolutely awesome life saver for recovering messed up partitions in the event that you may have inadvertently screwed them up and windows refuses to load for example.
     

Share This Page

Advertisement: