TweakHomePC

Dual-booting all versions of Windows and Linux

   Dual-Boot    |    Win 8    |    Win 7    |    Vista    |    Win XP/2K/NT    |    Win9x/Me    |    How to    |    Legacy 9x Tweaks    |    SiteMap   


 

Here: Home > How do I ... >


Use GParted to Resize the Windows 7 or Vista Partition

Last reviewed: May 2010

On this page:
• About using Resize in GParted
• Prepare to Defragment
• Defragment with PerfectDisk10
• Use GParted to Resize the Windows 7 or Vista partition
• Help! Windows failed to boot after Resizing with GParted

About using Resize in GParted

When you resize a partition, ordinary files on the selected partition area are automatically moved to an earlier part of the partition to create new contiguous Unallocated space at the end where the new partition(s) can be created. This is easy when there are no unmovable files towards the end of the partition.

For many users those unmovable files will stop the resizing process far too soon. The unmovable culprits' virtual memory (paging file) and hibernation can be stopped beforehand and restarted later. So can the unmovable VSS shadow copy by turning off Restore Points. Another major culprit is the Master File Table (MFT) which can be anywhere on the disk (even at the very end of it!) and this cannot, and must not, be switched off even temporarily. Disk Defragmentation will not touch any files marked as unmovable.

Raxco's defragmenting utility, PerfectDisk10 Professional, will gladly relocate all unmovable files including the MFT. You can download it for a free 30-day trial period. Relocating very many files, some quite large, can be a very time consuming exercise. It's pointless spending a lot of time moving unused or unnecessary files. To this end, a good disk cleanup and a thorough disk defragmentation is desirable before you start. It will improve your hard disk performance and should even speedup the resizing process!

Using GParted to resize your Windows partition may make your computer unbootable! You can expect the Windows installation DVD to fix this but the fix cannot be guaranteed in absolute terms. Also, you still need to cleanup and defragment the target partition so there is little to be gained by using GParted instead of the in-built Shrink in Windows 7 and Vista. GParted is a wonderful and free tool often used by this site. However it's usefulness in this situation is questionable. If you must use GParted in this situation, be sure you uncheck (to clear) the Round to cylinders box when using GParted.

It's recommended that you use Shrink in Disk Management to resize the partition and not a third-party utility - play safe and let Windows do it. If the space achieved is inadequate, you can switch off unmovable files and defragment with an evaluation version of PerfectDisk10 Professional before you run Shrink.

Prepare to Defragment

You will not want Resize to spend a long time relocating files that are not required. Other files are possibly huge and can be recreated by Windows later. Nor will you wish to risk some unmovable files stopping the process before enough empty space has been gained. You can avoid this with just a few minutes work! Any changes made must be reset later.

To maximize you chances of total success you should complete this section, then use PerfectDisk10 to defragment, and finally use Resize in GParted.

  1. Backup important data before making any changes to a partition. You can burn files to a CD, clone an image of your hard drive, copy files to a USB flash/pen/thumb drive or to a network location, or use an USB external drive (good choice)
  2. Download, install, and run Ccleaner (freeware, 3 MB) or at least clear out much rubbish with Disk Cleanup Wizard (Start > All Programs > Accessories > System Tools > Disk Cleanup).
  3. Disable System Restore and VSS (Control Panel > System and ..... > System > System Protection - clear the Win7/Vista tick box, click Apply.
    Note: Disabling System Restore automatically removes all previously created Restore Points so enable it later.
  4. Disable the pagefile - Virtual Memory (Control Panel >System and ..... > System > Advanced System Settings > Advanced tab > Settings button in Performance > Advanced tab > Change button > Uncheck automatic setting, select No Paging File (or make it very small), click Set button, click OK.
  5. Disable Write Debugging (still in Advanced System Settings > click Settings button in Startup and Recovery > click the drop-down under 'Write debugging information', note the current entry, and then select None.
  6. Disable Hibernation (right-click Command Prompt in Accessories, select Run as administrator, type powercfg.exe /hibernate off).
    Use 'powercfg.exe /hibernate on' to re-enable it.
  7. Restart computer.
  8. Delete C:\Pagefile.sys file (if it's not visible, read How to Show Hidden Files in Windows.

[top of page]

Defragment with PerfectDisk10

  1. Download and install PerfectDisk10 Professional (Perfect Disk has a 30 day evaluation version).
  2. Close all programs correctly and Restart Windows 7/Vista.
  3. Run PerfectDisk. Check for and install updates (click on Product Resources or Help, and click Check for Updates).
    • Disable your Internet Connection.
    • Exit your Anti-Virus software.
    Click AutoPilot Scheduling in PerfectDisk.
    Click One-time scheduled defragmentation. A new window will appear.
    • In Schedule Name, enter a unique name.
    • In Select Drives, tick your Windows partition (probably C:).
    • In Defrag Method
      • Tick Reclaim Free Space before defragmentation, and tick both sub-entries.
      • Tick Defragment Files, and tick Consolidate Free Space.
      • Tick Offline Defragmentation of system files, and tick all sub-entries.
    • In Time and Date, accept the default (Run Now will actually be used).
    • Click Finish. The new window will close.
  4. Click the Run Now button, and then the Reboot Now button that appears.
  5. During startup, you'll see Starting boot-time defragmentation pass on screen
    PerfectDisk10 will quickly defragment and move the NTFS system files after which Windows will load and run.
    • When Windows is back again, PerfectDisk10 should continue to defragment and move all the ordinary files. It's probably running in the background (check for substantial disk activity and wait). If not, run PerfectDisk10 yourself, enable Consolidate Free Space and click Start.
    • PerfectDisk10 will probably do a second reboot but will be finished when Windows next appears.
    • To view the results of your efforts, run PerfectDisk10, highlight the partition, and click the Analyze button
      (use the Statistics tab to view Excluded Files details).
  6. Enable your Anti-Virus software, and then your Internet Connection.
  7. Restart computer.

You can now Use GParted to Resize the Windows 7 or Vista partition and expect to gain adequate space!

[top of page]

Use GParted to Resize the Windows 7 or Vista partition

Following these steps should help towards a successful outcome.

  1. Your Windows 7/Vista installation DVD is essential so make sure you have it
    or download NeoSmart's Vista Recovery Disk and create the bootable CD.
  2. Download the latest Stable release of GParted Live CD (ver 0.5.1 or higher) and burn it to CD.
  3. Prepare to Defragment (as above) - at least turn off Restore Points (turn back on later).
  4. Defragment the target partition (as above).
  5. Label the Windows partition wn_7 or Vsta for clearer identification.
  6. Restart computer and insert GParted Live CD (do NOT skip this restart).
  7. Reboot from GParted Live CD. It takes you straight into GParted.
    • Right-click the wn_7 or Vsta partition, and click Resize/Move
    • Drag the right of the bar from right to left until you achieve the size you need
      (the Free Space Preceding must be 0).
    • Uncheck the Round to cylinders box (that's important for Win7/Vista).
    • Click Resize/Move button (it will not actually resize yet).
    • Click Apply if you are satisfied, otherwise click Undo (resizing can take some time).
    • Click OK for Operation Complete.
    • Create new partition(s) if you wish but DO NOT FORMAT any (select Unformatted).
    • Double-click Exit
  8. Check Disk will run when you reboot (do NOT stop it - Windows is adjusting to the new disk geometry).
    Restart again (and be glad you have Windows back!).

If you temporarily disabled items in Prepare to Defragment above, you must undo all changes now.
Don't forget this - it's of considerable importance.

Create a new Restore Point now.

Finished!

If you want to rename the Windows Vista (Recovered) entry in the menu list back to normal, you can use Neosmart's EasyBCD v 1.7.2 or later (free - edit Win7/Vista boot loader)..

HP Pavilion users please note that the GParted web site contains the following warning (June 2009). Check there for updated information.
///WARNING/// Due to a hardware/firmware bug, it's _NOT_ recommended to run GParted live on some types of HP Pavilion machines. Otherwise your VGA card fan might be dead. For more info, please refer to this bug report.

[top of page]

Help! Windows failed to boot after Resizing with GParted

GParted is a very useful utility for many drive/partition purposes - and it's free!

Unfortunately, some users will find that Windows 7 or Vista fails to boot after using GParted to resize a partition. This is especially true if the 'Round to Cylinders' option is left ticked - enabled is the default setting and should be changed to disabled before Resizing with GParted with Windows 7 or Vista.

Your Windows, and all its files, are still intact. You simply need to inform Windows (or help Windows to inform itself) of how and where to access its own files! It's recommended you correct the situation in the following order. It may take a little time but will be worth every minute.

  1. You may need to repair the Startup using a Windows 7 or Vista installation DVD, or even NeoSmart's free Windows System Recovery Disk.
    • Bootup from a Windows installation DVD.
      • Press a key when you see Press any key to boot from a CD or DVD.
      • Select your Language and then Time....
      • Select Repair your computer (bottom left of the Install now screen).
        An automatic check of your system will run.
      • Select Repair and restart
        Windows 7 should boot (quite likely). Do NOT stop Check Disk running.
        Continue here only if Windows will not boot.
    • Bootup from a Windows installation DVD again
      • Select Repair your computer again.
      • In System Recovery Options, select Windows 7, and click Next.
      • Select Startup Repair.
      • Click Finish when it's complete, and then Restart.
        Windows 7 should boot normally.
        Continue here only if Windows will not boot.
  2. The master boot code may have been unacceptably altered by GParted. Bootsect.exe /nt60 updates the master boot code with code compatible with Win7/Vista's BOOTMGR.
    • Bootup again from the Windows installation DVD
      • Select Repair your computer
      • Select Windows 7 or Vista
      • Select Command Prompt
      • Use DIR command (DIR C: or DIR D: etc) to identify drive letter allocations (sizes and Labels will help), and type in:
        X:\boot\bootsect.exe /nt60 C:
        (where X: is your DVD drive letter, and C: is the installation drive for Win7 or Vista).
        Type EXIT, and click Restart.
      Windows should boot normally.
  3. Finally, you may need to use the excellent free TestDisk utility to recover the boot sector of your installed Windows 7 or Vista. TestDisk is very useful and effective but is designed for experienced computer users. Follow these instructions exactly as stated and exit TestDisk if you are unsure of how to proceed.
    • Run TestDisk > Create a log file (optional)
      • Select the hard disk
      • Select Intel partition table-type
      • Select Advanced / Filesystem Utils
      • Highlight your Win7/Vista Partition (it's size helps identifying it)
      • Select Boot / Boot Sector Recovery
      • Select Rebuild Boot Sector (you should see "Extrapolated boot sector and current boot sector are different"
      • Select Write Boot Sector
      • Reboot (you can expect a configuration changed error at this stage).
    • Reboot from your Win7/Vista Installation DVD
      • Select Repair Your Computer
      • Select Repair & Reboot.
      Windows should now boot normally.

[top of page]

Please remember that you alone are responsible for the consequences of any changes you make to your computer hardware or software.

Copyright © LarryM 1998-2013 thpc@mail.com