Filing cabinets 101 - An introduction to disk partitions

21 October 2007

Your computer contains a round hunk of metal called a 'hard disk'. This bit of metal spins around inside a drive, a bit like an old-fashioned record player. This is one of the two main reasons your computer makes a noise when it is on (the other reason being the cooling fans).

Thanks to Surachit at the Wikimedia Commons for the following diagram:

Diagram of hard disk

The hard disk is where your computer stores information, the classical metaphor is of a filing cabinet. If your computer is an office (i.e. somewhere that you do work), then your hard disk is the filing cabinet; it is the place where the important papers and documents are stored.

An office may have just one little filing cabinet that just has one draw. Or it might have one full-sized filing cabinet that has lots of draws. Or it might even have several filing cabinets.

So imagine you are the manager and you need to make space in an office for a new worker but there is already one person there in the office. You have three choices:

  • You add another filing cabinet for the new worker (if there is room).
  • You can throw out the existing worker and give the existing filing cabinet to the new worker.
  • You could arrange to share the existing filing cabinet between them both. Imagine one of those Swedish modular storage systems where you can easily change the number and size of draws to partition it into different sections. You might make one draw for the existing worker and another draw for the new worker.

So your computer (the office) might already have an operating system (the existing worker), such as Microsoft Windows. You have three choices of what to do:

  • If it is a desktop computer, then you might be able to add another hard-drive for Linux. This is easier than it sounds, you will need a screwdriver and an extra hard-drive, there are lots of websites that explain this. This will not be possible on a laptop.
  • You can get rid of Windows and devote the entire existing hard disk to Linux.
  • You can share the disk between Windows and Linux. You will create one 'partition' for Windows and one 'partition' for Linux. This is normally achieved by shrinking the existing partition to make space for an extra one. Hard disks are so big these days that normally there is plenty of room.
Dual booting

The choice is up to you. Nothing is permanent in software. For example, you might start with different partitions for Linux and Windows and then later ditch Windows completely when you are happy with Linux.

Again, different people do different things. Some people just like Linux and don't want Windows taking up space that can be used for storing more music or videos on. If you are a naughty boy or girl and have an unauthorised copy of Windows software, then you should think strongly about going legit by just having Linux.

A web developer might have both operating systems so he can easily test his websites on Windows as well. Likewise a high-end gamer might keep Windows around as not all high-end expensive games are available for Linux. For me, there are enough games, but if you want a particular game then you might need Windows for that.

For example, Enemy Territory: QUAKE Wars, Tremulous and Halo 3 are all first- person shooter video games. The first two are available for Linux, the third is not. If you are happy with any first-person shooter then Linux has many, but if for some reason you want Halo 3 in particular then you should keep Windows (even though Enemy Territory is better ;).

There are also more modern setups like 'virtualisation' where you run both operating systems at the same time and in the same partition, for example, you might have Windows running inside a window on your Linux computer, that is a topic for another day.

What is the partition naming scheme?

Linux has a partition naming scheme allows us, but more importantly, the computer software, to tell the partitions apart. The naming scheme is very simple:

Disk Type | Disk Letter | Partition Number

There are basically two types of hard disk, SD and HD, which are explained later (for people who really care). Then each disk has a letter. For example, say you have lots of hard disks in your computer, then the first might be called SDA, the second will be SDB, the third SDC and so on. Lastly, each partition has a number. So SDA1 is the first partition on the first disk, SDA2 is the second partition, SDA3 is the third partition and so on.

So you may end up with Windows on SDA1 and Linux on SDA2. Sometimes people will use more partitions, this is optional. On a server, multiple partitions have important uses, but not really so much for a basic desktop setup.

A 'Swap partition' is the most common. This is used for if your computer runs of of memory; rather than queuing tasks, it can use part of the hard-disk for extra memory. Swap space is slightly irrelevant in really modern desktops that have several gigabytes of memory.

What are the types of disk?

This is somewhat academic for our needs at the moment, but I might as well cover this for completeness.

  • SCSI (commonly called Scuzzy) are used on servers and very high-end workstations from the late 1980s through to today.
  • Parallel ATA (PATA - also commonly called IDE, short for Integrated Drive Electronics), these were the standard PC hard disk type from the late 1980s through to the early 2000s, being much cheaper to produce than SCSI disks.
  • Serial ATA (SATA) - this is the newer type of disk, first introduced in 2003 and now the main type in brand new computers. SATA is also starting to give SCSI a run for its money on commodity/low-end servers.

