it.gen.nz

Writings on technology and society from Wellington, New Zealand

Thursday, March 6, 2008

How computers store information…

…and why you ought to be backing up your computer.

Today on Radio New Zealand National I talked about how computers store things – what is a hard drive, anyway – and, I hope, convinced you that you need to backup your data regularly. It’s not that hard. Read on…

Q: Do computers remember things?

A: Not in the way we do, that’s pretty certain. Or rather, we have a partial understanding of how our brains work and its nothing like any of the technologies that computers use.

Q: Obviously there are lots of different ways computers store information – CDs, memory sticks…

A: Yes, although those are just a few modern examples of removable media. Most computers have hard drives inside which store information, and they have solid state memory which they use for working storage.

Q: That’s the two numbers you hear quoted when you buy a machine?

A: That’s right. You’ll see a machine advertised with, say 2Gigs of memory and a 80Gig hard drive.

Q: And a gig is…?

A: Short for Gigabyte, which looks as though it ought to mean a thousand million bytes.

Q: “ought to mean”?

A: Computers and computer people love round numbers – but computers, as we know, work in binary, that’s base 2 numbers, not the base ten we use from day to day. So to a computer, 2 is a round number, so if 4, and 8, and so forth. Now if you keep going, after ten double-ups you get to 1,024. That’s a round number in computing terms. So a gigabyte is actually a bit bigger than a thousand million bytes, by about 7.5%.

Q: You get more for your money!

A: Not really, because there are other factors which conspire to waste space. On a computer hard drive, for instance, you use up some of the space just by what’s called formatting it – that uses bits of space to provide signposts to the rest of it. And most hard drives have an operating system, like Windows, installed and that uses many gigabytes.

Q: How many?

A: At least 5, often more like 10. There are a lot of other detailed factors which I won’t go into on air, but there’s a link to an article if anyone’s interested. The take home message is, that if you get a computer with, say, an 80Gig hard drive, you are going to be able to use a maximum of 60 give or take for your own use.

Q: So what exactly is a hard drive?

A: let’s just say what it’s not – a hard drive is not the main box which comprises a computer. Some people just refer to the entire unit as the hard drive, but in fact a hard drive is a fair bit smaller than that. I’ve got one here.

Q: And this is a slim silver metal box maybe half the size of a paperback and much thinner than a book. What’s inside?

A: Discs coated in magnetic material. They are free to turn on a spindle, and when its going there’s an electric motor which turns the disc very fast – anything up to 10,000 rpm depending on the particular unit. Faster is better. There are often several discs stacked up on the same spindle so you get more capacity – each disc is called a platter in the trade.

Q: How does it store information?

A: Think of the disc surface as being made of the same substance as the surface of a cassette tape, or a video tape. It’s a magnetic film which you can magnetise one way or the other – either North pole up and South pole down, or vice versa. It gets magnetised by a tiny electric coil called a read/write head that floats just above the disc surface. The same head is used to detect how the disc is magnetised, as well.

Q: “Floats”? How?

A: The head is on the end of a metal arm which moves in an out from the disk’s centre to its edge. If there are lots of platters there are lots of heads and instead of an arm you have an assembly which looks more like a comb, lots of arms joined together at their base and threaded carefully between the platters. The head is only about the width of a human hair from the platters. Now the head is moved in a straight line across the disk from the centre to the edge, all the while the disk is rotating, so you can get to any piece of information on the disk in a few milliseconds.

Q: That’s thousandths of a second, right?

A: Yes. It sounds fast, doesn’t it? In fact, to the computer processor, disk access is achingly, grindingly slow. The computer processor, its brain if you like, is completely solid state and it moves far faster. It doesn’t have to wait for chunks of metal to move around like the disc does. The processor does things in times measured in nanoseconds – there are a million nanoseconds in a millisecond. To put it on a human scale, imagine you have a thought that you want some information. That might take you a second, say, to think what you need. The equivalent of the computer waiting for disk access is that the information you need arrives two weeks later. That’s how slow it is to the computer processor.

Q: Because the processor is so much faster than us, you mean?

A: Yes, it thinks in nanoseconds we we think in seconds. So it’s a bit as though your computer had to send out the archives and wait two weeks every time it wants information from the disc.

Q: How does it get anything done?

A: Because it has other, faster, storage.

Q: That’s the memory, right?

A: Yes, its called RAM or random access memory in the trade. Random means that the computer can get to any bit of the memory without waiting for a disk to move round. It’s a lot faster, but it’s still not as fast as the processor. The way we get round that is that the processor has its own what’s called “cache” memory, which is fast again and it tries to make sure that whatever it needs is already in cache so it doesn’t have to slow down. So, if the processor needs a bit of information, it first check the cache, to us, that’s glancing down at the desktop and seeing if the paper we want is in front of us. If it’s not in the cache the processor looks to see if its in RAM – that’s like going to the filing cabinet in the corner – doesn’t take long, but you break your flow to do it. And if it’s not there the processor sends to the hard disc, which is like sending out to archives and waiting for two weeks.

Q: How on earth does all this stuff actually happen!

A: Through some very clever programming, partly by the chip manufacturers, and partly by the people who design operating systems like Windows or Linux. They have strategies like: we’ve just got a piece of information from slot number 2014, we’ve got a moment on our hands while we are waiting for something else to happen, let’s order up the information form slot number number 2015 and put it in cache because there’s a good chance we’ll want it next. The computer tries to predict what’s needed next and starts to get it ahead of time. This gets a lot more subtle and clever than I’ve suggested here, but that’s the basic idea.

