Partitioning Windows and Ubuntu

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

Disclaimer: I've decided to take this tutorial off the main navigation menu of my website. Its general guidelines and principles are still valid, but at this point in computing history, I think the idea of a traditional dual-boot with separate partitions for each OS and then a possible shared partition is a bit antiquated.

For Windows users still tied to Windows, I would recommend using Ubuntu in VirtualBox or setting up a dual-boot with Wubi (no partitioning necessary).

For sharing files, DropBox is a pretty good option, and it's cross-platform. If you have concerns about privacy, you can use TrueCrypt to make a shared encrypted container for your shared files.

There are definitely situations in which a shared partition would make sense, but I don't think now that should be the norm, and I wouldn't recommend it for most regular setups (migrating from Windows, having a working internet connection).

One of the most frequently asked questions about installing Ubuntu is "How should I partition my drive?"

There are dual-boot guides out there. I have one that features the Desktop CD installer, and then there's Herman's Dual Boot Guide, which features the Alternate CD installer.

The focus of this tutorial is not on how to create the partitions (resizing, etc.) but on planning—what the desirable outcome is.

I'm not going to give you a crash course of what a partition is or what the difference is between a logical or primary partition (I don't even know that myself), but I am going to give you a rundown on the advantages that certain partitioning schemes have over others. The one thing that you do have to understand is that creating a new partition is almost like creating a new hard drive. Sure, it lives on the same hard drive, but it is self-contained. If you erase the data on one partition, it does not affect the other partition's data.

It's almost like having a huge loft apartment. You then decide to build a huge wall in the middle of it. Suddenly, it's not a huge loft apartment—it's now an apartment with two rooms.

So, as the picture above shows, you probably will start out with one large Windows partition that takes up the whole drive. Keep in mind that the partition is just the space. Just because you have a large Windows partition doesn't mean you also have a large Windows installation. You could have a 160 GB hard drive, but your installation, for example, could be only 16 GB (one tenth of the total space available). That installation's partition is still taking up 160 GB of space even though most of the space it's taking up (about 144 GB) is empty space.

This is a pretty typical dual-boot scenario. And I believe it's also the one that will be created if you choose to have Ubuntu's installer automatically resize your Windows partition and create a Ubuntu partition out of the free space. I'm not sure if the proportions are right. Ubuntu's installer probably makes it a little more 50/50, but I'd need someone to confirm that, as I've always done my partitioning manually instead of automatically.

This one's pretty straightforward—one Windows partition, one Ubuntu partition. Just so I can get it out of the way, "swap" is a little partition (usually 1.5 or 2 times the size of your computer's RAM) that helps with memory management and multi-tasking. You'll see a swap partition at the end of each of these little diagrams. You can read more about swap partitions here.

Pictured above is a more common scenario—a Ubuntu partition, a Windows partition, and a FAT32 partition in the middle to share data between the two operating systems. This is frequently recommended on the Ubuntu Forums as a good way to partition a drive, since both Windows and Ubuntu can natively read from and write to FAT32.

Ubuntu now has a pretty reliable mechanism for reading from and writing to NTFS, but some people like to play it extra safe and have a separate FAT32 partition for both Windows and Ubuntu to work from.

This is a slight modification of the above scheme that puts in a tiny /home partition.

/home partitions are wonderful things. It would be the equivalent of Windows of having a partition that was the C:\Documents and Settings folder. That would include My Documents, My Pictures, My Music, and all your hidden settings, too. Likewise, a /home partition in Ubuntu has all your settings. Ordinarily, it would have your files, too, but in the scenario pictured above, your files would live in the FAT32 partition.

The benefit of having a separate /home partition? Well, it means you can reinstall Ubuntu as many times as you'd like and do a clean install (instead of an upgrade) when a new version of Ubuntu comes along. When you first start using Ubuntu, you usually have no idea what you're doing, and you end up breaking something. Now, if you're a veteran, you know how to fix whatever you've broken. If you have a lot of time, you could probably ask around and find out how to fix it. Sometimes, though, it just seems easier to reinstall (the installation takes anywhere from 20 minutes to an hour), and not having to re-do all your settings is a good thing.

And new Ubuntu releases come out every six months. Often part of the appeal of the new release is the improvement to the installation process, so even though people can upgrade, they often don't—they want to see what a "default" installation is like. There can also be breakage in an upgrade, so reinstalling is the safest way to do an upgrade. To have your settings intact is a nice cushion to fall back on.

This last dual-boot scenario is my favorite now that I know about FS-Drive, which is a small program that allows Windows to read from and write to Ext3 partitions. So FAT32 can go out the window—one less partition to worry about and none of the limitations of FAT32 (no file permissions, lots of fragmentation, and a file size limit of 4 GB).

Note that in this scheme, unlike the one above it, it's not just the settings that live in the /home partition but the shared data as well.

If you're over dual-booting and just want a straight Ubuntu installation, this is what it'll look like if you choose to erase the entire hard drive.

This would be a better way to partition your drive for all Ubuntu, for the reasons explained above.

A few other things:

  • If you choose to create a separate /home partition, allocate between 5 and 10 GB for the / partition—that's about all you'll need for the Ubuntu system and programs. The rest should be for your personal files (in /home).
  • Sometimes people have two physically separate hard drives. You should treat that the same as having two pre-defined partitions. The same principles apply. You can have one hard drive be Windows, the other be Ubuntu. You can partition the first drive to be Windows and Ubuntu and then make the second drive a place to store shared data.
  • You may hear people recommending a separate /boot partition or /usr partition. You can make a separate partition for just about any folder in the Ubuntu filesystem. The only down side is running out of space. If you have a 200 GB hard drive, make as many partitions as you can.
  • If you want to resize a partition or add more space to an existing partition, keep in mind that you can add only to the end of a partition, not to the beginning of it.
  • The same ideas here apply to Windows 2000 or to other Linux distributions (besides Ubuntu). If you have Windows ME, 98, or 95, your filesystem will probably already be FAT32, so you wouldn't need to create a separate FAT32 partition to share information on.
  • Someone can correct me on this if I'm wrong, but I haven't seen any difference between putting the swap partition in the middle or at the end of the drive. I put it on the end in these examples because that's what Ubuntu's default installation does.
  • Some Windows users have a program called Partition Magic, but many Ubuntu users have reported problems with setting up a dual boot after using Partition Magic. It's better to use one of these partitioning tools instead (and they're all cost-free). Here are some: QTParted - available on Knoppix live CDs. GParted - available as the default partitioning program for Ubuntu's Desktop CD. DiskDrake - available on PCLinuxOS's live/installer CD.

If you have suggestions or corrections for these tutorials, please post in this Ubuntu Forums thread or leave a comment on my blog.

I will not give help to people posting in the above places. If you require technical support, start a support thread on the Ubuntu Forums. That is the appropriate place to ask for help.