Friday, January 4, 2013

Divorcing Apple - Part 2


Divorcing Apple - Part 2

You’ll remember from part 1 that I’ve decided I want a divorce from Apple, and I’ve decided to get engaged to Ubuntu on a Dell XPS 13 Ultrabook.

So whats it take to get Ubuntu 12.04 up and running?

In part 2 I detail the actual install. It really wasn’t that hard!

Resizing the partitions.
Would it surprise you to know that most of the problems were caused by Windows? Well first off I want to dual boot. That means finding some space on the SSD HD. So I need Windows Storage Manager. Where is it? Well you need to launch Control Panel and then search for ‘partition’. Right thats really user friendly.

Using the Storage Manager tool means I can resize the main partition without losing data, and if I Defrag before that gets gets me an extra GB or so. But how to Defrag, where is the Defrag tool?. Lucky we have Google to be able to answer such questions. Then I deleted the partition ‘Hibernation Partition’. Windows seems to run OK without it. This gets me about 45GB for Precise Pangolin / Sputnik.

Reading on the Internet suggests that painful though it is to use the built-in Windows tools, when it comes to resizing and partition operations, its for the best.

Before I boot Ubuntu, create a back-up disk, which you can do from the Dell utility. Handily fits onto an 8GB USB stick.

During all this, I was unable to shrink the main NTFS partition as much as I wanted, because the partition tool needs to move files away from the end of the partition, and there was an immovable file near the end.

This file C:\$Extend\$UsnJml:$J:$Data and similar, is kept immovable by some system services. You could always go through and stop what you think are unnecessary services, assuming you can find the Services Cpanel, but that seemed risky to me.

What I did to get past this was:

  1. Install Defraggler from http://www.piriform.com/defraggler
  2. Reboot into Safe Mode.
  3. Launch Defraggler, find that file - it’ll be near the end of the partition. Click on it and select to defrag it / them. Defraggler will move the file someplace else.
  4. Reboot into normal mode and run Windows Disk Manager to Shrink the partition as desired for the Ubuntu install

NB Defraggler is the only free Defregger I know that works on individual files.

The Install
The only real problem I had was trying to boot the XPS from USB stick. I followed the instructions, it just wouldn’t do it. It just wouldn’t boot from USB, and I tried both USB ports. Eventually I created a DVD of the Sputnik ISO. In the end I went with the Ubuntu 12.04 64 bit ISO so that I’m on the main supported distro.

During installation, the wizard pretty much takes care of things, however there’s one step that needs attention: you’ll need to sort out your partitions. I went with answer 3 from <http://askubuntu.com/questions/165941/which-partition-should-i-install-on-on-a-dell-xps-13>:

“... ADD the Unallocated partition and set the SIZES to create swap and Root "/" (ext4) partitions .”

Let the install do its thing, and then after the restart, add the Sputnik PPAs to Synaptic to get the XPS drivers and kernel etc:

ppa:canonical-hwe-team/sputnik-policykit
ppa:canonical-hwe-team/sputnik-kernel

Post Install
Finding the answer on the immovable file problem took me a week or so, so I went ahead and installed Ubuntu anyway, figuring I would resize be able to resize Ubuntu after resizing NTFS.

I booted from the LiveCD and started gparted, but I was unable to resize the Extended Partition and therefore the EXT4 inside it, which is where Ubuntu is.

After looking around I found an answer on http://ubuntuforums.org/showthread.php?t=1812754
You can't resize a partition that is mounted and especially you can't resize the root partition from inside the installation. You need to use Gparted from a live CD or live USB. One little gotcha. The live CD will automatically enable (and lock) any swap partition it finds. If your swap partition is a logical one, the extended partition will be locked as well, and if your Ubuntu root partition is also a logical one, this may limit what you can do. Simply right-click on the swap partition in Gparted and choose "swapoff".

After doing this, did two resize operations, the Extended Partition first and then the EXT4, and now I have plenty of space.

The next, Part 3, I discuss some tips and tricks, and summarise the Apple vs Dell XPS 13 hardware differences.

1 comment:

previouslysilent said...

A regular windows user would know to click start menu, and then right mouse on my computer (if you haven't renamed it) and choose manage. Then you can access drive information and rename drives, add shrink or grow partitions etc.

Windows has a hibernate file, not a hibernate partition. However, it's a big file so disabling hibernate, rebooting, will make it easier to defrag and shrink the drive.

Personally, I've found it easier to use Acronis to copy windows off, repartition, and put it back again! This is also good practise for grabbing a copy of windows in case it blows up.


If you want to make a file system larger or smaller in linux use resize2fs. Although it might be easier to rsync the files to external usb drive (be sure to use xattr when mounting and copy extended attributes), or tar-gz it, and then delete the partition, recreate and restore files.