Monday, February 18, 2008

Understanding the Ubuntu Filesystem

In Windows you have your C:\ drive. That's where everything is. C:\windows\ is where the files that drive your operating system live. C:\Documents and Settings\Users\your login\ is where the files specific to you live at such as My Documents, Desktop, and Local Settings.

Why the hell does Windows call your hard drive C:\? I'll tell you. It's because back in the early days, there were no hard drives. You would turn on your Apple IIe or Commodore 64 (what I grew up with) and the operating system was built into the hardware. When you wanted to load a program, you had to attach either a cassette tape player or a floppy disk drive which used 5.25" floppy disks. Back then they were actually floppy, too.

If you wrote a program or document you wanted to save, you had to insert a floppy disk or an audio cassette, and you had to type a command like SAVE , 8 "Document". Then you went and had dinner and watched two TV shows while your document saved for an hour.

Since those drives were your first drives, they were lettered with A:\. Then the IBM personal computer came along and inside it was a very small hard drive. It was the third drive, behind the tape recorder and the floppy disk drive. Thus, it is called "C:\" and your CD/DVD drive is called D:\... everything else is lettered E, F, G, etc.

In fact, in Windows you can letter your drives anything you want.

But did you know that you can also create virtual drives? That you can have both C:\ and D:\ on the same piece of hard disk drive hardware? You can. That's because you can partition your drive. Most people use one large partition on their drives, so each drive gets one letter, but you don't have to do that. You can have multiples.

Unix, and therefore Linux, is far more graceful in handling things, and if you learn the system, you will come to understand that it is not necessary to have A drives, B drives, and the like.

Linux has root. Root is called /. The slash is forward instead of backward. Root is where everything starts on a filesystem or "host."

/ is the beginning of everything - the folder that all other folders are in. If you think about it, it makes sense to use a forward slash. When you use text to describe folders inside folders, the forward slashes look more obvious:

/
/etc
/opt
/home
/sbin
/var
/mount
/media
/bin

The nice forward slashes show how everything spills down from above.

When you attach a new hard disk, you "mount" it in the filesystem. That means that you tell your operating system, when it boots up, to use that hardware to put a certain part of the filesystem on it. You can mount pieces of the filesystem to hardware anywhere you want.

For example, you can have two hard drives, and everything goes on one drive, and then /home and everything below it goes on the other. The possibilities are endless and allow a system administrator to use 50 hards drive and spread a single host across them all by attaching various directories to each hard drive.

Theoretically, you could just keep doing this forever.

So, what the heck are those directories in Ubuntu Linux, anyway?

/home - this is the equivalent of Windows' "Documents and Settings." It contains your documents, and all of the individual settings for you for any program on your computer. Those settings are usually in hidden folders - hidden folders have a . at the beginning of the filename like this: .name

/opt - this is a good place to tell software to install when you run any sort of installer outside of the Ubuntu add/remove function or synaptic package manager.

You know what? If you are a beginner, you really don't need to know where anything else is. It all installs and uninstalls automagically using the built in menu items. Most people who use Windows don't know where anything is outside of My Documents, and it is perfectly reasonable that plenty of people will use Linux without giving a crap how it works. So, that's it.

And, by default, you aren't allowed to modify anything outside of your /home directory anyway.

Ubuntu 7.10 even puts a folder for your home directory on the desktop. Isn't that sweet? That way you won't lose it. :-)

No comments: