Gentoo Wiki


This article is part of the Dual Boot series.
Install Linux after Windows Install Windows after Linux Using Windows Loader Using GRUB or LILO coLinux



One thing that keeps many people from using Linux is that they don't want to destroy their Microsoft Windows data. Let's face it, for now, at least, Dual Booting Linux and Windows is important for many Linux users.

So why yet another Windows with GNU/Linux dual boot guide?

Because no other guide tells you how to partition your NTFS filesystem without paying big bucks for partitioning software. This dual boot guide does!

Windows NT/2000/XP/2003 (Using NTFS)

  1. Prepare
  2. Backup data
  3. Defrag Windows
  4. Resize the Windows Partition

Pre Preparation

  1. Use <WIN>+<R> to bring up the windows run prompt
  2. Type in and execute cleanmgr
  3. Use the graphical tool which appears to clear out all the temporary files and folders, and the recycling bin

If you shrink the partition within the Windows, then also do:

to get more space available.

All is described in the manual of JkDefrag. Search for the word "pagefile.sys", and see the subsequent items.


backup any data that you may need to backup. I've done this maybe 20 times without any problem, and I've instructed several others to do it without any problem, but because the universe is conspiring against you, in your case everything is most likely going to break and you MUST backup your important data!!!

  1. Use <WIN>+<E> to bring up the windows explorer
  2. In the window that appears select Tools --> Folder Options --> View and check Show hidden files and folders
  3. Backup everything in C:\Documents and Settings\%YOUR_USER% - including hidden files and folders such as 'Application Data' to Network, CD, DVD, or other medium of choice as your system allows.
    • If you keep any e-mail or data in Outlook Express you will be hard-pressed to try and restore it in either Windows or Linux - I recommend using Mozilla Thunderbird to convert all of your mail, which can easily be restored - just in case anything goes wrong.
  4. Pray to deity of choice...lots.


Microsoft fails to do just about anything correctly (IMHO). Although it's most likely on purpose that their defragger is flawed to prevent you from installing Linux, there is a work-around.

Sorry GNU pals, this requires some commercial software, but think positively - it's getting people to free software.

  1. Download PerfectDisk for a 30-day trial from the nice guys at Raxco.
  2. Install PerfectDisk and adjust the settings for aggressive free space consolidation
  3. Defrag your disk with PerfectDisk (both online and offline defrag)
  4. Reboot
  5. Uninstall PerfectDisk
    • Because the drive was fragmented when PerfectDisk was installed and because it can't defrag it's own program pieces, it is necessary to uninstall perfectdisk.
  6. Reboot
  7. Repeat for good luck
    • You will probably need to come back to this step and resize your partition(s) a few times because PerfectDisk will put the MFT zone in the middle of the hard drive, but as you resize, the middle becomes closer and closer to the beginning - like walking half of the distance to a wall over and over again.

Resizing NTFS (using Windows Vista)

  1. Open up Computer Management. This can be done from the start menu by right-clicking Computer, and then left-clicking Manage from the pop-up context menu.
  2. If you have UAC enabled, you will be prompted to click Continue before Computer Management will open.
  3. Expand Storage, and select Disk Management.
  4. In the top window, right-click the drive letter of the partition you wish to size down. In the pop-up context menu, left-click Shrink Volume.
  5. A "Querying shrink space" notice will appear for a few moments. This may stay there a while.
  6. Use the resize tool to specify how much you would like to shrink your partition. This tool will not let you shrink the partition beyond the last piece of data on the partition, to minimize the risk of data loss.
  7. Once you are satisfied, click Shrink. Your partition will be resized.

Resizing NTFS (using Knoppix)

  1. Download Knoppix
    • Version 3.6 is known to work well for this. I assume every version is stable and should work.
  2. Burn, and Reinsert the knoppix disk, reboot, set your BIOS to boot from CD, boot knoppix
    • Getting dropped into a limited shell? Specify boot: knoppix nodma - this is common with substandard Compaq/HP cd-drives from the Mid-90's
  3. Open a terminal, also called shell (click the monitor-looking icon that (usually) has a shell icon on it)
  4. type in sudo qtparted
  5. Resize the windows partition by adjusting the slider on the partitions as far as it goes (or however much space you want - I recommend 15g for gentoo if you plan to compile gnome and openoffice) but then pull it a little bit back otherwise, by some sort of off-by-one errror you get a message that the drive is fragmented and cannot be resized - so not true.
  6. Hit the save button
    • If it looks frozen, don't be alarmed. Open a terminal and type top. You should see that ntfresize is alive and well... just thinking.
  7. Reboot
  8. Repeat the defragging steps and the resizing steps until the drive is the size you want it to be.
  9. Congratulations. Now you can install Gentoo, or any other GNU/Linux, or another other sane OS in the free space you've created.

Resizing NTFS (using Gentoo LiveDVD 2007.0)

Instead of Knoppix you can also use a Gentoo LiveDVD to run GParted, the GNOME-Version of QTParted.

GParted won't start as the default logged-in user 'gentoo' and gives an explanation good for a smile if you try it. Open any Terminal-Window (e.g. Applications -> System Tools -> Terminal) and type the following commands

Code: starting GParted
sudo /bin/bash
export DISPLAY=:0

This gives you the GTK-Interface to Parted. You can then use it as described in the section on resizing with Knoppix

The Linux Boot Partition

When installing Gentoo, or any other Linux flavour, if you intend using the Windows bootloader (probably a good idea as you have installed Windows first) make sure that your Linux boot partition sits inside an extended partition on the same drive as the Windows partition. Windows does not like to find two active primary partitions on a hard disk; if it does it throws an "Invalid Partition Table" error and refuses to boot. Having both boot sectors on the same physical drive is the best way to avoid grub / lilo problems later on.

Windows 9x (95/98/Me)

  1. Use the windows defragger and follow the steps above
    • If you choose to move your windows partition, be extremely careful, otherwise you might wind up with it in the middle of you drive, unable to go one way or the other.

See Also

Retrieved from ""

Last modified: Fri, 05 Sep 2008 21:02:00 +0000 Hits: 63,214