I wanted to turn an old laptop from a Windows XP system to one that dual-booted Ubuntu. To get this to work, I first had to resize my Windows partition.
I started out with Windows default disk defragmenter (Accessories => System Tools => Disk Defragmenter). I ran it a few times, but it always left files at the "high end" of the partition so I couldn't downsize the partition.
I then tried Defraggler (http://defraggler.com). This maybe is a bit better at defragmenting, but still left files at the high-end of the partition.
Next came JkDefrag (http://www.kessels.com/Jkdefrag/). This seemed to do the best job at defragmenting, but still left files at the high-end of the partition.
Then I discovered this in the documentation :
- Force together
- Intended for partition resizing. All movable files are moved to the beginning of the disk, even if it means fragmenting them to fill gaps that cannot be filled otherwise.
Using this at the command line gave me what I wanted :
C:\> JkDefrag -a 5 c:
But even that left a few Windows system files ($MFT, $LOGFILE).
This link proved helpful :
So what I wound up doing was using PerfectDisk (http://perfectdisk.com). There were a couple keys here. First, indicate you want to consolidate space. This will help to shrink the files on your partition. Second, defragment (and consolidate) system files. You'll probably have to let PerfectDisk reboot your system and defrag before Windows starts fully. This seemed to move the $MFT and $LOGFILE in. I then reconsolidated one more time, and by then had moved things in about as far as I could. Note I also removed the pagefile and disabled hibernation to get rid of those files as well.
Next I downsized the Windows NTFS partition and then formatted a FAT32 partition for sharing between the two OSes. For this I used with Partition Logic (http://partitionlogic.org.uk). This is a great utility that you'll need to first create a CD and boot from that.
Finally, I tried installing Ubuntu 9.04 with UNetbootin (http://unetbootin.sourceforge.net) which allows you to install Ubuntu from an .iso image available on your Windows partition. No need to burn a CD of the .iso. Much cleaner in this age when network connections are more plentiful than CD-ROMs.
However, my first effort at installing with UNetbootin failed. This is an old laptop with limited disk space, so I ran out of disk the first time. UNetbootin seems to "convert" the Ubuntu .iso into a 700 MB squashfs file which I guess is later booted from. Anyway, I moved the .iso file to a flash drive and tried again.
Unfortunately, UNetbootin didn't work when I rebooted. The Ubuntu installer started on reboot, but I got a seg-fault. One interesting thing was that when I rebooted to Windows, I didn't see the squashfs file anywhere on my hard drive, so I don't know what happened.
I thought about using the Wubi installer (http://wubi-installer.org), but then I'd have to repartition my disk. Also, it seems like the Wubi installation runs from one massive file/partition, so hibernation isn't supported, and it's more vulnerable to file system corruptions from power outages. Not good for a laptop.
Anyway, I don't need Linux on that old laptop, but it was useful to learn a few things.