in Articles

Partitioning – one of the hardest steps in a Linux installation

If you happen to use a Microsoft operating system you are most likely to be familiar with finding your partitions using drive letters, such as C: and D:. When you pop in your brand new Ubuntu CD and start the installation, you will notice that there are no C and D drives, but instead lots of letter and number combinations. Do you feel lost? Let’s work it out.

First of all it is important to grasp the idea behind partitions. Standard computers usually only have one partition on the hard-drive which is called C: in Windows. A partition is simply a way of grouping information on your drive into chunks. If you only see one drive in Windows, you probably have a partition which spans the entire disk.

When looking at the drive and partitions in Linux, it will look somewhat different. There is first of all no concept of drive letters, but instead device names and mount points.

A Linux system has a root file-system called / and there other file-systems may be added, such as a /home for user files, similar to Documents and Settings in Windows. The drives are represented in file-form like /dev/hda. This means that this drive is the primary master. Primary slave is hdb, secondary master, hdc and secondary slave hdd. Don’t worry if you didn’t understand that, because drives are most often on the primary master, which is /dev/hda.

On each of these drives, partitions are accessed adding numbers in the end of the drive, where 1 is the first partition of the drive. Examples of this is /dev/hda1, /dev/hda2 and so on.

So what does this mean for me, you might ask? Well, when installing modern distributions such as Ubuntu, the Linux partitions can be created automatically for you by shrinking your big Windows partition, but it might be more interesting to manage this yourself, either for curiosity or just for plain ol’ control.

If you have Windows installed, it will most likely be installed on /dev/hda1, which is the first partition on the first disk. In the Ubuntu installer you can shrink this partition to make way for two Linux partitions. One for the root file-system (/) and one for the swap, which is a virtual memory used when you are out of RAM.

I would say that giving around 10GB for your Linux partition is reasonable, and maybe 500MB for the swap. When creating these partitions your 10GB partition which you will select as root (/) will be /dev/hda2 and the swap, which should be marked as swap will be /dev/hda3.

By now you should hopefully be able to get past the dreaded partitioning screen of the Linux installation procedure.

The following is an example where there is one Windows partition (hda1), one root Linux partition (hda2), one swap (hda3) and a large storage partition (hda4), which can be read both in Linux and Windows using the NTFS-3G driver for Linux.
gparted.png
As you can see, there is not much to partitioning once you get the idea of different chunks and that a drive can have multiple chunks, under which names they are represented etc.