And that is why you need a decent amount of memory in your computer. It needs to have enough space in its memory to grab everything you might need from the disc. If you don;t have enough memory your computer will usually still work but it will be a lot slower than it could be because it will be spending time waiting for disc access.

Q: How much memory should a computer have?

A: If you are buying a new one today, 2 gigabytes. Older ones might have less and still work OK, but really careful about loading new software on, especially something like Vista which is a real resource hog. Vista will bury a slow machine and you will regret it.

Q: And how much disk space do you need?

A: Now that’s a ‘how long is a piece of string’ question. The machine’s no fatser or slower according as to how much disc you have; it just determines how much stuff you can keep. It all depends on what you are going to store. Photos, music, and movies are the main space hogs. We seem to find enough things to store to use whatever space we have. I’ve never bought a disk drive I haven’t filled up eventually. If I were buying new now I’d probably buy at least 200 gigs.

Q: Can you increase it after you have bought a machine?

A: You can add disk to old machines – you can sometimes add memory to old machines as well, but it’s harder. Both are possible to do at home, but don’t attempt it if you’re not comfortable – there are some pitfalls to watch out for. Any computer shop can help.

Q: What about USB memory sticks?

A: They use a different technology, its a form of solid state memory called flash, and that’s the same as the cards we use in cameras. It’s slower than RAM but it’s a lot faster than disk. And it’s also not volatile – unlike RAM, flash keeps the information inside it when the power’s turned off. Flash is coming down in price very fast and some upmarket laptops are beginning to use it instead of a spinning hard drive. Having a flash drive makes a machine faster, makes it use less power, and makes it less delicate than a machine with a disc drive.

Q: Disc drives are delicate! How do they survive in laptops?

A: Well, yes, a disc drive has a rapidly-spinning disk and the head moving microns above it. If the two come into contact it tends to be goodnight nurse to everything on your disc. That’s something you really have to be aware of – you absolutely must have backups of everything you care about on your computer. It could just vanish overnight otherwise. I can’t stress this enough.

Q: How do you do a backup?

A: Simplest way is to buy a hard drive in a box which connects to your computer through its USB port. These things are a couple of hundred dollars in a computer shop. They often come with software for Windows, and Mac users have a great backup program called Time Machine built in to the latest Mac operating system. Check in the shop what you are getting, some are just boxes and you have to supply your own hard drive to go inside, some are complete –if you can’t tell, ask. Get one that’s bigger than the hard drive in your computer. If you don’t have a backup system in place – run, don’t walk, until you get one.

Links

As always, discuss this at it.gen.nz

The size of disc drives and why don’t always get what you think you will.

All you ever wanted to know about different kinds of RAM.

Wikipedia on Solid state drives

An example of an external backup drive.

posted by colin at 10:56 am  

6 Comments

  1. You wanted a backup method for Linux.

    The ‘traditional’ way is just to copy the precious files to the other medium, automatically or by hand as desired.

    the rsync utility is useful to avoid copying unchanged information.

    ‘The Advanced Maryland Automatic Network Disk Archiver’ is a useful back-up package, one of several dozen.

    http://www.amanda.org/

    Remember that you should never, ever, store backups as compressed files.

    Comment by Christopher — 6 March 2008 @ 11:20 am

  2. You state that “you should never ever store backups as compressed files.” My IT ‘expert’ has provided me with a backup program which zips the files to a CD which if necessary can then be read on any PC and unziped not like Windows which requires the original PC to restore. Is this not a recommended system.

    Comment by Robin — 7 March 2008 @ 11:46 am

  3. […] [Via : it.gen.nz » How computers store information ….] […]

    Pingback by * Colin explains hard drives, in TiKouka — 8 March 2008 @ 6:32 am

  4. […] is a lot of confusion about this out there as I said on the radio last week, but the usual definition is 2^10 bytes, which is 1,024 bytes. Here’s a cartoonist’s […]

    Pingback by it.gen.nz » What exactly is a kilobyte? (or a Megabyte, or a Gigabyte) — 12 March 2008 @ 7:20 am

  5. The best way to do backups, on Unix-like systems (Mac OS X, Linux, Solaris, etc.) at least (not sure if this works on MS systems) is to use “rdiff-backup“. It works by syncronising selected files with a backup archive – creating a “mirror” of your files – either on the same computer or across a network (in which case it transfers the data compressed and encrypted).

    What makes it different and better than other systems is that any time it adds, deletes, or updates a file or folder on the mirror, it retains “deltas” (i.e. the change or difference) to the previous version of that file or folder. These deltas can be held for any number of days, limited only by your disk space.

    Keeping deltas means that, in addition to having a mirror of your file system as of the last backup, you can also recover files or entire directories even after they were altered or deleted, so long as they were backed up on some previous day… Incredibly powerful.

    Rdiff-backup is, of course, open source and completely free to use.

    Cheers,

    Dave

    Comment by Dave Lane — 13 March 2008 @ 10:22 am

  6. Thanks, Dave – I’m going to set this up on a couple of my Linux servers.

    Cheers

    Colin

    Comment by colin — 13 March 2008 @ 2:43 pm

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.

Powered by WordPress