Step 2: Create a partition for Ubuntu
April 29, 2007
My work attitude towards reformatting is that it should be done as often as necessary – and that is quite often. Every 3-4 weeks or so. IT should provide boot installation services to make this trivial. Network document storage makes this easy. Checking in your code to a private branch makes this easy. Your machine might bork out tomorrow. You shouldn’t fear losing weeks of data.
But at home it’s not quite that easy. My wife and kids rely on the machine for their personal projects and school work. I can’t reformat the system and start from scratch and I wanted to avoid buying a second drive if I could (Circuit City has new laptops for under $400 – why would I want to spend half of that just to get Linux running?).
My current configuration is a 140GB drive that is in a single NTFS partition. It is about 30% full.
The goal was to move everything to the front of the disk, boot to Ubuntu Live CD and figure out how to resize the partition.
I started by running the XP disk cleanup wizard. I’m not a huge fan of this but it consolidates several things I knew I wanted to do into a single action so I could spend my time outside grilling. I also cleaned out my non-system temp directory and uninstalled a few programs that weren’t wanted. This freed up another few gigs and increased the odds of good defragmenting.
I loaded up the XP defrag tool and let it run. Unfortunately it let a few unmovable files in bad places (last quarter of the partition). The size of the unmovable block looked to be at least a gig – it had to be the pagefile (I already have hibernation and restore disks disabled). So I disabled the pagefile and rebooted. After booting I was able to defrag everything except for one thin red line (fragmented file) – it just would not move from the last quarter of the partition. It occurred to me that the file was probably also unmovable but the UI had to pick one color to render. The only thing I could think of was the virus scanner. So I pulled the network cable and disabled the virus scanner and – not surprisingly – the next defrag pass worked like a charm.
I quickly shutdown and booted to Ubuntu.
I did some reading and found several sites that suggested I use qtparted to resize the NTFS partition. Since the live cd does not include qtparted I figured out how to install it –
> sudo apt-get install qtparted
That worked great. I was able to run it and resize the partition (I did not create the new partitions yet). I trimmed off 42 GB from the backend for Linux and shared FAT32 space.
Experienced readers and now laughing and saying “poor newbie didn’t know that a better version of qtparted, called GNOME Partition Editor (gparted) is already installed on the live CD”. Yeah – I found it later. I used it to create the partitions (qtparted was not able to create the extended partition – I have 5 partitions so they couldn’t all be primary).
I rebooted to XP to ensure that everything was still good there – it went through a CHKDSK cycle which went fine and then it needed to reboot once right after starting (I suspect it recognized the drive as a new drive and had to update the hardware configuration). No problems.
Oh – I did backup all of our critical data to DVD before doing any of this.
Finally I was ready to create the new partitions in the newly allocated space. I had 42GB and used this allocation:
/dev/sda2 30GB (ext3)
/dev/sda3 2GB (linux-swap)
/dev/sda5 9+ GB (FAT32)
/dev/sda4 is the root of the extended partition so it does not show up in the list – it is the parent of sda5.
I hope that these were good sizes – they seemed reasonable to me. Only time will tell.
Next step … install Ubuntu.