Scuzzy and SATA disks are called SD, PATA disks are called HD.

Discuss this post - Leave a comment

1 Bug says...

Memory Sticks - SD IDE drives on Archlinux - SD as well [Don't ask me why they started to do that, maybe for easier sorting if people forget if it's hd or sd because they got those and those...].

Posted at 7:24 a.m. on October 22, 2007


2 Jonas says...

"Scuzzy and SATA disks are called SD, PATA disks are called HD"

Not necessarily. My PATA disk is (usually) also named SDx, this is in Kubuntu Gutsy. And the SATA disk sometimes get called HDx.

Posted at 8:51 a.m. on October 22, 2007


What do you have to say?

Show Editing Help


About

Hello, my name is Zeth, I'll be your host here.

Command Line Warriors is about taking control of your own technology, it looks at our experiences of computing; especially using GNU/Linux, the Python programming language, the command-line and issues such as techno-ethics, best practices and whatever is cool now. If you take control of your technology then you are a Warrior too!

This site is your site too which means that you can contribute and get involved. You can leave comments using the facility provided. For me, the comments and discussions are by far the best part of the site. So please do have your say!

Latest Discussions

Omar Zabaneh

July 25, 2008
Zeth, Thank you for this post, very helpful. I used it as a basis for my own email validation function that i wish to share with you, in a selfish ...
Email Syntax Check in Python

Double Booting Bastard

July 24, 2008
I agree with Nui, Linux is great for many things but not everything. A lot of, less mainstream, hardware is a time consuming and often fruitless task to install and ...
Give Linux a chance

John

July 23, 2008
Duncan, sadly the permissions are stored with the data (inode), not with the directory entries (hard-links). Zeth needs ACLs -- no way to do this with basic unix permissions.
Advanced Unix Groups

Garrick

July 21, 2008
I do love my iPhone. That being said, I would trade it in a heartbeat for a STABLE Openmoko FreeRunner.
This week - iPhone vs a can of compressed air, and Django NewFormsAdmin

Daniel Davies

July 21, 2008
With regards to your last paragraph, you are certainly correct. Right now Django is a nightmare to use across multiple sites... we have some sites running the newformsadmin branch, others ...
This week - iPhone vs a can of compressed air, and Django NewFormsAdmin

Nui

July 18, 2008
Hmm, this would be more persuasive as an argument with some evidence. I am a happy admin of Windows and a novice user of Linux, so I have taken the ...
Give Linux a chance

Paddy3118

July 18, 2008
Hi, I too work with Electronic Design Automation tools, where Tcl is used extensively. I tend to only occasionally have to write in Tcl and so find the TclTutor utility: ...
Python and TCL

Cliff Wells

July 17, 2008
I personally cannot live without the Web Developer extension or Firebug. Unfortunately these are probably both among the more difficult to port extensions. Given how poorly Firefox functions on Linux ...
Will Epiphany be able to compete with Firefox's extensions?

Åke Forslund

July 13, 2008
I'm pretty much a novice in both of these languages but I find them both easy to use and preform the tasks I give them. However I rarely use them ...
Python and TCL

Christopher Thoday

July 12, 2008
A single test is not sufficient to give you confidence that the algorithm is working. You should make 'number' an argument of 'main' so that you can test some boundary ...
Python and TCL

paul21

July 10, 2008
Shame on Mozilla. They should make developers specify the extension license before hosting it. They should show the license next to download button as well.
Are your Firefox extensions proprietary software?

Tris

July 8, 2008
Justin - You say they had not heard of Linux? That doesn't sound very professional to me!
Give Linux a chance

michael

July 8, 2008
what about Galeon? in Gnome i use Galeon mostly. it is fast and stable and has a nice portal with search masks for Debian, FSF, Freshmeat and so on. wtf ...
Will Epiphany be able to compete with Firefox's extensions?

vermin

July 7, 2008
> Eventually, after a bit of digging and Googling, I found their Toolbar-License... You simply found the license of the StumbleUpon Toolbar for Internet Explorer. This is another product, much ...
Are your Firefox extensions proprietary software?

Andrew West

July 6, 2008
Both the Python and the Tcl example could do with error checking. While at first this may not seem on topic with the post I think it better shows the ...
Python and TCL